	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function micron_nand_init
_micron_nand_init:                      ## @micron_nand_init
	.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, %r13
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_nand_set_manufacturer_data
	movq	%r13, %rdi
	callq	_micron_nand_onfi_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	cmpl	$2048, (%r15)                   ## imm = 0x800
	jne	LBB0_5
## %bb.4:
	movq	_NAND_BBM_FIRSTPAGE@GOTPCREL(%rip), %rax
	movq	_NAND_BBM_SECONDPAGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, (%r13)
LBB0_5:
	movq	%r13, %rdi
	callq	_micron_supports_on_die_ecc
	movq	_MICRON_ON_DIE_MANDATORY@GOTPCREL(%rip), %rsi
	movq	8(%r13), %rdx
	movq	_NAND_ECC_ON_DIE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	(%rsi), %eax
	jne	LBB0_9
## %bb.6:
	cmpq	%rcx, %rdx
	jne	LBB0_7
## %bb.12:
	movq	_MICRON_ON_DIE_UNSUPPORTED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_11
## %bb.13:
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, (%r14)
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_9:
	xorl	%ebx, %ebx
	cmpq	%rcx, %rdx
	jne	LBB0_19
## %bb.10:
	movq	_MICRON_ON_DIE_UNSUPPORTED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str(%rip), %rdi
LBB0_8:
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movq	8(%r14), %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_kfree
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	%eax, %ebx
	cmpl	$4, 48(%r13)
	jne	LBB0_22
## %bb.15:
	movslq	(%r15), %rdi
	addq	8(%r15), %rdi
	movl	(%r12), %esi
	callq	_kmalloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_16
## %bb.20:
	cmpl	$4, 48(%r13)
	jne	LBB0_22
## %bb.21:
	movq	_micron_nand_on_die_4_ooblayout_ops@GOTPCREL(%rip), %rsi
	jmp	LBB0_23
LBB0_22:
	movq	_micron_nand_on_die_8_ooblayout_ops@GOTPCREL(%rip), %rsi
LBB0_23:
	movq	%r15, %rdi
	callq	_mtd_set_ooblayout
	movl	48(%r13), %eax
	leal	(%rax,%rax), %ecx
	movl	%ecx, 16(%r13)
	movl	$512, 20(%r13)                  ## imm = 0x200
	movl	%eax, 24(%r13)
	movq	_NAND_ECC_BCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r13)
	movq	_micron_nand_read_page_on_die_ecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	movq	_micron_nand_write_page_on_die_ecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13)
	movq	_MICRON_ON_DIE_MANDATORY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_26
## %bb.24:
	movq	_nand_read_page_raw_notsupp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movq	_nand_write_page_raw_notsupp@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_26:
	movq	_nand_read_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movq	_nand_write_page_raw@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %eax
	movl	%eax, 28(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NAND_BBM_FIRSTPAGE,4,2         ## @NAND_BBM_FIRSTPAGE
	.comm	_NAND_BBM_SECONDPAGE,4,2        ## @NAND_BBM_SECONDPAGE
	.comm	_MICRON_ON_DIE_MANDATORY,4,2    ## @MICRON_ON_DIE_MANDATORY
	.comm	_NAND_ECC_ON_DIE,8,3            ## @NAND_ECC_ON_DIE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"On-die ECC forcefully enabled, not supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MICRON_ON_DIE_UNSUPPORTED,4,2  ## @MICRON_ON_DIE_UNSUPPORTED
L_.str.1:                               ## @.str.1
	.asciz	"On-die ECC selected but not supported\n"

	.comm	_micron_nand_on_die_4_ooblayout_ops,4,2 ## @micron_nand_on_die_4_ooblayout_ops
	.comm	_micron_nand_on_die_8_ooblayout_ops,4,2 ## @micron_nand_on_die_8_ooblayout_ops
	.comm	_NAND_ECC_BCH,4,2               ## @NAND_ECC_BCH
	.comm	_micron_nand_read_page_on_die_ecc,4,2 ## @micron_nand_read_page_on_die_ecc
	.comm	_micron_nand_write_page_on_die_ecc,4,2 ## @micron_nand_write_page_on_die_ecc
	.comm	_nand_read_page_raw_notsupp,4,2 ## @nand_read_page_raw_notsupp
	.comm	_nand_write_page_raw_notsupp,4,2 ## @nand_write_page_raw_notsupp
	.comm	_nand_read_page_raw,4,2         ## @nand_read_page_raw
	.comm	_nand_write_page_raw,4,2        ## @nand_write_page_raw
	.no_dead_strip	_micron_nand_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function micron_nand_init
_micron_nand_init:                      ; @micron_nand_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x21, x0
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_nand_set_manufacturer_data
	mov	x0, x19
	bl	_micron_nand_onfi_init
	mov	x22, x0
	cbnz	w0, LBB0_15
; %bb.2:
	ldr	w8, [x21]
	cmp	w8, #2048
	b.ne	LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _NAND_BBM_FIRSTPAGE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_BBM_FIRSTPAGE@GOTPAGEOFF]
Lloh4:
	adrp	x9, _NAND_BBM_SECONDPAGE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _NAND_BBM_SECONDPAGE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_4:
	mov	x0, x19
	bl	_micron_supports_on_die_ecc
	mov	x22, x0
Lloh8:
	adrp	x24, _MICRON_ON_DIE_MANDATORY@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MICRON_ON_DIE_MANDATORY@GOTPAGEOFF]
	ldr	w10, [x24]
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _NAND_ECC_ON_DIE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NAND_ECC_ON_DIE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	w0, w10
	b.ne	LBB0_9
; %bb.5:
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.6:
Lloh13:
	adrp	x8, _MICRON_ON_DIE_UNSUPPORTED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MICRON_ON_DIE_UNSUPPORTED@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w22, w8
	b.eq	LBB0_11
; %bb.7:
	movi.2s	v0, #1
	str	d0, [x20]
	b	LBB0_18
LBB0_8:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_9:
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.10:
Lloh19:
	adrp	x8, _MICRON_ON_DIE_UNSUPPORTED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MICRON_ON_DIE_UNSUPPORTED@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_18
LBB0_11:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
LBB0_13:
	bl	_pr_err
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_15:
	ldr	x0, [x20, #8]
	bl	_kfree
	mov	x0, x20
	bl	_kfree
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	w22, #0
	b	LBB0_16
LBB0_18:
	ldr	w8, [x19, #48]
	cmp	w8, #4
	b.ne	LBB0_22
; %bb.19:
	ldrsw	x8, [x21]
	ldr	x9, [x21, #8]
	add	x0, x9, x8
	ldr	w1, [x23]
	bl	_kmalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_27
; %bb.20:
	ldr	w8, [x19, #48]
	cmp	w8, #4
	b.ne	LBB0_22
; %bb.21:
Lloh28:
	adrp	x1, _micron_nand_on_die_4_ooblayout_ops@GOTPAGE
Lloh29:
	ldr	x1, [x1, _micron_nand_on_die_4_ooblayout_ops@GOTPAGEOFF]
	b	LBB0_23
LBB0_22:
Lloh30:
	adrp	x1, _micron_nand_on_die_8_ooblayout_ops@GOTPAGE
Lloh31:
	ldr	x1, [x1, _micron_nand_on_die_8_ooblayout_ops@GOTPAGEOFF]
LBB0_23:
	mov	x0, x21
	bl	_mtd_set_ooblayout
	ldr	w8, [x19, #48]
	lsl	w9, w8, #1
	mov	w10, #512
	stp	w9, w10, [x19, #16]
	str	w8, [x19, #24]
Lloh32:
	adrp	x8, _NAND_ECC_BCH@GOTPAGE
Lloh33:
	ldr	x8, [x8, _NAND_ECC_BCH@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	str	w8, [x19, #44]
Lloh35:
	adrp	x8, _micron_nand_read_page_on_die_ecc@GOTPAGE
Lloh36:
	ldr	x8, [x8, _micron_nand_read_page_on_die_ecc@GOTPAGEOFF]
Lloh37:
	adrp	x9, _micron_nand_write_page_on_die_ecc@GOTPAGE
Lloh38:
	ldr	x9, [x9, _micron_nand_write_page_on_die_ecc@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
Lloh40:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #36]
	ldr	w8, [x24]
	cmp	w22, w8
	b.ne	LBB0_25
; %bb.24:
	mov	w22, #0
Lloh41:
	adrp	x8, _nand_read_page_raw_notsupp@GOTPAGE
Lloh42:
	ldr	x8, [x8, _nand_read_page_raw_notsupp@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
Lloh44:
	adrp	x9, _nand_write_page_raw_notsupp@GOTPAGE
Lloh45:
	ldr	x9, [x9, _nand_write_page_raw_notsupp@GOTPAGEOFF]
	b	LBB0_26
LBB0_25:
	mov	w22, #0
Lloh46:
	adrp	x8, _nand_read_page_raw@GOTPAGE
Lloh47:
	ldr	x8, [x8, _nand_read_page_raw@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _nand_write_page_raw@GOTPAGE
Lloh50:
	ldr	x9, [x9, _nand_write_page_raw@GOTPAGEOFF]
LBB0_26:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #28]
	b	LBB0_16
LBB0_27:
Lloh51:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh52:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh39
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NAND_BBM_FIRSTPAGE,4,2         ; @NAND_BBM_FIRSTPAGE
	.comm	_NAND_BBM_SECONDPAGE,4,2        ; @NAND_BBM_SECONDPAGE
	.comm	_MICRON_ON_DIE_MANDATORY,4,2    ; @MICRON_ON_DIE_MANDATORY
	.comm	_NAND_ECC_ON_DIE,8,3            ; @NAND_ECC_ON_DIE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"On-die ECC forcefully enabled, not supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MICRON_ON_DIE_UNSUPPORTED,4,2  ; @MICRON_ON_DIE_UNSUPPORTED
l_.str.1:                               ; @.str.1
	.asciz	"On-die ECC selected but not supported\n"

	.comm	_micron_nand_on_die_4_ooblayout_ops,4,2 ; @micron_nand_on_die_4_ooblayout_ops
	.comm	_micron_nand_on_die_8_ooblayout_ops,4,2 ; @micron_nand_on_die_8_ooblayout_ops
	.comm	_NAND_ECC_BCH,4,2               ; @NAND_ECC_BCH
	.comm	_micron_nand_read_page_on_die_ecc,4,2 ; @micron_nand_read_page_on_die_ecc
	.comm	_micron_nand_write_page_on_die_ecc,4,2 ; @micron_nand_write_page_on_die_ecc
	.comm	_nand_read_page_raw_notsupp,4,2 ; @nand_read_page_raw_notsupp
	.comm	_nand_write_page_raw_notsupp,4,2 ; @nand_write_page_raw_notsupp
	.comm	_nand_read_page_raw,4,2         ; @nand_read_page_raw
	.comm	_nand_write_page_raw,4,2        ; @nand_write_page_raw
	.no_dead_strip	_micron_nand_init
.subsections_via_symbols
