	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdswap_erase_block
_mtdswap_erase_block:                   ## @mtdswap_erase_block
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	movq	(%rsi), %rcx
	leaq	1(%rcx), %rax
	movq	%rax, (%rsi)
	cmpq	(%rdi), %rcx
	jl	LBB0_2
## %bb.1:
	movq	%rax, (%r15)
LBB0_2:
	leaq	-48(%rbp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	%r15, %rdi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_mtdswap_eb_offset
	movl	%eax, -48(%rbp)
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_mtd_erase
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	$-1, %r14d
	leaq	-48(%rbp), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	incl	%r14d
	movq	_MTDSWAP_ERASE_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jae	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r15), %edi
	movl	-48(%rbp), %edx
	movl	(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	xorl	%eax, %eax
	callq	_yield
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_mtdswap_eb_offset
	movl	%eax, -48(%rbp)
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_mtd_erase
	testl	%eax, %eax
	jne	LBB0_4
	jmp	LBB0_7
LBB0_6:
	movl	8(%r15), %edi
	movl	-48(%rbp), %edx
	movl	(%r12), %ecx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_mtdswap_handle_badblock
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTDSWAP_ERASE_RETRIES,4,2      ## @MTDSWAP_ERASE_RETRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"erase of erase block %#llx on %s failed"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot erase erase block %#llx on %s\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_mtdswap_erase_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdswap_erase_block
_mtdswap_erase_block:                   ; @mtdswap_erase_block
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0, #16]
	ldr	x9, [x1]
	add	x8, x9, #1
	str	x8, [x1]
	ldr	x10, [x0]
	cmp	x9, x10
	b.lt	LBB0_2
; %bb.1:
	str	x8, [x20]
LBB0_2:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	x0, x20
	mov	x1, x19
	bl	_mtdswap_eb_offset
	ldr	w8, [x21, #4]
	stp	w0, w8, [sp, #8]
	add	x1, sp, #8
	mov	x0, x21
	bl	_mtd_erase
	cbz	w0, LBB0_7
; %bb.3:
	mov	w23, #-1
Lloh0:
	adrp	x24, _MTDSWAP_ERASE_RETRIES@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MTDSWAP_ERASE_RETRIES@GOTPAGEOFF]
Lloh2:
	adrp	x22, l_.str@PAGE
Lloh3:
	add	x22, x22, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	add	w23, w23, #1
	cmp	w23, w8
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20, #8]
	ldr	w2, [sp, #8]
	ldr	w3, [x21]
	mov	x1, x22
	bl	_dev_warn
	bl	_yield
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	x0, x20
	mov	x1, x19
	bl	_mtdswap_eb_offset
	ldr	w8, [x21, #4]
	stp	w0, w8, [sp, #8]
	add	x1, sp, #8
	mov	x0, x21
	bl	_mtd_erase
	cbnz	w0, LBB0_4
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20, #8]
	ldr	w2, [sp, #8]
	ldr	w3, [x21]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	mov	x1, x19
	bl	_mtdswap_handle_badblock
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MTDSWAP_ERASE_RETRIES,4,2      ; @MTDSWAP_ERASE_RETRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"erase of erase block %#llx on %s failed"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot erase erase block %#llx on %s\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_mtdswap_erase_block
.subsections_via_symbols
