	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtd_erase                      ## -- Begin function mtd_erase
	.p2align	4, 0x90
_mtd_erase:                             ## @mtd_erase
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_MTD_FAIL_ADDR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rsi)
	cmpl	$0, 20(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.4:
	movq	%rsi, %r14
	movq	8(%rbx), %rcx
	subq	(%rsi), %rcx
	jle	LBB0_6
## %bb.5:
	movq	8(%r14), %rax
	cmpq	%rcx, %rax
	jle	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_MTD_WRITEABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 16(%rbx)
	je	LBB0_8
## %bb.9:
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	xorl	%eax, %eax
	callq	_ledtrig_mtd_activity
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_8:
	movq	_EROFS@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_FAIL_ADDR_UNKNOWN,4,2      ## @MTD_FAIL_ADDR_UNKNOWN
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MTD_WRITEABLE,4,2              ## @MTD_WRITEABLE
	.comm	_EROFS,4,2                      ## @EROFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtd_erase                      ; -- Begin function mtd_erase
	.p2align	2
_mtd_erase:                             ; @mtd_erase
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _MTD_FAIL_ADDR_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_FAIL_ADDR_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #16]
	ldr	w8, [x0, #20]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.2:
	mov	x19, x1
	ldr	x8, [x1]
	ldr	x9, [x20, #8]
	subs	x9, x9, x8
	b.le	LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
	cmp	x8, x9
	b.le	LBB0_8
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	w9, [x20, #16]
Lloh7:
	adrp	x10, _MTD_WRITEABLE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _MTD_WRITEABLE@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_11
; %bb.9:
	cbz	x8, LBB0_12
; %bb.10:
	bl	_ledtrig_mtd_activity
	ldr	x2, [x20]
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x2
LBB0_11:
Lloh10:
	adrp	x8, _EROFS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
	b	LBB0_6
LBB0_12:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_FAIL_ADDR_UNKNOWN,4,2      ; @MTD_FAIL_ADDR_UNKNOWN
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MTD_WRITEABLE,4,2              ; @MTD_WRITEABLE
	.comm	_EROFS,4,2                      ; @EROFS
.subsections_via_symbols
