	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_erase
_doc_erase:                             ## @doc_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	16(%rdi), %r12
	movl	$0, -44(%rbp)
	movq	(%rsi), %rsi
	movq	8(%r15), %rdx
	leaq	L_.str(%rip), %rdi
	callq	_doc_dbg
	movq	8(%r15), %rdi
	addq	(%r15), %rdi
	movl	12(%r12), %r9d
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	callq	_calc_block_sector
	movq	(%r15), %rdi
	movq	8(%r15), %rax
	addq	%rdi, %rax
	cmpq	(%r14), %rax
	jg	LBB0_3
## %bb.1:
	cmpl	$0, -48(%rbp)
	jne	LBB0_3
## %bb.2:
	cmpl	$0, -44(%rbp)
	jne	LBB0_3
## %bb.4:
	movl	12(%r12), %r9d
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	callq	_calc_block_sector
	movq	(%r12), %rdi
	callq	_mutex_lock
	movl	8(%r12), %esi
	movq	%r12, %rdi
	callq	_doc_set_device_id
	movq	%r12, %rdi
	callq	_doc_set_reliable_mode
	movq	8(%r15), %rbx
	testq	%rbx, %rbx
	jle	LBB0_5
## %bb.6:
	movl	-40(%rbp), %esi
	movl	-36(%rbp), %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_doc_erase_block
	movl	%eax, %r15d
	movl	-40(%rbp), %esi
	addl	$2, %esi
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %edx
	addl	$2, %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	subq	8(%r14), %rbx
	testq	%rbx, %rbx
	jg	LBB0_7
	jmp	LBB0_9
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_5:
	xorl	%r15d, %r15d
LBB0_9:
	movq	(%r12), %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doc_erase(from=%lld, len=%lld\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_doc_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_erase
_doc_erase:                             ; @doc_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
	mov	x21, x1
	mov	x20, x0
	ldr	x19, [x0, #16]
	str	wzr, [sp]
	ldr	x1, [x1]
	ldr	x2, [x21, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_doc_dbg
	ldp	x8, x9, [x21]
	add	x0, x9, x8
	ldr	w5, [x19, #12]
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x4, sp
	bl	_calc_block_sector
	ldp	x0, x8, [x21]
	ldr	x9, [x20]
	ldp	w11, w10, [sp]
	add	x8, x8, x0
	cmp	x8, x9
	ccmp	w10, #0, #0, le
	ccmp	w11, #0, #0, eq
	b.eq	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_2:
	ldr	w5, [x19, #12]
	add	x1, sp, #12
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x4, sp
	bl	_calc_block_sector
	ldr	x0, [x19]
	bl	_mutex_lock
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_doc_set_device_id
	mov	x0, x19
	bl	_doc_set_reliable_mode
	ldr	x22, [x21, #8]
	cmp	x22, #1
	b.lt	LBB0_6
; %bb.3:
	ldp	w2, w1, [sp, #8]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_doc_erase_block
	mov	x21, x0
	ldr	w8, [sp, #12]
	add	w1, w8, #2
	ldr	w8, [sp, #8]
	add	w2, w8, #2
	stp	w2, w1, [sp, #8]
	cbnz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	sub	x22, x22, x8
	cmp	x22, #0
	b.gt	LBB0_4
	b	LBB0_7
LBB0_6:
	mov	w21, #0
LBB0_7:
	ldr	x0, [x19]
	bl	_mutex_unlock
LBB0_8:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doc_erase(from=%lld, len=%lld\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_doc_erase
.subsections_via_symbols
