	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bf5xx_nand_correct_data_256
_bf5xx_nand_correct_data_256:           ## @bf5xx_nand_correct_data_256
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r12
	callq	_mtd_to_nand_info
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %r15d
	shll	$8, %r15d
	orl	(%rbx), %r15d
	movl	8(%rbx), %r13d
	shll	$16, %r13d
	xorl	%ebx, %ebx
	orl	%r15d, %r13d
	je	LBB0_10
## %bb.1:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	4(%r14), %r12d
	shll	$8, %r12d
	orl	(%r14), %r12d
	movl	8(%r14), %r14d
	shll	$16, %r14d
	orl	%r12d, %r14d
	movl	%r14d, %eax
	xorl	%r13d, %eax
	je	LBB0_10
## %bb.2:
	testl	%r14d, %r14d
	je	LBB0_10
## %bb.3:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_hweight32
	cmpl	$1, %eax
	jne	LBB0_5
## %bb.4:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_5:
	andl	$2047, %r15d                    ## imm = 0x7FF
	andl	$2047, %r12d                    ## imm = 0x7FF
	movl	%r12d, %eax
	xorl	%r15d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, %ebx
	shrl	$11, %ebx
	andl	$2047, %ebx                     ## imm = 0x7FF
	xorl	%r15d, %ebx
	movl	%r14d, %r15d
	shrl	$11, %r15d
	andl	$2047, %r15d                    ## imm = 0x7FF
	xorl	%r12d, %r15d
	movl	%r15d, %eax
	xorl	%ebx, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edx
	movl	%r15d, %ecx
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_hweight32
	movl	(%r12), %edi
	cmpl	$11, %eax
	jne	LBB0_8
## %bb.6:
	cmpl	$2047, %ebx                     ## imm = 0x7FF
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movl	%r14d, %eax
	andb	$7, %r14b
	movl	$1, %edx
	movl	%r14d, %ecx
	shll	%cl, %edx
	shrl	$3, %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	xorl	%edx, (%rcx,%rax,4)
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	movl	(%r12), %edi
	leaq	L_.str.6(%rip), %rsi
LBB0_9:
	callq	_dev_err
	movl	$1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ECC data was incorrect!\n"

L_.str.1:                               ## @.str.1
	.asciz	"syndrome[%d] 0x%08x\n"

L_.str.2:                               ## @.str.2
	.asciz	"calced[0x%08x], stored[0x%08x]\n"

L_.str.3:                               ## @.str.3
	.asciz	"1-bit correctable error, correct it.\n"

L_.str.4:                               ## @.str.4
	.asciz	"syndrome[1] 0x%08x\n"

L_.str.5:                               ## @.str.5
	.asciz	"More than 1-bit error, non-correctable error.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Please discard data, mark bad block\n"

	.no_dead_strip	_bf5xx_nand_correct_data_256
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bf5xx_nand_correct_data_256
_bf5xx_nand_correct_data_256:           ; @bf5xx_nand_correct_data_256
	.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	x21, x3
	mov	x22, x2
	mov	x19, x1
	bl	_mtd_to_nand_info
	ldp	w8, w9, [x21]
	orr	w23, w8, w9, lsl #8
	ldr	w8, [x21, #8]
	orr	w24, w23, w8, lsl #16
	ldp	w8, w9, [x22]
	orr	w26, w8, w9, lsl #8
	ldr	w8, [x22, #8]
	orr	w25, w26, w8, lsl #16
	eor	w21, w25, w24
	cmp	w24, #0
	ccmp	w21, #0, #4, ne
	ccmp	w25, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_9
LBB0_2:
	mov	x20, x0
	mov	x0, x21
	bl	_hweight32
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_4:
	and	w8, w23, #0x7ff
	and	w9, w26, #0x7ff
	eor	w23, w9, w8
	ubfx	w10, w24, #11, #11
	eor	w27, w10, w8
	ubfx	w8, w25, #11, #11
	eor	w28, w8, w9
	eor	w26, w28, w27
	ldr	w0, [x20]
	stp	xzr, x21, [sp]
Lloh2:
	adrp	x22, l_.str.1@PAGE
Lloh3:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_dev_info
	ldr	w0, [x20]
	mov	w8, #1
	stp	x8, x23, [sp]
	mov	x1, x22
	bl	_dev_info
	ldr	w0, [x20]
	mov	w8, #2
	stp	x8, x27, [sp]
	mov	x1, x22
	bl	_dev_info
	ldr	w0, [x20]
	mov	w8, #3
	stp	x8, x28, [sp]
	mov	x1, x22
	bl	_dev_info
	ldr	w0, [x20]
	mov	w8, #4
	stp	x8, x26, [sp]
	mov	x1, x22
	bl	_dev_info
	ldr	w0, [x20]
	stp	x24, x25, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_info
	mov	x0, x21
	bl	_hweight32
	mov	x8, x0
	ldr	w0, [x20]
	cmp	w8, #11
	b.ne	LBB0_7
; %bb.5:
	cmp	w26, #2047
	b.ne	LBB0_7
; %bb.6:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	ldr	w0, [x20]
	mov	x8, x23
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	lsr	w8, w23, #3
	lsl	x8, x8, #2
	ldr	w9, [x19, x8]
	and	w10, w23, #0x7
	mov	w11, #1
	lsl	w10, w11, w10
	eor	w9, w9, w10
	str	w9, [x19, x8]
	b	LBB0_9
LBB0_7:
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	ldr	w0, [x20]
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_8:
	bl	_dev_err
	mov	w0, #1
LBB0_9:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ECC data was incorrect!\n"

l_.str.1:                               ; @.str.1
	.asciz	"syndrome[%d] 0x%08x\n"

l_.str.2:                               ; @.str.2
	.asciz	"calced[0x%08x], stored[0x%08x]\n"

l_.str.3:                               ; @.str.3
	.asciz	"1-bit correctable error, correct it.\n"

l_.str.4:                               ; @.str.4
	.asciz	"syndrome[1] 0x%08x\n"

l_.str.5:                               ; @.str.5
	.asciz	"More than 1-bit error, non-correctable error.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Please discard data, mark bad block\n"

	.no_dead_strip	_bf5xx_nand_correct_data_256
.subsections_via_symbols
