	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vf610_nfc_correct_data
_vf610_nfc_correct_data:                ## @vf610_nfc_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_chip_to_nfc
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r13
	xorl	%edi, %edi
	callq	_NFC_MAIN_AREA
	movq	_ECC_SRAM_ADDR@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	_ECC_STATUS@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movl	4(%r14), %r15d
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_vf610_nfc_read
	movzbl	%al, %eax
	movq	_ECC_STATUS_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	%r14, %rdi
	addq	$4, %rdi
	movl	%r15d, %ebx
	shrl	$31, %ebx
	addl	%r15d, %ebx
	sarl	%ebx
	movl	$1, (%r14)
	movl	(%r13), %r8d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movq	%r12, %rcx
	callq	_nand_read_oob_op
	movl	$0, (%r14)
	movl	8(%r14), %esi
	movl	(%r13), %ecx
	movl	%ebx, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_nand_check_erased_ecc_chunk
	jmp	LBB0_2
LBB0_1:
	movq	_ECC_STATUS_ERR_COUNT@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ECC_SRAM_ADDR,8,3              ## @ECC_SRAM_ADDR
	.comm	_ECC_STATUS,8,3                 ## @ECC_STATUS
	.comm	_ECC_STATUS_ERR_COUNT,4,2       ## @ECC_STATUS_ERR_COUNT
	.comm	_ECC_STATUS_MASK,4,2            ## @ECC_STATUS_MASK
	.no_dead_strip	_vf610_nfc_correct_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vf610_nfc_correct_data
_vf610_nfc_correct_data:                ; @vf610_nfc_correct_data
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x23, x0
	bl	_chip_to_nfc
	mov	x22, x0
	mov	x0, x23
	bl	_nand_to_mtd
	mov	x23, x0
	mov	w0, #0
	bl	_NFC_MAIN_AREA
Lloh0:
	adrp	x8, _ECC_SRAM_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ECC_SRAM_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ECC_STATUS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ECC_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x8, x0
	add	x1, x8, x9
	mov	x24, x22
	ldr	w25, [x24, #4]!
	mov	x0, x22
	bl	_vf610_nfc_read
	and	w8, w0, #0xff
Lloh6:
	adrp	x9, _ECC_STATUS_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ECC_STATUS_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_2
; %bb.1:
	cmp	w25, #0
	cinc	w8, w25, lt
	asr	w25, w8, #1
	mov	w8, #1
	str	w8, [x22]
	ldr	w4, [x23]
	mov	x0, x24
	mov	x1, x21
	mov	w2, #0
	mov	x3, x19
	bl	_nand_read_oob_op
	str	wzr, [x22]
	ldr	w1, [x22, #8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x2, x19
	mov	x4, #0
	mov	w5, #0
	mov	x6, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nand_check_erased_ecc_chunk
LBB0_2:
Lloh9:
	adrp	x9, _ECC_STATUS_ERR_COUNT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ECC_STATUS_ERR_COUNT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w0, w9, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ECC_SRAM_ADDR,8,3              ; @ECC_SRAM_ADDR
	.comm	_ECC_STATUS,8,3                 ; @ECC_STATUS
	.comm	_ECC_STATUS_ERR_COUNT,4,2       ; @ECC_STATUS_ERR_COUNT
	.comm	_ECC_STATUS_MASK,4,2            ; @ECC_STATUS_MASK
	.no_dead_strip	_vf610_nfc_correct_data
.subsections_via_symbols
