	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scan_read_oob
_scan_read_oob:                         ## @scan_read_oob
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r13
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	$0, -64(%rbp)
	movq	8(%r13), %rax
	movq	%rax, -72(%rbp)
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	(%r13), %rsi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %r13
	movq	(%r12), %rsi
	movq	8(%r12), %rax
	addq	%rsi, %rax
	leaq	(%rbx,%rax,4), %rbx
	addl	%esi, %r14d
	subq	%rsi, %r15
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -80(%rbp)
	movq	%r15, %rdi
	callq	_min
	movl	%eax, -96(%rbp)
	cltq
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, -88(%rbp)
	movq	%r13, %r12
	movq	%r13, %rdi
	movl	%r14d, %esi
	leaq	-96(%rbp), %rdx
	callq	_mtd_read_oob
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_mtd_is_bitflip_or_eccerr
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r13d, %edi
	callq	_mtd_is_eccerr
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	cmovel	%r13d, %ecx
	testq	%rax, %rax
	cmovnel	%r13d, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_7
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_8
LBB0_5:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
LBB0_8:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.no_dead_strip	_scan_read_oob
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scan_read_oob
_scan_read_oob:                         ; @scan_read_oob
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	bl	_nand_to_mtd
Lloh0:
	adrp	x8, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	str	xzr, [sp, #32]
	ldr	x8, [x0, #8]
	str	x8, [sp, #24]
	cbz	x19, LBB0_6
; %bb.1:
	mov	x22, x0
	mov	w23, #0
	ldr	x1, [x0]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldp	x1, x8, [x22]
	add	x8, x1, x8
	add	x21, x21, x8, lsl #2
	add	w20, w20, w1
	subs	x19, x19, x1
	b.eq	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	x21, [sp, #16]
	mov	x0, x19
	bl	_min
	str	w0, [sp]
	add	x8, x21, w0, sxtw #2
	str	x8, [sp, #8]
	mov	x2, sp
	mov	x0, x22
	mov	x1, x20
	bl	_mtd_read_oob
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, x0
	bl	_mtd_is_bitflip_or_eccerr
	cbz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	bl	_mtd_is_eccerr
	cmp	w23, #0
	ccmp	x0, #0, #0, ne
	csel	w23, w23, w24, eq
	b	LBB0_2
LBB0_6:
	mov	w23, #0
	b	LBB0_8
LBB0_7:
	mov	x23, x24
LBB0_8:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.no_dead_strip	_scan_read_oob
.subsections_via_symbols
