	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opalflash_erase
_opalflash_erase:                       ## @opalflash_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	%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
	movl	%edx, %r12d
	movq	8(%rdi), %rax
	movl	(%rax), %ecx
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_6
## %bb.1:
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_6
## %bb.2:
	movl	%esi, %r13d
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_opal_alloc_async_token
	movl	%eax, %r14d
	movq	_OPAL_FLASH_ERASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	callq	_opal_call
	movl	%eax, %ebx
	movq	_OPAL_ASYNC_COMPLETION@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_5
## %bb.3:
	leaq	-48(%rbp), %rdi
	movl	$8, %esi
	movl	%r14d, %edx
	callq	_opal_wait_completion
	movl	%eax, %ebx
	movq	_OPAL_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rax
	movl	4(%rax), %ebx
LBB0_5:
	movl	%r14d, %edi
	callq	_opal_free_async_token
	movq	_OPAL_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_OPAL_FLASH_ERASE,4,2           ## @OPAL_FLASH_ERASE
	.comm	_OPAL_ASYNC_COMPLETION,4,2      ## @OPAL_ASYNC_COMPLETION
	.comm	_OPAL_SUCCESS,4,2               ## @OPAL_SUCCESS
	.no_dead_strip	_opalflash_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opalflash_erase
_opalflash_erase:                       ; @opalflash_erase
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	sdiv	w9, w1, w8
	msub	w9, w9, w8, w1
	cbnz	w9, LBB0_2
; %bb.1:
	mov	x20, x2
	sdiv	w9, w2, w8
	msub	w8, w9, w8, w2
	cbz	w8, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	mov	x21, x1
	mov	x22, x0
	bl	_opal_alloc_async_token
	mov	x19, x0
Lloh3:
	adrp	x8, _OPAL_FLASH_ERASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OPAL_FLASH_ERASE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w1, [x22]
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	bl	_opal_call
	mov	x20, x0
Lloh6:
	adrp	x8, _OPAL_ASYNC_COMPLETION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OPAL_ASYNC_COMPLETION@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x21, _OPAL_SUCCESS@GOTPAGE
Lloh10:
	ldr	x21, [x21, _OPAL_SUCCESS@GOTPAGEOFF]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.5:
	add	x0, sp, #8
	mov	w1, #8
	mov	x2, x19
	bl	_opal_wait_completion
	mov	x20, x0
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.6:
	ldr	x8, [sp, #8]
	ldr	w20, [x8, #4]
LBB0_7:
	mov	x0, x19
	bl	_opal_free_async_token
	ldr	w8, [x21]
Lloh11:
	adrp	x9, _EIO@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w20, w8
	csel	w0, wzr, w9, eq
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_OPAL_FLASH_ERASE,4,2           ; @OPAL_FLASH_ERASE
	.comm	_OPAL_ASYNC_COMPLETION,4,2      ; @OPAL_ASYNC_COMPLETION
	.comm	_OPAL_SUCCESS,4,2               ; @OPAL_SUCCESS
	.no_dead_strip	_opalflash_erase
.subsections_via_symbols
