	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function preset_v1
_preset_v1:                             ## @preset_v1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_mtd_to_nand
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	(%rbx), %rdx
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rsi
	movl	$0, %ecx
	cmpq	(%rsi), %rdx
	jne	LBB0_3
## %bb.1:
	xorl	%ecx, %ecx
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.2:
	movq	_NFC_V1_V2_CONFIG1_ECC_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_3:
	movq	8(%rax), %rdx
	cmpl	$0, (%rdx)
	movl	$0, %edi
	jne	LBB0_5
## %bb.4:
	movq	_NFC_V1_V2_CONFIG1_INT_MSK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
LBB0_5:
	orl	%ecx, %edi
	movl	$1, (%rax)
	movq	_NFC_V1_V2_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_writew
	movq	_NFC_V1_V2_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$2, %edi
	callq	_writew
	movq	_NFC_V1_UNLOCKSTART_BLKADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_writew
	movq	_NFC_V1_UNLOCKEND_BLKADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_writew
	movq	_NFC_V1_V2_WRPROT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_writew                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_HW,8,3                ## @NAND_ECC_HW
	.comm	_NFC_V1_V2_CONFIG1_ECC_EN,4,2   ## @NFC_V1_V2_CONFIG1_ECC_EN
	.comm	_NFC_V1_V2_CONFIG1_INT_MSK,4,2  ## @NFC_V1_V2_CONFIG1_INT_MSK
	.comm	_NFC_V1_V2_CONFIG1,4,2          ## @NFC_V1_V2_CONFIG1
	.comm	_NFC_V1_V2_CONFIG,4,2           ## @NFC_V1_V2_CONFIG
	.comm	_NFC_V1_UNLOCKSTART_BLKADDR,4,2 ## @NFC_V1_UNLOCKSTART_BLKADDR
	.comm	_NFC_V1_UNLOCKEND_BLKADDR,4,2   ## @NFC_V1_UNLOCKEND_BLKADDR
	.comm	_NFC_V1_V2_WRPROT,4,2           ## @NFC_V1_V2_WRPROT
	.no_dead_strip	_preset_v1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function preset_v1
_preset_v1:                             ; @preset_v1
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_mtd_to_nand
	mov	x20, x0
	bl	_nand_get_controller_data
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _NAND_ECC_HW@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_ECC_HW@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _NFC_V1_V2_CONFIG1_ECC_EN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NFC_V1_V2_CONFIG1_ECC_EN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w8, wzr, w9, eq
	b	LBB0_3
LBB0_2:
	mov	w8, #0
LBB0_3:
	ldr	x9, [x0, #8]
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _NFC_V1_V2_CONFIG1_INT_MSK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NFC_V1_V2_CONFIG1_INT_MSK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, w10, wzr, eq
	orr	w8, w9, w8
	mov	w9, #1
	str	w9, [x0]
Lloh9:
	adrp	x9, _NFC_V1_V2_CONFIG1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NFC_V1_V2_CONFIG1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_writew
Lloh12:
	adrp	x8, _NFC_V1_V2_CONFIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NFC_V1_V2_CONFIG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #2
	bl	_writew
Lloh15:
	adrp	x8, _NFC_V1_UNLOCKSTART_BLKADDR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NFC_V1_UNLOCKSTART_BLKADDR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_writew
Lloh18:
	adrp	x8, _NFC_V1_UNLOCKEND_BLKADDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NFC_V1_UNLOCKEND_BLKADDR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w0, #65535
	bl	_writew
Lloh21:
	adrp	x8, _NFC_V1_V2_WRPROT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NFC_V1_V2_WRPROT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w0, #4
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_writew
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_HW,8,3                ; @NAND_ECC_HW
	.comm	_NFC_V1_V2_CONFIG1_ECC_EN,4,2   ; @NFC_V1_V2_CONFIG1_ECC_EN
	.comm	_NFC_V1_V2_CONFIG1_INT_MSK,4,2  ; @NFC_V1_V2_CONFIG1_INT_MSK
	.comm	_NFC_V1_V2_CONFIG1,4,2          ; @NFC_V1_V2_CONFIG1
	.comm	_NFC_V1_V2_CONFIG,4,2           ; @NFC_V1_V2_CONFIG
	.comm	_NFC_V1_UNLOCKSTART_BLKADDR,4,2 ; @NFC_V1_UNLOCKSTART_BLKADDR
	.comm	_NFC_V1_UNLOCKEND_BLKADDR,4,2   ; @NFC_V1_UNLOCKEND_BLKADDR
	.comm	_NFC_V1_V2_WRPROT,4,2           ; @NFC_V1_V2_WRPROT
	.no_dead_strip	_preset_v1
.subsections_via_symbols
