	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsmc_bch8_correct_data
_fsmc_bch8_correct_data:                ## @fsmc_bch8_correct_data
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_nand_to_fsmc
	movq	%rax, %r13
	movq	_STS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, %r14d
	shrl	$10, %r14d
	xorl	%edi, %edi
	andl	$15, %r14d
	sete	%dil
	callq	_likely
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_1
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	xorl	%edi, %edi
	cmpl	$9, %r14d
	setae	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movl	(%r15), %esi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	$8, %edx
	callq	_count_written_bits
	movl	%eax, %ebx
	movl	4(%r15), %esi
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rdi
	movl	$8, %edx
	callq	_count_written_bits
	addl	%eax, %ebx
	cmpl	$8, %ebx
	jg	LBB0_5
## %bb.3:
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_11
## %bb.4:
	movl	4(%r15), %edx
	movq	%r13, %rdi
	movl	$255, %esi
	callq	_memset
	movl	%r14d, %r12d
	jmp	LBB0_11
LBB0_6:
	movq	_ECC1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	movq	_ECC2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	movq	_ECC3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, %ebx
	movq	_STS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %r10d
	andl	$8191, %r10d                    ## imm = 0x1FFF
	movl	-92(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %edx
	shldl	$6, %esi, %edx
	shrl	$13, %esi
	andl	$8191, %esi                     ## imm = 0x1FFF
	movl	%esi, %r8d
	andl	$8191, %edx                     ## imm = 0x1FFF
	movl	%ebx, %esi
	movl	%ebx, %ecx
	shldl	$12, %edi, %ecx
	shrl	$7, %edi
	andl	$8191, %edi                     ## imm = 0x1FFF
	movl	%edi, %r9d
	andl	$8191, %ecx                     ## imm = 0x1FFF
	movl	%ebx, %edi
	shrl	%edi
	andl	$8191, %edi                     ## imm = 0x1FFF
	shrl	$14, %ebx
	andl	$8191, %ebx                     ## imm = 0x1FFF
	shrl	$11, %eax
	andl	$8160, %eax                     ## imm = 0x1FE0
	shrl	$27, %esi
	orl	%eax, %esi
	movl	%r10d, -80(%rbp)
	movl	%r8d, -76(%rbp)
	movl	%edx, -72(%rbp)
	movl	%r9d, -68(%rbp)
	movl	%ecx, -64(%rbp)
	movl	%edi, -60(%rbp)
	movl	%ebx, -56(%rbp)
	movl	%esi, -52(%rbp)
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.7:
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	testl	%r14d, %r14d
	je	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	decl	%r14d
	movslq	%r12d, %r13
	leaq	-80(,%r13,4), %rbx
	addq	%rbp, %rbx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_change_bit
	movl	$1, %edi
	movq	%rbx, %rsi
	callq	_change_bit
	movl	-80(%rbp,%r13,4), %edi
	movl	4(%r15), %eax
	shll	$3, %eax
	cmpl	%eax, %edi
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	callq	_change_bit
	incl	%r12d
	jmp	LBB0_10
LBB0_5:
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_STS,8,3                        ## @STS
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.comm	_ECC1,8,3                       ## @ECC1
	.comm	_ECC2,8,3                       ## @ECC2
	.comm	_ECC3,8,3                       ## @ECC3
	.no_dead_strip	_fsmc_bch8_correct_data
.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 fsmc_bch8_correct_data
lCPI0_0:
	.long	4294967295                      ; 0xffffffff
	.long	4294967282                      ; 0xfffffff2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_fsmc_bch8_correct_data:                ; @fsmc_bch8_correct_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_nand_to_fsmc
	mov	x21, x0
	ldr	x8, [x0]
Lloh3:
	adrp	x26, _STS@GOTPAGE
Lloh4:
	ldr	x26, [x26, _STS@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	w8, #15
	ands	w25, w8, w0, lsr #10
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_4
; %bb.1:
	mov	w21, #0
LBB0_2:
	ldr	x8, [sp, #40]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.3:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_4:
	cmp	w25, #8
	cset	w0, hi
	bl	_unlikely
	cbz	x0, LBB0_8
; %bb.5:
	ldr	w1, [x20]
	mov	x0, x22
	mov	w2, #8
	bl	_count_written_bits
	mov	x22, x0
	ldr	w1, [x20, #4]
	mov	x0, x19
	mov	w2, #8
	bl	_count_written_bits
	add	w8, w0, w22
	cmp	w8, #8
	b.gt	LBB0_13
; %bb.6:
	mov	x21, x0
	cbz	w0, LBB0_2
; %bb.7:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #255
	bl	_memset
	b	LBB0_2
LBB0_8:
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _ECC1@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ECC1@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x22, x0
	ldr	x8, [x21]
Lloh11:
	adrp	x9, _ECC2@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ECC2@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x23, x0
	ldr	x8, [x21]
Lloh14:
	adrp	x9, _ECC3@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ECC3@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x24, x0
	ldr	x8, [x21]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl_relaxed
	and	w8, w22, #0x1fff
	ubfx	w9, w22, #13, #13
	stp	w8, w9, [sp, #8]
	lsr	w8, w22, #26
	bfi	w8, w23, #6, #7
	ubfx	w9, w23, #7, #13
	stp	w8, w9, [sp, #16]
	lsr	w8, w23, #20
	bfi	w8, w24, #12, #1
	str	w8, [sp, #24]
	dup.2s	v0, w24
Lloh17:
	adrp	x8, lCPI0_0@PAGE
Lloh18:
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi.2s	v1, #31, msl #8
	and.8b	v0, v0, v1
	stur	d0, [sp, #28]
	lsr	w8, w0, #11
	and	w8, w8, #0x1fe0
	bfxil	w8, w24, #27, #5
	str	w8, [sp, #36]
	mov	w21, #0
	cbz	w25, LBB0_2
; %bb.9:
	add	x23, sp, #8
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	cbz	w25, LBB0_2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sub	w25, w25, #1
	add	x22, x23, w21, sxtw #2
	mov	w0, #0
	mov	x1, x22
	bl	_change_bit
	mov	w0, #1
	mov	x1, x22
	bl	_change_bit
	ldr	w0, [x22]
	ldr	w8, [x20, #4]
	cmp	w0, w8, lsl #3
	b.ge	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x1, x19
	bl	_change_bit
	add	w21, w21, #1
	b	LBB0_10
LBB0_13:
Lloh19:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_STS,8,3                        ; @STS
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.comm	_ECC1,8,3                       ; @ECC1
	.comm	_ECC2,8,3                       ; @ECC2
	.comm	_ECC3,8,3                       ; @ECC3
	.no_dead_strip	_fsmc_bch8_correct_data
.subsections_via_symbols
