	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_erase_block
_doc_erase_block:                       ## @doc_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_doc_dbg
	movq	%rbx, %rdi
	callq	_doc_reset_seq
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_doc_set_reliable_mode
	movq	_DOC_SEQ_ERASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_sequence
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r15d, %r12d
	shll	%cl, %r12d
	movq	_DOC_CMD_PROG_BLOCK_ADDR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_doc_setup_addr_sector
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r14d, %r12d
	shll	%cl, %r12d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_doc_setup_addr_sector
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_doc_delay
	movq	_DOC_CMD_ERASECYCLE2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_doc_delay
	movq	%rbx, %rdi
	callq	_is_prot_seq_error
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_doc_err
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_doc_write_erase_wait_status    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doc_erase_block(blocks=(%d,%d))\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_DOC_SEQ_ERASE,4,2              ## @DOC_SEQ_ERASE
	.comm	_DOC_ADDR_BLOCK_SHIFT,4,2       ## @DOC_ADDR_BLOCK_SHIFT
	.comm	_DOC_CMD_PROG_BLOCK_ADDR,4,2    ## @DOC_CMD_PROG_BLOCK_ADDR
	.comm	_DOC_CMD_ERASECYCLE2,4,2        ## @DOC_CMD_ERASECYCLE2
L_.str.1:                               ## @.str.1
	.asciz	"Erase blocks %d,%d error\n"

	.no_dead_strip	_doc_erase_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_erase_block
_doc_erase_block:                       ; @doc_erase_block
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_doc_dbg
	mov	x0, x21
	bl	_doc_reset_seq
	cbnz	w0, LBB0_3
; %bb.1:
	mov	x0, x21
	bl	_doc_set_reliable_mode
Lloh2:
	adrp	x8, _DOC_SEQ_ERASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DOC_SEQ_ERASE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_doc_flash_sequence
Lloh5:
	adrp	x23, _DOC_ADDR_BLOCK_SHIFT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _DOC_ADDR_BLOCK_SHIFT@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w22, w20, w8
Lloh7:
	adrp	x24, _DOC_CMD_PROG_BLOCK_ADDR@GOTPAGE
Lloh8:
	ldr	x24, [x24, _DOC_CMD_PROG_BLOCK_ADDR@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_doc_flash_command
	mov	x0, x21
	mov	x1, x22
	bl	_doc_setup_addr_sector
	ldr	w8, [x23]
	lsl	w22, w19, w8
	ldr	w1, [x24]
	mov	x0, x21
	bl	_doc_flash_command
	mov	x0, x21
	mov	x1, x22
	bl	_doc_setup_addr_sector
	mov	x0, x21
	mov	w1, #1
	bl	_doc_delay
Lloh9:
	adrp	x8, _DOC_CMD_ERASECYCLE2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DOC_CMD_ERASECYCLE2@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_doc_flash_command
	mov	x0, x21
	mov	w1, #2
	bl	_doc_delay
	mov	x0, x21
	bl	_is_prot_seq_error
	cbz	x0, LBB0_4
; %bb.2:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_doc_err
LBB0_3:
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_4:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_doc_write_erase_wait_status
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doc_erase_block(blocks=(%d,%d))\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_DOC_SEQ_ERASE,4,2              ; @DOC_SEQ_ERASE
	.comm	_DOC_ADDR_BLOCK_SHIFT,4,2       ; @DOC_ADDR_BLOCK_SHIFT
	.comm	_DOC_CMD_PROG_BLOCK_ADDR,4,2    ; @DOC_CMD_PROG_BLOCK_ADDR
	.comm	_DOC_CMD_ERASECYCLE2,4,2        ; @DOC_CMD_ERASECYCLE2
l_.str.1:                               ; @.str.1
	.asciz	"Erase blocks %d,%d error\n"

	.no_dead_strip	_doc_erase_block
.subsections_via_symbols
