	.file	"extr_nand_bbt.c_scan_read_oob.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	scan_read_oob, @function
scan_read_oob:
.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
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	call	nand_to_mtd@PLT
	mov	QWORD PTR 48[rsp], 0
	mov	rbp, rax
	mov	eax, DWORD PTR MTD_OPS_PLACE_OOB[rip]
	mov	DWORD PTR 56[rsp], eax
	mov	rax, QWORD PTR 8[rbp]
	mov	QWORD PTR 40[rsp], rax
	test	r14, r14
	je	.L7
	mov	DWORD PTR 12[rsp], 0
	mov	rsi, QWORD PTR 0[rbp]
	lea	r13, 16[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rsi, QWORD PTR 0[rbp]
	mov	rax, QWORD PTR 8[rbp]
	add	rax, rsi
	add	r12d, esi
	lea	rbx, [rbx+rax*4]
	sub	r14, rsi
	je	.L1
.L5:
	mov	rdi, r14
	mov	QWORD PTR 32[rsp], rbx
	call	min@PLT
	mov	rdx, r13
	mov	esi, r12d
	mov	rdi, rbp
	mov	DWORD PTR 16[rsp], eax
	cdqe
	lea	rax, [rbx+rax*4]
	mov	QWORD PTR 24[rsp], rax
	call	mtd_read_oob@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L3
	mov	edi, eax
	call	mtd_is_bitflip_or_eccerr@PLT
	test	eax, eax
	je	.L8
	mov	edi, r15d
	call	mtd_is_eccerr@PLT
	mov	edx, DWORD PTR 12[rsp]
	test	edx, edx
	je	.L9
	test	rax, rax
	je	.L3
.L9:
	mov	DWORD PTR 12[rsp], r15d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	mov	DWORD PTR 12[rsp], r15d
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	mov	eax, DWORD PTR 12[rsp]
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L7:
	.cfi_restore_state
	mov	DWORD PTR 12[rsp], 0
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	scan_read_oob, .-scan_read_oob
	.comm	MTD_OPS_PLACE_OOB,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_nand_bbt.c_scan_read_oob.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	scan_read_oob, %function
scan_read_oob:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r8, r3
	ldr	r3, .L17
	sub	sp, sp, #36
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	mov	r4, r1
	bl	nand_to_mtd
	mov	r7, #0
	ldr	r3, .L17+4
	ldr	r2, [r0, #4]
	ldr	r3, [r3]
	cmp	r8, r7
	str	r2, [sp, #16]
	str	r3, [sp, #24]
	str	r7, [sp, #20]
	beq	.L6
	mov	r5, r0
	ldr	r1, [r0]
	b	.L4
.L3:
	ldm	r5, {r1, r3}
	add	r3, r1, r3
	subs	r8, r8, r1
	add	r6, r6, r1
	add	r4, r4, r3, lsl #2
	beq	.L1
.L4:
	mov	r0, r8
	str	r4, [sp, #12]
	bl	min
	mov	ip, r0
	add	r3, r4, r0, lsl #2
	mov	r1, r6
	mov	r0, r5
	add	r2, sp, #4
	str	ip, [sp, #4]
	str	r3, [sp, #8]
	bl	mtd_read_oob
	subs	r9, r0, #0
	beq	.L3
	bl	mtd_is_bitflip_or_eccerr
	cmp	r0, #0
	beq	.L7
	mov	r0, r9
	bl	mtd_is_eccerr
	subs	r0, r0, #0
	movne	r0, #1
	cmp	r7, #0
	moveq	r0, #1
	cmp	r0, #0
	movne	r7, r9
	b	.L3
.L7:
	mov	r7, r9
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	mov	r0, r7
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L6:
	mov	r7, r8
	b	.L1
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	MTD_OPS_PLACE_OOB
	.size	scan_read_oob, .-scan_read_oob
	.comm	MTD_OPS_PLACE_OOB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
