	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function erasetest
_erasetest:                             ## @erasetest
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_info
	movq	_ebcnt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	_bbt@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_mtd@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rbx,8)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	addq	(%rdx), %r14
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_3
## %bb.5:
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_1:
	xorl	%r14d, %r14d
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	movq	_mtd@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movl	%ebx, %esi
	callq	_mtdtest_erase_eraseblock
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	movq	_writebuf@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_pgsize@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_rnd_state@GOTPCREL(%rip), %rdi
	callq	_prandom_bytes_state
	movq	(%r13), %rdi
	movl	(%r12), %edx
	movl	(%r15), %ecx
	movq	%r14, %rsi
	callq	_mtdtest_write
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	movq	(%r13), %rdi
	movl	%ebx, %esi
	callq	_mtdtest_erase_eraseblock
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	movq	(%r13), %rdi
	movl	(%r12), %edx
	movq	_twopages@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	%r14, %rsi
	callq	_mtdtest_read
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.10:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_info
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.11:
	movq	(%r13), %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$255, (%rcx,%rsi,4)
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_12
LBB0_15:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_16
LBB0_13:
	leaq	L_.str.5(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_pr_err
	movq	_errcnt@GOTPCREL(%rip), %rax
	incl	(%rax)
	xorl	%r15d, %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"erasetest\n"

	.comm	_ebcnt,4,2                      ## @ebcnt
	.comm	_bbt,8,3                        ## @bbt
	.comm	_mtd,8,3                        ## @mtd
L_.str.1:                               ## @.str.1
	.asciz	"erasing block %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"writing 1st page of block %d\n"

	.comm	_rnd_state,4,2                  ## @rnd_state
	.comm	_writebuf,4,2                   ## @writebuf
	.comm	_pgsize,4,2                     ## @pgsize
L_.str.3:                               ## @.str.3
	.asciz	"reading 1st page of block %d\n"

	.comm	_twopages,8,3                   ## @twopages
L_.str.4:                               ## @.str.4
	.asciz	"verifying 1st page of block %d is all 0xff\n"

L_.str.5:                               ## @.str.5
	.asciz	"verifying all 0xff failed at %d\n"

	.comm	_errcnt,4,2                     ## @errcnt
L_.str.6:                               ## @.str.6
	.asciz	"erasetest ok\n"

	.no_dead_strip	_erasetest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function erasetest
_erasetest:                             ; @erasetest
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
Lloh2:
	adrp	x8, _ebcnt@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ebcnt@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
Lloh5:
	adrp	x21, _mtd@GOTPAGE
Lloh6:
	ldr	x21, [x21, _mtd@GOTPAGEOFF]
	cmp	w20, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x8, #0
	mov	x19, #0
Lloh7:
	adrp	x9, _bbt@GOTPAGE
Lloh8:
	ldr	x9, [x9, _bbt@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	ldr	x10, [x21]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9, x8, lsl #3]
	cbz	x11, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x11, [x10]
	add	x19, x11, x19
	add	x8, x8, #1
	cmp	x20, x8
	b.ne	LBB0_2
; %bb.4:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_7
LBB0_5:
	mov	w20, #0
	mov	x19, #0
	b	LBB0_7
LBB0_6:
	mov	x20, x8
LBB0_7:
	str	x20, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	ldr	x0, [x21]
	mov	x1, x20
	bl	_mtdtest_erase_eraseblock
	cbnz	w0, LBB0_17
; %bb.8:
	mov	x8, x20
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_info
Lloh14:
	adrp	x23, _writebuf@GOTPAGE
Lloh15:
	ldr	x23, [x23, _writebuf@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh16:
	adrp	x22, _pgsize@GOTPAGE
Lloh17:
	ldr	x22, [x22, _pgsize@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh18:
	adrp	x0, _rnd_state@GOTPAGE
Lloh19:
	ldr	x0, [x0, _rnd_state@GOTPAGEOFF]
	bl	_prandom_bytes_state
	ldr	x0, [x21]
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	x1, x19
	bl	_mtdtest_write
	cbnz	w0, LBB0_17
; %bb.9:
	mov	x8, x20
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	ldr	x0, [x21]
	mov	x1, x20
	bl	_mtdtest_erase_eraseblock
	cbnz	w0, LBB0_17
; %bb.10:
	mov	x8, x20
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
	ldr	x0, [x21]
	ldr	w2, [x22]
Lloh24:
	adrp	x21, _twopages@GOTPAGE
Lloh25:
	ldr	x21, [x21, _twopages@GOTPAGEOFF]
	ldr	x3, [x21]
	mov	x1, x19
	bl	_mtdtest_read
	cbnz	w0, LBB0_17
; %bb.11:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.12:
	mov	x1, #0
	ldr	x9, [x21]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9, x1, lsl #2]
	cmp	w10, #255
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x1, x1, #1
	cmp	x8, x1
	b.ne	LBB0_13
LBB0_15:
Lloh28:
	adrp	x0, l_.str.6@PAGE
Lloh29:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_info
	mov	w0, #0
	b	LBB0_17
LBB0_16:
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pr_err
	mov	w0, #0
Lloh32:
	adrp	x8, _errcnt@GOTPAGE
Lloh33:
	ldr	x8, [x8, _errcnt@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"erasetest\n"

	.comm	_ebcnt,4,2                      ; @ebcnt
	.comm	_bbt,8,3                        ; @bbt
	.comm	_mtd,8,3                        ; @mtd
l_.str.1:                               ; @.str.1
	.asciz	"erasing block %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"writing 1st page of block %d\n"

	.comm	_rnd_state,4,2                  ; @rnd_state
	.comm	_writebuf,4,2                   ; @writebuf
	.comm	_pgsize,4,2                     ; @pgsize
l_.str.3:                               ; @.str.3
	.asciz	"reading 1st page of block %d\n"

	.comm	_twopages,8,3                   ; @twopages
l_.str.4:                               ; @.str.4
	.asciz	"verifying 1st page of block %d is all 0xff\n"

l_.str.5:                               ; @.str.5
	.asciz	"verifying all 0xff failed at %d\n"

	.comm	_errcnt,4,2                     ; @errcnt
l_.str.6:                               ; @.str.6
	.asciz	"erasetest ok\n"

	.no_dead_strip	_erasetest
.subsections_via_symbols
