	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpmi_init_last
_gpmi_init_last:                        ## @gpmi_init_last
	.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
	addq	$12, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_gpmi_set_geometry
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_1
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_gpmi_ecc_read_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	_gpmi_ecc_write_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	_gpmi_ecc_read_oob@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movq	_gpmi_ecc_write_oob@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	_gpmi_ecc_read_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	_gpmi_ecc_write_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_gpmi_ecc_read_oob_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_gpmi_ecc_write_oob_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	8(%rbx), %eax
	movl	%eax, 24(%rbx)
	movl	(%rbx), %eax
	movl	%eax, 16(%rbx)
	movq	_gpmi_ooblayout_ops@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_mtd_set_ooblayout
	movq	%rbx, %rdi
	callq	_GPMI_IS_MX6
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movl	(%rbx), %eax
	imull	4(%rbx), %eax
	testb	$7, %al
	jne	LBB0_4
## %bb.3:
	movq	_gpmi_ecc_read_subpage@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_NAND_SUBPAGE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%rbx)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_gpmi_ecc_read_page,4,2         ## @gpmi_ecc_read_page
	.comm	_gpmi_ecc_write_page,4,2        ## @gpmi_ecc_write_page
	.comm	_gpmi_ecc_read_oob,4,2          ## @gpmi_ecc_read_oob
	.comm	_gpmi_ecc_write_oob,4,2         ## @gpmi_ecc_write_oob
	.comm	_gpmi_ecc_read_page_raw,4,2     ## @gpmi_ecc_read_page_raw
	.comm	_gpmi_ecc_write_page_raw,4,2    ## @gpmi_ecc_write_page_raw
	.comm	_gpmi_ecc_read_oob_raw,4,2      ## @gpmi_ecc_read_oob_raw
	.comm	_gpmi_ecc_write_oob_raw,4,2     ## @gpmi_ecc_write_oob_raw
	.comm	_NAND_ECC_HW,4,2                ## @NAND_ECC_HW
	.comm	_gpmi_ooblayout_ops,4,2         ## @gpmi_ooblayout_ops
	.comm	_gpmi_ecc_read_subpage,4,2      ## @gpmi_ecc_read_subpage
	.comm	_NAND_SUBPAGE_READ,4,2          ## @NAND_SUBPAGE_READ
	.no_dead_strip	_gpmi_init_last
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpmi_init_last
_gpmi_init_last:                        ; @gpmi_init_last
	.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
	add	x0, x0, #12
	bl	_nand_to_mtd
	mov	x21, x0
	mov	x0, x19
	bl	_gpmi_set_geometry
	mov	x20, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x20
	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_2:
Lloh0:
	adrp	x8, _gpmi_ecc_read_page@GOTPAGE
Lloh1:
	ldr	x8, [x8, _gpmi_ecc_read_page@GOTPAGEOFF]
Lloh2:
	adrp	x9, _gpmi_ecc_write_page@GOTPAGE
Lloh3:
	ldr	x9, [x9, _gpmi_ecc_write_page@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #56]
Lloh6:
	adrp	x8, _gpmi_ecc_read_oob@GOTPAGE
Lloh7:
	ldr	x8, [x8, _gpmi_ecc_read_oob@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _gpmi_ecc_write_oob@GOTPAGE
Lloh10:
	ldr	x9, [x9, _gpmi_ecc_write_oob@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #48]
Lloh12:
	adrp	x8, _gpmi_ecc_read_page_raw@GOTPAGE
Lloh13:
	ldr	x8, [x8, _gpmi_ecc_read_page_raw@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _gpmi_ecc_write_page_raw@GOTPAGE
Lloh16:
	ldr	x9, [x9, _gpmi_ecc_write_page_raw@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #40]
Lloh18:
	adrp	x8, _gpmi_ecc_read_oob_raw@GOTPAGE
Lloh19:
	ldr	x8, [x8, _gpmi_ecc_read_oob_raw@GOTPAGEOFF]
Lloh20:
	adrp	x9, _gpmi_ecc_write_oob_raw@GOTPAGE
Lloh21:
	ldr	x9, [x9, _gpmi_ecc_write_oob_raw@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
Lloh24:
	adrp	x8, _NAND_ECC_HW@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NAND_ECC_HW@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	stp	w9, w8, [x19, #24]
	ldr	w8, [x19]
	str	w8, [x19, #16]
Lloh27:
	adrp	x1, _gpmi_ooblayout_ops@GOTPAGE
Lloh28:
	ldr	x1, [x1, _gpmi_ooblayout_ops@GOTPAGEOFF]
	mov	x0, x21
	bl	_mtd_set_ooblayout
	mov	x0, x19
	bl	_GPMI_IS_MX6
	cbz	x0, LBB0_1
; %bb.3:
	ldp	w9, w8, [x19]
	mul	w8, w9, w8
	tst	w8, #0x7
	b.ne	LBB0_1
; %bb.4:
Lloh29:
	adrp	x8, _gpmi_ecc_read_subpage@GOTPAGE
Lloh30:
	ldr	x8, [x8, _gpmi_ecc_read_subpage@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	str	w8, [x19, #20]
Lloh32:
	adrp	x8, _NAND_SUBPAGE_READ@GOTPAGE
Lloh33:
	ldr	x8, [x8, _NAND_SUBPAGE_READ@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_gpmi_ecc_read_page,4,2         ; @gpmi_ecc_read_page
	.comm	_gpmi_ecc_write_page,4,2        ; @gpmi_ecc_write_page
	.comm	_gpmi_ecc_read_oob,4,2          ; @gpmi_ecc_read_oob
	.comm	_gpmi_ecc_write_oob,4,2         ; @gpmi_ecc_write_oob
	.comm	_gpmi_ecc_read_page_raw,4,2     ; @gpmi_ecc_read_page_raw
	.comm	_gpmi_ecc_write_page_raw,4,2    ; @gpmi_ecc_write_page_raw
	.comm	_gpmi_ecc_read_oob_raw,4,2      ; @gpmi_ecc_read_oob_raw
	.comm	_gpmi_ecc_write_oob_raw,4,2     ; @gpmi_ecc_write_oob_raw
	.comm	_NAND_ECC_HW,4,2                ; @NAND_ECC_HW
	.comm	_gpmi_ooblayout_ops,4,2         ; @gpmi_ooblayout_ops
	.comm	_gpmi_ecc_read_subpage,4,2      ; @gpmi_ecc_read_subpage
	.comm	_NAND_SUBPAGE_READ,4,2          ; @NAND_SUBPAGE_READ
	.no_dead_strip	_gpmi_init_last
.subsections_via_symbols
