	.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	%rax, -88(%rbp)                 ## 8-byte Spill
	cmpl	$0, 8(%r14)
	jle	LBB0_1
## %bb.3:
	movq	_BBM_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	shlq	$2, %rax
	addq	16(%r14), %rax
	movslq	(%r14), %rcx
	movslq	4(%r14), %rdx
	movq	_METADATA_SIZE@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %r9
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%r9,4), %r13
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,4), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rcx,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$1, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %r12d
	movl	$0, %eax
	cmovnel	%eax, %r9d
	movl	12(%r14), %eax
	movl	%eax, (%rsp)
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r13, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-80(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	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
	cmpl	8(%r14), %r12d
	jge	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_METADATA_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	addq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	incl	%r12d
	jmp	LBB0_4
LBB0_1:
	xorl	%r15d, %r15d
LBB0_2:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BBM_SIZE,4,2                   ## @BBM_SIZE
	.comm	_METADATA_SIZE,4,2              ## @METADATA_SIZE
	.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
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x21, x0
	mov	w22, #0
Lloh0:
	adrp	x8, _BBM_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BBM_SIZE@GOTPAGEOFF]
	ldr	x9, [x20, #16]
Lloh2:
	ldrsw	x8, [x8]
	add	x9, x9, x8, lsl #2
Lloh3:
	adrp	x8, _METADATA_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _METADATA_SIZE@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	mov	x28, x9
	add	x24, x9, x8, lsl #2
	ldpsw	x25, x26, [x20]
	lsl	x9, x26, #2
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	lsl	x27, x25, #2
	mov	w23, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, #1
	csel	w5, w8, wzr, eq
	ldr	w6, [x20, #12]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x24
	mov	x3, x25
	mov	x4, x28
	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, x22
	bl	_max
	mov	x22, x0
	ldr	w8, [x20, #8]
	cmp	w23, w8
	b.ge	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh6:
	adrp	x8, _METADATA_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _METADATA_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	add	x19, x19, x9
	add	x24, x24, x27
	add	w23, w23, #1
	b	LBB0_2
LBB0_4:
	mov	w22, #0
LBB0_5:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BBM_SIZE,4,2                   ; @BBM_SIZE
	.comm	_METADATA_SIZE,4,2              ; @METADATA_SIZE
	.no_dead_strip	_check_erased_page
.subsections_via_symbols
