	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_read_seek
_doc_read_seek:                         ## @doc_read_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	%r9d, %r13d
	movl	%r8d, %r15d
	movl	%ecx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%r9d, %r8d
	movl	%r15d, %r9d
	callq	_doc_dbg
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	movq	_DOC_SEQ_SET_PLANE2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_doc_flash_sequence
	movq	_DOC_CMD_READ_PLANE2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_doc_flash_command
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_doc_delay
	movq	%r12, %rdi
	callq	_doc_set_reliable_mode
	movq	%r12, %rdi
	callq	_doc_set_extra_page_mode
	testl	%eax, %eax
	jne	LBB0_4
	jmp	LBB0_3
LBB0_1:
	movq	_DOC_LAYOUT_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	cmpl	%r13d, %eax
	movq	_DOC_SEQ_SET_PLANE2@GOTPCREL(%rip), %rax
	cmovgq	_DOC_SEQ_SET_PLANE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %r15d
	movq	_DOC_CMD_READ_PLANE2@GOTPCREL(%rip), %rbx
	cmovgq	_DOC_CMD_READ_PLANE1@GOTPCREL(%rip), %rbx
	movq	%r12, %rdi
	callq	_doc_flash_sequence
	movl	(%rbx), %esi
	movl	%r15d, %ebx
	movq	%r12, %rdi
	callq	_doc_flash_command
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_doc_delay
	movq	%r12, %rdi
	callq	_doc_set_reliable_mode
LBB0_3:
	movq	_DOC_SEQ_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_doc_flash_sequence
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_DOC_ADDR_PAGE_MASK@GOTPCREL(%rip), %r13
	movl	%ebx, %eax
	movl	(%r13), %ebx
	andl	%r14d, %ebx
	addl	%eax, %ebx
	movq	_DOC_CMD_PROG_BLOCK_ADDR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_doc_flash_command
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_doc_setup_addr_sector
	movq	_DOC_ADDR_BLOCK_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	shll	%cl, %eax
	andl	(%r13), %r14d
	addl	%eax, %r14d
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_doc_flash_command
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_doc_setup_addr_sector
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_doc_delay
	xorl	%eax, %eax
LBB0_4:
	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_seek(blocks=(%d,%d), page=%d, ofs=%d, wear=%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_READ,4,2               ## @DOC_SEQ_READ
	.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_BLOCK_ADDR,4,2    ## @DOC_CMD_PROG_BLOCK_ADDR
	.no_dead_strip	_doc_read_seek
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_read_seek
_doc_read_seek:                         ; @doc_read_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	x23, x5
	mov	x24, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x4, x5
	mov	x5, x24
	bl	_doc_dbg
	cbz	w24, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _DOC_SEQ_SET_PLANE2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DOC_SEQ_SET_PLANE2@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_doc_flash_sequence
Lloh5:
	adrp	x8, _DOC_CMD_READ_PLANE2@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DOC_CMD_READ_PLANE2@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	w1, #2
	bl	_doc_delay
	mov	x0, x19
	bl	_doc_set_reliable_mode
	mov	x0, x19
	bl	_doc_set_extra_page_mode
	cbnz	w0, LBB0_4
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x8, _DOC_LAYOUT_PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DOC_LAYOUT_PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _DOC_SEQ_SET_PLANE1@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DOC_SEQ_SET_PLANE1@GOTPAGEOFF]
	lsl	w8, w8, #1
Lloh13:
	adrp	x10, _DOC_SEQ_SET_PLANE2@GOTPAGE
Lloh14:
	ldr	x10, [x10, _DOC_SEQ_SET_PLANE2@GOTPAGEOFF]
	cmp	w8, w23
	csel	x8, x9, x10, gt
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _DOC_CMD_READ_PLANE1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DOC_CMD_READ_PLANE1@GOTPAGEOFF]
Lloh17:
	adrp	x9, _DOC_CMD_READ_PLANE2@GOTPAGE
Lloh18:
	ldr	x9, [x9, _DOC_CMD_READ_PLANE2@GOTPAGEOFF]
	csel	x23, x8, x9, gt
	mov	x0, x19
	bl	_doc_flash_sequence
	ldr	w1, [x23]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	w1, #2
	bl	_doc_delay
	mov	x0, x19
	bl	_doc_set_reliable_mode
LBB0_3:
Lloh19:
	adrp	x8, _DOC_SEQ_READ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DOC_SEQ_READ@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_doc_flash_sequence
Lloh22:
	adrp	x23, _DOC_ADDR_BLOCK_SHIFT@GOTPAGE
Lloh23:
	ldr	x23, [x23, _DOC_ADDR_BLOCK_SHIFT@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w8, w22, w8
Lloh24:
	adrp	x24, _DOC_ADDR_PAGE_MASK@GOTPAGE
Lloh25:
	ldr	x24, [x24, _DOC_ADDR_PAGE_MASK@GOTPAGEOFF]
	ldr	w9, [x24]
	and	w9, w9, w20
	add	w22, w9, w8
Lloh26:
	adrp	x25, _DOC_CMD_PROG_BLOCK_ADDR@GOTPAGE
Lloh27:
	ldr	x25, [x25, _DOC_CMD_PROG_BLOCK_ADDR@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	x1, x22
	bl	_doc_setup_addr_sector
	ldr	w8, [x23]
	lsl	w8, w21, w8
	ldr	w9, [x24]
	and	w9, w9, w20
	add	w20, w9, w8
	ldr	w1, [x25]
	mov	x0, x19
	bl	_doc_flash_command
	mov	x0, x19
	mov	x1, x20
	bl	_doc_setup_addr_sector
	mov	x0, x19
	mov	w1, #1
	bl	_doc_delay
	mov	w0, #0
LBB0_4:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doc_seek(blocks=(%d,%d), page=%d, ofs=%d, wear=%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_READ,4,2               ; @DOC_SEQ_READ
	.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_BLOCK_ADDR,4,2    ; @DOC_CMD_PROG_BLOCK_ADDR
	.no_dead_strip	_doc_read_seek
.subsections_via_symbols
