	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function preset_v2
_preset_v2:                             ## @preset_v2
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_mtd_to_nand
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r14
	movq	_NFC_V2_CONFIG1_FP_INT@GOTPCREL(%rip), %rax
	movq	8(%r14), %rcx
	xorl	%edi, %edi
	cmpl	$0, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	_NFC_V1_V2_CONFIG1_INT_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
LBB0_2:
	orl	(%rax), %edi
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.3:
	movl	4(%r12), %eax
	cltd
	idivl	%ecx
	movl	%eax, %r15d
	movq	(%rbx), %rax
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	movl	$0, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	_NFC_V1_V2_CONFIG1_ECC_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	orl	%edi, %ebx
	movq	%r12, %rdi
	callq	_get_eccsize
	movl	%eax, (%r14)
	cmpl	$4, %eax
	jne	LBB0_7
## %bb.6:
	movq	_NFC_V2_CONFIG1_ECC_MODE_4@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_7:
	orl	%r13d, %ebx
	movl	%r15d, %edi
	callq	_ffs
	leaq	-6(%rax), %rdi
	callq	_NFC_V2_CONFIG1_PPB
	movl	%eax, %edi
	orl	%ebx, %edi
	jmp	LBB0_9
LBB0_8:
	movl	$1, (%r14)
LBB0_9:
	movq	_NFC_V1_V2_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_writew
	movl	8(%r12), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movq	_NFC_V21_RSLTSPARE_AREA@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_V21_UNLOCKSTART_BLKADDR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_writew
	movq	_NFC_V21_UNLOCKSTART_BLKADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_writew
	movq	_NFC_V21_UNLOCKSTART_BLKADDR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_writew
	movq	_NFC_V21_UNLOCKSTART_BLKADDR3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_writew
	movq	_NFC_V21_UNLOCKEND_BLKADDR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_writew
	movq	_NFC_V21_UNLOCKEND_BLKADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_writew
	movq	_NFC_V21_UNLOCKEND_BLKADDR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_writew
	movq	_NFC_V21_UNLOCKEND_BLKADDR3@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
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writew                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NFC_V2_CONFIG1_FP_INT,4,2      ## @NFC_V2_CONFIG1_FP_INT
	.comm	_NFC_V1_V2_CONFIG1_INT_MSK,4,2  ## @NFC_V1_V2_CONFIG1_INT_MSK
	.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_V2_CONFIG1_ECC_MODE_4,4,2  ## @NFC_V2_CONFIG1_ECC_MODE_4
	.comm	_NFC_V1_V2_CONFIG1,4,2          ## @NFC_V1_V2_CONFIG1
	.comm	_NFC_V21_RSLTSPARE_AREA,4,2     ## @NFC_V21_RSLTSPARE_AREA
	.comm	_NFC_V1_V2_CONFIG,4,2           ## @NFC_V1_V2_CONFIG
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR0,4,2 ## @NFC_V21_UNLOCKSTART_BLKADDR0
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR1,4,2 ## @NFC_V21_UNLOCKSTART_BLKADDR1
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR2,4,2 ## @NFC_V21_UNLOCKSTART_BLKADDR2
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR3,4,2 ## @NFC_V21_UNLOCKSTART_BLKADDR3
	.comm	_NFC_V21_UNLOCKEND_BLKADDR0,4,2 ## @NFC_V21_UNLOCKEND_BLKADDR0
	.comm	_NFC_V21_UNLOCKEND_BLKADDR1,4,2 ## @NFC_V21_UNLOCKEND_BLKADDR1
	.comm	_NFC_V21_UNLOCKEND_BLKADDR2,4,2 ## @NFC_V21_UNLOCKEND_BLKADDR2
	.comm	_NFC_V21_UNLOCKEND_BLKADDR3,4,2 ## @NFC_V21_UNLOCKEND_BLKADDR3
	.comm	_NFC_V1_V2_WRPROT,4,2           ## @NFC_V1_V2_WRPROT
	.no_dead_strip	_preset_v2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function preset_v2
_preset_v2:                             ; @preset_v2
	.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
	bl	_mtd_to_nand
	mov	x21, x0
	bl	_nand_get_controller_data
	mov	x20, x0
Lloh0:
	adrp	x8, _NFC_V2_CONFIG1_FP_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NFC_V2_CONFIG1_FP_INT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _NFC_V1_V2_CONFIG1_INT_MSK@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NFC_V1_V2_CONFIG1_INT_MSK@GOTPAGEOFF]
	ldr	w9, [x9]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, w10, wzr, eq
	orr	w0, w9, w8
	ldr	w8, [x19]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w9, [x19, #4]
	sdiv	w22, w9, w8
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _NAND_ECC_HW@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NAND_ECC_HW@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _NFC_V1_V2_CONFIG1_ECC_EN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _NFC_V1_V2_CONFIG1_ECC_EN@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w8, w10, wzr, eq
	orr	w21, w8, w0
	mov	x0, x19
	bl	_get_eccsize
	str	w0, [x20]
Lloh12:
	adrp	x8, _NFC_V2_CONFIG1_ECC_MODE_4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NFC_V2_CONFIG1_ECC_MODE_4@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w0, #4
	csel	w8, w8, wzr, eq
	orr	w20, w21, w8
	mov	x0, x22
	bl	_ffs
	sub	x0, x0, #6
	bl	_NFC_V2_CONFIG1_PPB
	orr	w0, w20, w0
	b	LBB0_3
LBB0_2:
	mov	w8, #1
	str	w8, [x20]
LBB0_3:
Lloh15:
	adrp	x8, _NFC_V1_V2_CONFIG1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NFC_V1_V2_CONFIG1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_writew
	ldr	w8, [x19, #8]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w0, w8, #1
Lloh18:
	adrp	x8, _NFC_V21_RSLTSPARE_AREA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NFC_V21_RSLTSPARE_AREA@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_writew
Lloh21:
	adrp	x8, _NFC_V1_V2_CONFIG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NFC_V1_V2_CONFIG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w0, #2
	bl	_writew
Lloh24:
	adrp	x8, _NFC_V21_UNLOCKSTART_BLKADDR0@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NFC_V21_UNLOCKSTART_BLKADDR0@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_writew
Lloh27:
	adrp	x8, _NFC_V21_UNLOCKSTART_BLKADDR1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _NFC_V21_UNLOCKSTART_BLKADDR1@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_writew
Lloh30:
	adrp	x8, _NFC_V21_UNLOCKSTART_BLKADDR2@GOTPAGE
Lloh31:
	ldr	x8, [x8, _NFC_V21_UNLOCKSTART_BLKADDR2@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_writew
Lloh33:
	adrp	x8, _NFC_V21_UNLOCKSTART_BLKADDR3@GOTPAGE
Lloh34:
	ldr	x8, [x8, _NFC_V21_UNLOCKSTART_BLKADDR3@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_writew
Lloh36:
	adrp	x8, _NFC_V21_UNLOCKEND_BLKADDR0@GOTPAGE
Lloh37:
	ldr	x8, [x8, _NFC_V21_UNLOCKEND_BLKADDR0@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	w0, #65535
	bl	_writew
Lloh39:
	adrp	x8, _NFC_V21_UNLOCKEND_BLKADDR1@GOTPAGE
Lloh40:
	ldr	x8, [x8, _NFC_V21_UNLOCKEND_BLKADDR1@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	w0, #65535
	bl	_writew
Lloh42:
	adrp	x8, _NFC_V21_UNLOCKEND_BLKADDR2@GOTPAGE
Lloh43:
	ldr	x8, [x8, _NFC_V21_UNLOCKEND_BLKADDR2@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	w0, #65535
	bl	_writew
Lloh45:
	adrp	x8, _NFC_V21_UNLOCKEND_BLKADDR3@GOTPAGE
Lloh46:
	ldr	x8, [x8, _NFC_V21_UNLOCKEND_BLKADDR3@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	mov	w0, #65535
	bl	_writew
Lloh48:
	adrp	x8, _NFC_V1_V2_WRPROT@GOTPAGE
Lloh49:
	ldr	x8, [x8, _NFC_V1_V2_WRPROT@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	w0, #4
	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
	b	_writew
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_NFC_V2_CONFIG1_FP_INT,4,2      ; @NFC_V2_CONFIG1_FP_INT
	.comm	_NFC_V1_V2_CONFIG1_INT_MSK,4,2  ; @NFC_V1_V2_CONFIG1_INT_MSK
	.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_V2_CONFIG1_ECC_MODE_4,4,2  ; @NFC_V2_CONFIG1_ECC_MODE_4
	.comm	_NFC_V1_V2_CONFIG1,4,2          ; @NFC_V1_V2_CONFIG1
	.comm	_NFC_V21_RSLTSPARE_AREA,4,2     ; @NFC_V21_RSLTSPARE_AREA
	.comm	_NFC_V1_V2_CONFIG,4,2           ; @NFC_V1_V2_CONFIG
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR0,4,2 ; @NFC_V21_UNLOCKSTART_BLKADDR0
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR1,4,2 ; @NFC_V21_UNLOCKSTART_BLKADDR1
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR2,4,2 ; @NFC_V21_UNLOCKSTART_BLKADDR2
	.comm	_NFC_V21_UNLOCKSTART_BLKADDR3,4,2 ; @NFC_V21_UNLOCKSTART_BLKADDR3
	.comm	_NFC_V21_UNLOCKEND_BLKADDR0,4,2 ; @NFC_V21_UNLOCKEND_BLKADDR0
	.comm	_NFC_V21_UNLOCKEND_BLKADDR1,4,2 ; @NFC_V21_UNLOCKEND_BLKADDR1
	.comm	_NFC_V21_UNLOCKEND_BLKADDR2,4,2 ; @NFC_V21_UNLOCKEND_BLKADDR2
	.comm	_NFC_V21_UNLOCKEND_BLKADDR3,4,2 ; @NFC_V21_UNLOCKEND_BLKADDR3
	.comm	_NFC_V1_V2_WRPROT,4,2           ; @NFC_V1_V2_WRPROT
	.no_dead_strip	_preset_v2
.subsections_via_symbols
