	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pof_write_open                 ## -- Begin function pof_write_open
	.p2align	4, 0x90
_pof_write_open:                        ## @pof_write_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	je	LBB0_5
## %bb.1:
	movq	_LOG_POF_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hysdn_addlog
LBB0_3:
	movq	_ERR_ALREADY_BOOT@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rsi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.9:
	movq	%rax, %r14
	movq	%rax, 24(%rbx)
	movq	_CARD_STATE_BOOTING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	*16(%rbx)
	movq	%rbx, %rdi
	callq	*8(%rbx)
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movq	_LOG_POF_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hysdn_addlog
LBB0_12:
	movq	_ERR_BOARD_DPRAM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	_CARD_STATE_BOOTERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rbx)
	jmp	LBB0_16
LBB0_6:
	movq	_LOG_MEM_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hysdn_addlog
LBB0_8:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_13:
	movq	$0, 24(%r14)
	movq	_POF_READ_FILE_HEAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	%r14, %rdi
	callq	_StartDecryption
	movq	_LOG_POF_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_15
## %bb.14:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hysdn_addlog
LBB0_15:
	movq	8(%r14), %rax
	movq	%rax, (%r15)
	movl	$4, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_LOG_POF_OPEN,4,2               ## @LOG_POF_OPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"POF open: already opened for boot"

	.comm	_ERR_ALREADY_BOOT,4,2           ## @ERR_ALREADY_BOOT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_LOG_MEM_ERR,4,2                ## @LOG_MEM_ERR
L_.str.1:                               ## @.str.1
	.asciz	"POF open: unable to allocate mem"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_CARD_STATE_BOOTING,4,2         ## @CARD_STATE_BOOTING
L_.str.2:                               ## @.str.2
	.asciz	"POF open: DPRAM test failure"

	.comm	_ERR_BOARD_DPRAM,4,2            ## @ERR_BOARD_DPRAM
	.comm	_CARD_STATE_BOOTERR,4,2         ## @CARD_STATE_BOOTERR
	.comm	_POF_READ_FILE_HEAD,4,2         ## @POF_READ_FILE_HEAD
L_.str.3:                               ## @.str.3
	.asciz	"POF open: success"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pof_write_open                 ; -- Begin function pof_write_open
	.p2align	2
_pof_write_open:                        ; @pof_write_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _LOG_POF_OPEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LOG_POF_OPEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_hysdn_addlog
LBB0_3:
Lloh5:
	adrp	x8, _ERR_ALREADY_BOOT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_ALREADY_BOOT@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x21, x1
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.7:
	mov	x20, x0
	str	x0, [x19, #24]
Lloh10:
	adrp	x8, _CARD_STATE_BOOTING@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CARD_STATE_BOOTING@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	x8, [x19, #16]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #8]
	mov	x0, x19
	blr	x8
	cbz	x0, LBB0_14
; %bb.8:
	ldr	w8, [x19]
Lloh13:
	adrp	x9, _LOG_POF_OPEN@GOTPAGE
Lloh14:
	ldr	x9, [x9, _LOG_POF_OPEN@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_hysdn_addlog
LBB0_10:
Lloh18:
	adrp	x8, _ERR_BOARD_DPRAM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERR_BOARD_DPRAM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	str	w0, [x20]
Lloh21:
	adrp	x8, _CARD_STATE_BOOTERR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CARD_STATE_BOOTERR@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	b	LBB0_5
LBB0_11:
	ldr	w8, [x19]
Lloh24:
	adrp	x9, _LOG_MEM_ERR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _LOG_MEM_ERR@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.12:
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_hysdn_addlog
LBB0_13:
Lloh29:
	adrp	x8, _EFAULT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_4
LBB0_14:
	str	xzr, [x20, #24]
Lloh31:
	adrp	x8, _POF_READ_FILE_HEAD@GOTPAGE
Lloh32:
	ldr	x8, [x8, _POF_READ_FILE_HEAD@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x20, #16]
	mov	x0, x20
	bl	_StartDecryption
	ldr	w8, [x19]
Lloh34:
	adrp	x9, _LOG_POF_OPEN@GOTPAGE
Lloh35:
	ldr	x9, [x9, _LOG_POF_OPEN@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
Lloh37:
	adrp	x1, l_.str.3@PAGE
Lloh38:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_hysdn_addlog
LBB0_16:
	ldr	x8, [x20, #8]
	str	x8, [x21]
	mov	w0, #4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_LOG_POF_OPEN,4,2               ; @LOG_POF_OPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"POF open: already opened for boot"

	.comm	_ERR_ALREADY_BOOT,4,2           ; @ERR_ALREADY_BOOT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_LOG_MEM_ERR,4,2                ; @LOG_MEM_ERR
l_.str.1:                               ; @.str.1
	.asciz	"POF open: unable to allocate mem"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_CARD_STATE_BOOTING,4,2         ; @CARD_STATE_BOOTING
l_.str.2:                               ; @.str.2
	.asciz	"POF open: DPRAM test failure"

	.comm	_ERR_BOARD_DPRAM,4,2            ; @ERR_BOARD_DPRAM
	.comm	_CARD_STATE_BOOTERR,4,2         ; @CARD_STATE_BOOTERR
	.comm	_POF_READ_FILE_HEAD,4,2         ; @POF_READ_FILE_HEAD
l_.str.3:                               ; @.str.3
	.asciz	"POF open: success"

.subsections_via_symbols
