	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spinand_erase
_spinand_erase:                         ## @spinand_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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_nand_to_spinand
	movq	%rax, %rbx
	movl	(%r14), %esi
	movq	%rax, %rdi
	callq	_spinand_select_target
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	%rbx, %rdi
	callq	_spinand_write_enable_op
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_spinand_erase_op
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	leaq	-20(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_spinand_wait
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	_STATUS_ERASE_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -20(%rbp)
	je	LBB0_5
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_5:
	xorl	%eax, %eax
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_ERASE_FAILED,4,2        ## @STATUS_ERASE_FAILED
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_spinand_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spinand_erase
_spinand_erase:                         ; @spinand_erase
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	bl	_nand_to_spinand
	mov	x19, x0
	ldr	w1, [x20]
	bl	_spinand_select_target
	cbnz	w0, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_spinand_write_enable_op
	cbnz	w0, LBB0_7
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_spinand_erase_op
	cbnz	w0, LBB0_7
; %bb.3:
	add	x1, sp, #12
	mov	x0, x19
	bl	_spinand_wait
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	w8, [sp, #12]
Lloh0:
	adrp	x9, _STATUS_ERASE_FAILED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATUS_ERASE_FAILED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_ERASE_FAILED,4,2        ; @STATUS_ERASE_FAILED
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_spinand_erase
.subsections_via_symbols
