	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_erased_page
_check_erased_page:                     ## @check_erased_page
	.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	%rsi, %rbx
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	16(%r14), %r12
	movslq	(%r14), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movslq	4(%r14), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -48(%rbp)
	xorl	%r15d, %r15d
	leaq	-48(%rbp), %rdx
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_mtd_ooblayout_ecc
	cmpl	$0, 8(%r14)
	jle	LBB0_3
## %bb.1:
	movslq	-48(%rbp), %rax
	leaq	(%r12,%rax,4), %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%r14), %eax
	movl	%eax, (%rsp)
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r12, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_nand_check_erased_ecc_chunk
	movl	%eax, %ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	movl	%eax, %edx
	movl	$1, %esi
	cmovsl	%esi, %edx
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	addl	%edx, (%rsi,%rcx,4)
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_max
	movl	%eax, %r15d
	incl	%r13d
	addq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	cmpl	8(%r14), %r13d
	jl	LBB0_2
LBB0_3:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_check_erased_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_erased_page
_check_erased_page:                     ; @check_erased_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	bl	_nand_to_mtd
	mov	x21, x0
	ldr	x25, [x20, #16]
	ldpsw	x22, x23, [x20]
	str	wzr, [sp, #8]
	add	x2, sp, #8
	mov	w1, #0
	bl	_mtd_ooblayout_ecc
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w24, #0
	mov	w26, #0
	ldrsw	x8, [sp, #8]
	add	x25, x25, x8, lsl #2
	lsl	x27, x23, #2
	lsl	x28, x22, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w6, [x20, #12]
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	mov	x3, x22
	mov	x4, #0
	mov	w5, #0
	bl	_nand_check_erased_ecc_chunk
	lsr	w8, w0, #31
	lsl	x8, x8, #2
	cmp	w0, #0
	csinc	w9, w0, wzr, ge
	ldr	w10, [x21, x8]
	add	w9, w10, w9
	str	w9, [x21, x8]
	mov	x1, x24
	bl	_max
	mov	x24, x0
	add	w26, w26, #1
	ldr	w8, [x20, #8]
	add	x19, x19, x27
	add	x25, x25, x28
	cmp	w26, w8
	b.lt	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w24, #0
LBB0_4:
	mov	x0, x24
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_check_erased_page
.subsections_via_symbols
