	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function micron_nand_on_die_ecc_status_4
_micron_nand_on_die_ecc_status_4:       ## @micron_nand_on_die_ecc_status_4
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r13d
	movl	%ecx, %ebx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_nand_get_manufacturer_data
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_nand_to_mtd
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_NAND_ECC_STATUS_WRITE_RECOMMENDED@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_1
## %bb.3:
	testl	%r13d, %r13d
	je	LBB0_4
LBB0_5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_micron_nand_on_die_ecc_setup
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	addl	4(%rax), %r8d
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_nand_read_page_op
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.6:
	cmpl	$0, 8(%r12)
	movl	$0, %ecx
	je	LBB0_19
## %bb.7:
	xorl	%edx, %edx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_15 Depth 2
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	12(%r12), %ecx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	testl	%ecx, %ecx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	imull	%edx, %ecx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rcx), %r15
	leaq	(%rax,%rcx,4), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13,%rbx,4), %edi
	xorl	(%r15,%rbx,4), %edi
	callq	_hweight8
	addl	%eax, %r14d
	incq	%rbx
	movl	12(%r12), %eax
	cmpq	%rax, %rbx
	jb	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpl	$-4, 16(%r12)
	jne	LBB0_14
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r14d, %r14d
	cmpl	$-4, 16(%r12)
	je	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx def $rcx
	andl	$268435455, %ecx                ## imm = 0xFFFFFFF
	shlq	$4, %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movslq	4(%rdx), %rdx
	movq	(%r12), %rsi
	leaq	(%rsi,%rcx,4), %r13
	addq	$16, %r13
	addq	%rcx, %rdx
	leaq	(%rax,%rdx,4), %r15
	addq	$16, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15,%rbx,4), %edi
	xorl	(%r13,%rbx,4), %edi
	callq	_hweight8
	addl	%eax, %r14d
	incq	%rbx
	movl	16(%r12), %eax
	addl	$4, %eax
	cmpq	%rax, %rbx
	jb	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%edi, %edi
	cmpl	20(%r12), %r14d
	seta	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%r14d, %edi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_max
	movl	%eax, %ecx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%r14d, 8(%rax)
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	movl	8(%r12), %eax
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	incl	%edx
	cmpq	%rax, %rsi
	jb	LBB0_8
	jmp	LBB0_19
LBB0_1:
	movq	_NAND_STATUS_FAIL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	testl	%r14d, (%rax)
	je	LBB0_19
## %bb.2:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	12(%rax)
	jmp	LBB0_19
LBB0_4:
	movq	(%r12), %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_nand_read_data_op
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_5
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_19:
	movl	%ecx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_STATUS_WRITE_RECOMMENDED,4,2 ## @NAND_ECC_STATUS_WRITE_RECOMMENDED
	.comm	_NAND_STATUS_FAIL,4,2           ## @NAND_STATUS_FAIL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_micron_nand_on_die_ecc_status_4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function micron_nand_on_die_ecc_status_4
_micron_nand_on_die_ecc_status_4:       ; @micron_nand_on_die_ecc_status_4
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x24, x3
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x25, x1
	mov	x20, x0
	bl	_nand_get_manufacturer_data
	mov	x22, x0
	mov	x0, x20
	bl	_nand_to_mtd
	mov	x21, x0
Lloh0:
	adrp	x8, _NAND_ECC_STATUS_WRITE_RECOMMENDED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ECC_STATUS_WRITE_RECOMMENDED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w25
	b.eq	LBB0_15
; %bb.1:
	cbz	w23, LBB0_17
LBB0_2:
	mov	x0, x20
	mov	w1, #0
	bl	_micron_nand_on_die_ecc_setup
	ldr	x3, [x22]
	ldp	w9, w8, [x21]
	add	w4, w9, w8
	mov	x0, x20
	mov	x1, x24
	mov	w2, #0
	bl	_nand_read_page_op
	mov	x23, x0
	cbnz	w0, LBB0_20
; %bb.3:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_18
; %bb.4:
	mov	w25, #0
	mov	x26, #0
	mov	w23, #0
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	ldr	w9, [x20, #12]
	ldr	x8, [x22]
	cbz	w9, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, #0
	mov	w24, #0
	mul	w9, w9, w25
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	add	x28, x10, x9
	add	x19, x8, w9, uxtw #2
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x8, x27, #2
	ldr	w9, [x28, x8]
	ldr	w8, [x19, x8]
	eor	w0, w8, w9
	bl	_hweight8
	add	w24, w24, w0
	add	x27, x27, #1
	ldr	w8, [x20, #12]
	cmp	x27, x8
	b.lo	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w24, #0
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x20, #16]
	cmn	w9, #4
	b.eq	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, #0
	and	x9, x25, #0xfffffff
	lsl	x9, x9, #4
	ldrsw	x10, [x21, #4]
	ldr	x11, [x20]
	add	x11, x11, x9, lsl #2
	add	x28, x11, #16
	add	x9, x9, x10
	add	x8, x8, x9, lsl #2
	add	x19, x8, #16
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x8, x27, #2
	ldr	w9, [x28, x8]
	ldr	w8, [x19, x8]
	eor	w0, w8, w9
	bl	_hweight8
	add	w24, w24, w0
	add	x27, x27, #1
	ldr	w8, [x20, #16]
	add	w8, w8, #4
	cmp	x27, x8
	b.lo	LBB0_12
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #20]
	cmp	w24, w8
	cset	w0, hi
	bl	_WARN_ON
	cbnz	x0, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_max
	mov	x23, x0
	ldr	w8, [x21, #8]
	add	w8, w8, w24
	str	w8, [x21, #8]
	add	x26, x26, #1
	ldr	w8, [x20, #8]
	add	w25, w25, #1
	cmp	x26, x8
	b.lo	LBB0_5
	b	LBB0_20
LBB0_15:
Lloh3:
	adrp	x8, _NAND_STATUS_FAIL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_STATUS_FAIL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w25
	b.eq	LBB0_18
; %bb.16:
	mov	w23, #0
	ldr	w8, [x21, #12]
	add	w8, w8, #1
	str	w8, [x21, #12]
	b	LBB0_20
LBB0_17:
	ldr	x1, [x20]
	ldr	w2, [x21]
	mov	x0, x20
	mov	w3, #0
	bl	_nand_read_data_op
	mov	x23, x0
	cbnz	w0, LBB0_20
	b	LBB0_2
LBB0_18:
	mov	w23, #0
	b	LBB0_20
LBB0_19:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_20:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_STATUS_WRITE_RECOMMENDED,4,2 ; @NAND_ECC_STATUS_WRITE_RECOMMENDED
	.comm	_NAND_STATUS_FAIL,4,2           ; @NAND_STATUS_FAIL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_micron_nand_on_die_ecc_status_4
.subsections_via_symbols
