	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flctl_chip_init_tail
_flctl_chip_init_tail:                  ## @flctl_chip_init_tail
	.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, %rbx
	callq	_mtd_to_flctl
	movq	%rax, %r14
	movl	(%rbx), %eax
	cmpl	$512, %eax                      ## imm = 0x200
	jne	LBB0_4
## %bb.1:
	movl	$0, (%r14)
	movl	32(%r14), %ecx
	cmpl	$33554432, %ecx                 ## imm = 0x2000000
	jle	LBB0_3
## %bb.2:
	movq	_ADRCNT_3@GOTPCREL(%rip), %rcx
	movq	_ADRCNT_4@GOTPCREL(%rip), %rdx
	jmp	LBB0_7
LBB0_4:
	movl	$1, (%r14)
	movl	32(%r14), %ecx
	cmpl	$134217728, %ecx                ## imm = 0x8000000
	jle	LBB0_6
## %bb.5:
	movq	_ADRCNT_3@GOTPCREL(%rip), %rcx
	movq	_ADRCNT2_E@GOTPCREL(%rip), %rdx
	jmp	LBB0_7
LBB0_3:
	cmpl	$131073, %ecx                   ## imm = 0x20001
	movq	_ADRCNT_2@GOTPCREL(%rip), %rcx
	movq	_ADRCNT_3@GOTPCREL(%rip), %rdx
	cmovlq	%rcx, %rdx
	cmovlq	_ADRCNT_1@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_6:
	cmpl	$524289, %ecx                   ## imm = 0x80001
	movq	_ADRCNT_3@GOTPCREL(%rip), %rdx
	cmovgeq	_ADRCNT_4@GOTPCREL(%rip), %rdx
	movq	_ADRCNT_1@GOTPCREL(%rip), %rcx
	cmovgeq	_ADRCNT_2@GOTPCREL(%rip), %rcx
LBB0_7:
	movq	(%rdx), %rdx
	movq	%rdx, 24(%r14)
	movq	(%rcx), %rcx
	movq	%rcx, 16(%r14)
	cmpq	$0, 8(%r14)
	je	LBB0_9
## %bb.8:
	cmpl	$512, %eax                      ## imm = 0x200
	movq	_flctl_4secc_oob_64@GOTPCREL(%rip), %rax
	cmoveq	_flctl_4secc_oob_16@GOTPCREL(%rip), %rax
	movq	_flctl_4secc_largepage@GOTPCREL(%rip), %rcx
	cmoveq	_flctl_4secc_smallpage@GOTPCREL(%rip), %rcx
	movq	%rax, 64(%r14)
	movq	%rcx, 72(%r14)
	movabsq	$42949673472, %rax              ## imm = 0xA00000200
	movq	%rax, 40(%r14)
	movq	_flctl_read_page_hwecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r14)
	movq	_flctl_write_page_hwecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r14)
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r14)
	movq	%r14, %rdi
	callq	_FLCMNCR
	movl	%eax, %edi
	callq	_readl
	movl	%eax, %ebx
	movq	__4ECCEN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_ECCPOS2@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_ECCPOS_02@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_FLCMNCR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	jmp	LBB0_10
LBB0_9:
	movq	_NAND_ECC_SOFT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r14)
LBB0_10:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADRCNT_4,8,3                   ## @ADRCNT_4
	.comm	_ADRCNT_3,8,3                   ## @ADRCNT_3
	.comm	_ADRCNT_2,8,3                   ## @ADRCNT_2
	.comm	_ADRCNT_1,8,3                   ## @ADRCNT_1
	.comm	_ADRCNT2_E,8,3                  ## @ADRCNT2_E
	.comm	_flctl_4secc_oob_16,4,2         ## @flctl_4secc_oob_16
	.comm	_flctl_4secc_smallpage,4,2      ## @flctl_4secc_smallpage
	.comm	_flctl_4secc_oob_64,4,2         ## @flctl_4secc_oob_64
	.comm	_flctl_4secc_largepage,4,2      ## @flctl_4secc_largepage
	.comm	_flctl_read_page_hwecc,4,2      ## @flctl_read_page_hwecc
	.comm	_flctl_write_page_hwecc,4,2     ## @flctl_write_page_hwecc
	.comm	_NAND_ECC_HW,4,2                ## @NAND_ECC_HW
	.comm	__4ECCEN,4,2                    ## @_4ECCEN
	.comm	_ECCPOS2,4,2                    ## @ECCPOS2
	.comm	_ECCPOS_02,4,2                  ## @ECCPOS_02
	.comm	_NAND_ECC_SOFT,4,2              ## @NAND_ECC_SOFT
	.no_dead_strip	_flctl_chip_init_tail
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function flctl_chip_init_tail
lCPI0_0:
	.long	512                             ; 0x200
	.long	10                              ; 0xa
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_flctl_chip_init_tail:                  ; @flctl_chip_init_tail
	.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	x20, x0
	bl	_mtd_to_flctl
	mov	x19, x0
	ldr	w8, [x20]
	cmp	w8, #512
	b.ne	LBB0_2
; %bb.1:
	str	wzr, [x19]
Lloh0:
	adrp	x10, _ADRCNT_3@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ADRCNT_3@GOTPAGEOFF]
Lloh2:
	adrp	x9, _ADRCNT_4@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ADRCNT_4@GOTPAGEOFF]
	ldr	w11, [x19, #32]
	mov	w12, #33554432
Lloh4:
	adrp	x13, _ADRCNT_2@GOTPAGE
Lloh5:
	ldr	x13, [x13, _ADRCNT_2@GOTPAGEOFF]
	cmp	w11, #32, lsl #12               ; =131072
	csel	x14, x10, x13, gt
Lloh6:
	adrp	x15, _ADRCNT_1@GOTPAGE
Lloh7:
	ldr	x15, [x15, _ADRCNT_1@GOTPAGEOFF]
	csel	x13, x13, x15, gt
	cmp	w11, w12
	csel	x9, x9, x14, gt
	csel	x10, x10, x13, gt
	b	LBB0_3
LBB0_2:
	mov	w9, #1
	str	w9, [x19]
	ldr	w9, [x19, #32]
Lloh8:
	adrp	x10, _ADRCNT_3@GOTPAGE
Lloh9:
	ldr	x10, [x10, _ADRCNT_3@GOTPAGEOFF]
Lloh10:
	adrp	x11, _ADRCNT2_E@GOTPAGE
Lloh11:
	ldr	x11, [x11, _ADRCNT2_E@GOTPAGEOFF]
	mov	w12, #134217728
Lloh12:
	adrp	x13, _ADRCNT_4@GOTPAGE
Lloh13:
	ldr	x13, [x13, _ADRCNT_4@GOTPAGEOFF]
	cmp	w9, #128, lsl #12               ; =524288
	csel	x13, x13, x10, gt
Lloh14:
	adrp	x14, _ADRCNT_1@GOTPAGE
Lloh15:
	ldr	x14, [x14, _ADRCNT_1@GOTPAGEOFF]
Lloh16:
	adrp	x15, _ADRCNT_2@GOTPAGE
Lloh17:
	ldr	x15, [x15, _ADRCNT_2@GOTPAGEOFF]
	csel	x14, x15, x14, gt
	cmp	w9, w12
	csel	x9, x11, x13, gt
	csel	x10, x10, x14, gt
LBB0_3:
	ldr	x9, [x9]
	ldr	x10, [x10]
	stp	x10, x9, [x19, #16]
	ldr	x9, [x19, #8]
	cbz	x9, LBB0_5
; %bb.4:
Lloh18:
	adrp	x9, _flctl_4secc_oob_64@GOTPAGE
Lloh19:
	ldr	x9, [x9, _flctl_4secc_oob_64@GOTPAGEOFF]
Lloh20:
	adrp	x10, _flctl_4secc_oob_16@GOTPAGE
Lloh21:
	ldr	x10, [x10, _flctl_4secc_oob_16@GOTPAGEOFF]
	cmp	w8, #512
	csel	x8, x10, x9, eq
Lloh22:
	adrp	x9, _flctl_4secc_largepage@GOTPAGE
Lloh23:
	ldr	x9, [x9, _flctl_4secc_largepage@GOTPAGEOFF]
Lloh24:
	adrp	x10, _flctl_4secc_smallpage@GOTPAGE
Lloh25:
	ldr	x10, [x10, _flctl_4secc_smallpage@GOTPAGEOFF]
	csel	x9, x10, x9, eq
	stp	x8, x9, [x19, #64]
Lloh26:
	adrp	x8, lCPI0_0@PAGE
Lloh27:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #40]
Lloh28:
	adrp	x8, _flctl_read_page_hwecc@GOTPAGE
Lloh29:
	ldr	x8, [x8, _flctl_read_page_hwecc@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	str	w8, [x19, #56]
Lloh31:
	adrp	x8, _flctl_write_page_hwecc@GOTPAGE
Lloh32:
	ldr	x8, [x8, _flctl_write_page_hwecc@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _NAND_ECC_HW@GOTPAGE
Lloh35:
	ldr	x9, [x9, _NAND_ECC_HW@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #48]
	mov	x0, x19
	bl	_FLCMNCR
	bl	_readl
Lloh37:
	adrp	x8, __4ECCEN@GOTPAGE
Lloh38:
	ldr	x8, [x8, __4ECCEN@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh40:
	adrp	x9, _ECCPOS2@GOTPAGE
Lloh41:
	ldr	x9, [x9, _ECCPOS2@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh43:
	adrp	x9, _ECCPOS_02@GOTPAGE
Lloh44:
	ldr	x9, [x9, _ECCPOS_02@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	orr	w20, w8, w9
	mov	x0, x19
	bl	_FLCMNCR
	mov	x1, x0
	mov	x0, x20
	bl	_writel
	b	LBB0_6
LBB0_5:
Lloh46:
	adrp	x8, _NAND_ECC_SOFT@GOTPAGE
Lloh47:
	ldr	x8, [x8, _NAND_ECC_SOFT@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	str	w8, [x19, #48]
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdrp	Lloh26, Lloh28
	.loh AdrpLdr	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_ADRCNT_4,8,3                   ; @ADRCNT_4
	.comm	_ADRCNT_3,8,3                   ; @ADRCNT_3
	.comm	_ADRCNT_2,8,3                   ; @ADRCNT_2
	.comm	_ADRCNT_1,8,3                   ; @ADRCNT_1
	.comm	_ADRCNT2_E,8,3                  ; @ADRCNT2_E
	.comm	_flctl_4secc_oob_16,4,2         ; @flctl_4secc_oob_16
	.comm	_flctl_4secc_smallpage,4,2      ; @flctl_4secc_smallpage
	.comm	_flctl_4secc_oob_64,4,2         ; @flctl_4secc_oob_64
	.comm	_flctl_4secc_largepage,4,2      ; @flctl_4secc_largepage
	.comm	_flctl_read_page_hwecc,4,2      ; @flctl_read_page_hwecc
	.comm	_flctl_write_page_hwecc,4,2     ; @flctl_write_page_hwecc
	.comm	_NAND_ECC_HW,4,2                ; @NAND_ECC_HW
	.comm	__4ECCEN,4,2                    ; @_4ECCEN
	.comm	_ECCPOS2,4,2                    ; @ECCPOS2
	.comm	_ECCPOS_02,4,2                  ; @ECCPOS_02
	.comm	_NAND_ECC_SOFT,4,2              ; @NAND_ECC_SOFT
	.no_dead_strip	_flctl_chip_init_tail
.subsections_via_symbols
