	.file	"extr_sunxi_nand.c_sunxi_nfc_hw_ecc_correct.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sunxi_nfc_hw_ecc_correct, @function
sunxi_nfc_hw_ecc_correct:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r9
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR 16[rdi]
	mov	QWORD PTR [rsp], rsi
	mov	QWORD PTR 8[rsp], rdx
	call	to_sunxi_nfc@PLT
	mov	DWORD PTR 0[r13], 0
	mov	edi, ebp
	mov	r14, rax
	call	NFC_ECC_ERR@PLT
	and	eax, ebx
	je	.L2
	mov	r15d, DWORD PTR EBADMSG[rip]
	neg	r15d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, ebp
	mov	r15d, eax
	call	NFC_ECC_PAT_FOUND@PLT
	test	eax, ebx
	jne	.L16
	mov	rbx, QWORD PTR [r14]
	mov	edi, ebp
	call	NFC_REG_ECC_ERR_CNT@PLT
	lea	rdi, [rbx+rax]
	call	readl@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	edi, ebp
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	esi, eax
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	NFC_ECC_ERR_CNT@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rdi, QWORD PTR NFC_REG_PAT_ID[rip]
	add	rdi, QWORD PTR [r14]
	xor	ebp, ebp
	call	readl@PLT
	not	eax
	mov	edi, eax
	and	edi, 1
	call	unlikely@PLT
	test	rax, rax
	jne	.L5
	mov	DWORD PTR 0[r13], 1
	mov	ebp, 255
.L5:
	mov	rdi, QWORD PTR [rsp]
	test	rdi, rdi
	je	.L6
	mov	rdx, QWORD PTR 8[r12]
	mov	esi, ebp
	call	memset@PLT
.L6:
	mov	rdi, QWORD PTR 8[rsp]
	test	rdi, rdi
	je	.L1
	mov	rdx, QWORD PTR [r12]
	mov	esi, ebp
	add	rdx, 4
	call	memset@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	sunxi_nfc_hw_ecc_correct, .-sunxi_nfc_hw_ecc_correct
	.comm	NFC_REG_PAT_ID,8,8
	.comm	EBADMSG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sunxi_nand.c_sunxi_nfc_hw_ecc_correct.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sunxi_nfc_hw_ecc_correct, %function
sunxi_nfc_hw_ecc_correct:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	ldr	r0, [r0, #8]
	mov	r4, r3
	mov	r9, r1
	mov	r8, r2
	ldr	r7, [sp, #40]
	ldr	r10, [sp, #44]
	bl	to_sunxi_nfc
	mov	r3, #0
	mov	r6, r0
	str	r3, [r10]
	mov	r0, r4
	bl	NFC_ECC_ERR
	ands	fp, r0, r7
	beq	.L2
	ldr	r3, .L17
	ldr	r0, [r3]
	rsb	fp, r0, #0
.L1:
	mov	r0, fp
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r0, r4
	bl	NFC_ECC_PAT_FOUND
	tst	r0, r7
	bne	.L16
	mov	r0, r4
	ldr	r5, [r6]
	bl	NFC_REG_ECC_ERR_CNT
	add	r0, r5, r0
	bl	readl
	mov	r1, r0
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	NFC_ECC_ERR_CNT
.L16:
	ldr	r3, .L17+4
	ldr	r0, [r6]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	readl
	mvn	r0, r0
	and	r0, r0, #1
	bl	unlikely
	cmp	r0, #0
	moveq	r3, #1
	moveq	r4, #255
	movne	r4, fp
	streq	r3, [r10]
	cmp	r9, #0
	beq	.L6
	mov	r0, r9
	mov	r1, r4
	ldr	r2, [r5, #4]
	bl	memset
.L6:
	cmp	r8, #0
	beq	.L1
	ldr	r2, [r5]
	mov	r1, r4
	mov	r0, r8
	add	r2, r2, #4
	bl	memset
	b	.L1
.L18:
	.align	2
.L17:
	.word	EBADMSG
	.word	NFC_REG_PAT_ID
	.size	sunxi_nfc_hw_ecc_correct, .-sunxi_nfc_hw_ecc_correct
	.comm	NFC_REG_PAT_ID,4,4
	.comm	EBADMSG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
