	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_write_seek
_doc_write_seek:                        ## @doc_write_seek
	.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	%r8d, %r14d
	movl	%ecx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	callq	_doc_dbg
	movq	%rbx, %rdi
	callq	_doc_set_reliable_mode
	movq	_DOC_LAYOUT_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	cmpl	%r14d, %eax
	movq	_DOC_SEQ_SET_PLANE2@GOTPCREL(%rip), %rax
	cmovgq	_DOC_SEQ_SET_PLANE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DOC_CMD_READ_PLANE2@GOTPCREL(%rip), %r12
	cmovgq	_DOC_CMD_READ_PLANE1@GOTPCREL(%rip), %r12
	movq	%rbx, %rdi
	callq	_doc_flash_sequence
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_doc_delay
	movq	_DOC_SEQ_PAGE_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_sequence
	movq	_DOC_CMD_PROG_CYCLE1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r13d
	movq	_DOC_ADDR_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	%r15d, %esi
	addl	%r13d, %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_doc_setup_writeaddr_sector
	movq	_DOC_CMD_PROG_CYCLE3@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	_doc_wait_ready
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_doc_flash_command
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	shll	%cl, %eax
	movq	_DOC_ADDR_PAGE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r15d
	addl	%eax, %r15d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_doc_setup_writeaddr_sector
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_doc_delay
LBB0_2:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doc_write_seek(blocks=(%d,%d), page=%d, ofs=%d)\n"

	.comm	_DOC_LAYOUT_PAGE_SIZE,4,2       ## @DOC_LAYOUT_PAGE_SIZE
	.comm	_DOC_SEQ_SET_PLANE1,4,2         ## @DOC_SEQ_SET_PLANE1
	.comm	_DOC_CMD_READ_PLANE1,4,2        ## @DOC_CMD_READ_PLANE1
	.comm	_DOC_SEQ_SET_PLANE2,4,2         ## @DOC_SEQ_SET_PLANE2
	.comm	_DOC_CMD_READ_PLANE2,4,2        ## @DOC_CMD_READ_PLANE2
	.comm	_DOC_SEQ_PAGE_SETUP,4,2         ## @DOC_SEQ_PAGE_SETUP
	.comm	_DOC_CMD_PROG_CYCLE1,4,2        ## @DOC_CMD_PROG_CYCLE1
	.comm	_DOC_ADDR_BLOCK_SHIFT,4,2       ## @DOC_ADDR_BLOCK_SHIFT
	.comm	_DOC_ADDR_PAGE_MASK,4,2         ## @DOC_ADDR_PAGE_MASK
	.comm	_DOC_CMD_PROG_CYCLE3,4,2        ## @DOC_CMD_PROG_CYCLE3
	.no_dead_strip	_doc_write_seek
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_write_seek
_doc_write_seek:                        ; @doc_write_seek
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_doc_dbg
	mov	x0, x19
	bl	_doc_set_reliable_mode
Lloh2:
	adrp	x8, _DOC_LAYOUT_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DOC_LAYOUT_PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _DOC_SEQ_SET_PLANE1@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DOC_SEQ_SET_PLANE1@GOTPAGEOFF]
	lsl	w8, w8, #1
Lloh7:
	adrp	x10, _DOC_SEQ_SET_PLANE2@GOTPAGE
Lloh8:
	ldr	x10, [x10, _DOC_SEQ_SET_PLANE2@GOTPAGEOFF]
	cmp	w8, w20
	csel	x8, x9, x10, gt
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _DOC_CMD_READ_PLANE1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DOC_CMD_READ_PLANE1@GOTPAGEOFF]
Lloh11:
	adrp	x9, _DOC_CMD_READ_PLANE2@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DOC_CMD_READ_PLANE2@GOTPAGEOFF]
	csel	x24, x8, x9, gt
	mov	x0, x19
	bl	_doc_flash_sequence
	ldr	w1, [x24]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	w1, #2
	bl	_doc_delay
Lloh13:
	adrp	x8, _DOC_SEQ_PAGE_SETUP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DOC_SEQ_PAGE_SETUP@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_doc_flash_sequence
Lloh16:
	adrp	x24, _DOC_CMD_PROG_CYCLE1@GOTPAGE
Lloh17:
	ldr	x24, [x24, _DOC_CMD_PROG_CYCLE1@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_doc_flash_command
Lloh18:
	adrp	x25, _DOC_ADDR_BLOCK_SHIFT@GOTPAGE
Lloh19:
	ldr	x25, [x25, _DOC_ADDR_BLOCK_SHIFT@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	w8, w23, w8
Lloh20:
	adrp	x26, _DOC_ADDR_PAGE_MASK@GOTPAGE
Lloh21:
	ldr	x26, [x26, _DOC_ADDR_PAGE_MASK@GOTPAGEOFF]
	ldr	w9, [x26]
	and	w9, w9, w21
	add	w1, w9, w8
	mov	x0, x19
	mov	x2, x20
	bl	_doc_setup_writeaddr_sector
Lloh22:
	adrp	x8, _DOC_CMD_PROG_CYCLE3@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DOC_CMD_PROG_CYCLE3@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	w1, #2
	bl	_doc_delay
	mov	x0, x19
	bl	_doc_wait_ready
	mov	x23, x0
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_doc_flash_command
	ldr	w8, [x25]
	lsl	w8, w22, w8
	ldr	w9, [x26]
	and	w9, w9, w21
	add	w1, w9, w8
	mov	x0, x19
	mov	x2, x20
	bl	_doc_setup_writeaddr_sector
	mov	x0, x19
	mov	w1, #1
	bl	_doc_delay
LBB0_2:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doc_write_seek(blocks=(%d,%d), page=%d, ofs=%d)\n"

	.comm	_DOC_LAYOUT_PAGE_SIZE,4,2       ; @DOC_LAYOUT_PAGE_SIZE
	.comm	_DOC_SEQ_SET_PLANE1,4,2         ; @DOC_SEQ_SET_PLANE1
	.comm	_DOC_CMD_READ_PLANE1,4,2        ; @DOC_CMD_READ_PLANE1
	.comm	_DOC_SEQ_SET_PLANE2,4,2         ; @DOC_SEQ_SET_PLANE2
	.comm	_DOC_CMD_READ_PLANE2,4,2        ; @DOC_CMD_READ_PLANE2
	.comm	_DOC_SEQ_PAGE_SETUP,4,2         ; @DOC_SEQ_PAGE_SETUP
	.comm	_DOC_CMD_PROG_CYCLE1,4,2        ; @DOC_CMD_PROG_CYCLE1
	.comm	_DOC_ADDR_BLOCK_SHIFT,4,2       ; @DOC_ADDR_BLOCK_SHIFT
	.comm	_DOC_ADDR_PAGE_MASK,4,2         ; @DOC_ADDR_PAGE_MASK
	.comm	_DOC_CMD_PROG_CYCLE3,4,2        ; @DOC_CMD_PROG_CYCLE3
	.no_dead_strip	_doc_write_seek
.subsections_via_symbols
