	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atapi_read
_atapi_read:                            ## @atapi_read
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_AHCI_CL_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %r13
	leaq	528(%rdx), %rdi
	callq	_be32dec
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	512(%rbx), %rax
	movq	_READ_10@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	jne	LBB0_2
## %bb.1:
	leaq	568(%rbx), %rdi
	callq	_be16dec
	testl	%eax, %eax
	jne	LBB0_5
	jmp	LBB0_4
LBB0_2:
	leaq	560(%rbx), %rdi
	callq	_be32dec
	testl	%eax, %eax
	jne	LBB0_5
LBB0_4:
	movq	32(%rbx), %rdx
	andq	$-8, %rdx
	movl	%eax, %r15d
	movq	_ATA_I_CMD@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rdx
	movq	_ATA_I_IN@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rdx
	movq	%rdx, 32(%rbx)
	movq	_ATA_S_READY@GOTPCREL(%rip), %rax
	movq	_ATA_S_DSC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	_ahci_write_fis_d2h
	movl	%r15d, %eax
LBB0_5:
	leaq	1024(%rbx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movslq	%r12d, %rcx
	imulq	%rcx, %r13
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	shll	$11, %r15d
	shll	$11, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	leaq	12(%r14), %r12
	movq	%r12, %rdi
	callq	_STAILQ_FIRST
	movq	%r14, %r13
	movq	%rax, %r14
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	_io_flist@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_STAILQ_REMOVE_HEAD
	movq	%rbx, (%r14)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, 8(%r14)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 12(%r14)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 16(%r14)
	leaq	20(%r14), %r12
	addl	%eax, %r15d
	movl	%r15d, 20(%r14)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_ahci_build_iov
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, (%r13)
	leaq	8(%r13), %rdi
	movq	_io_blist@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_TAILQ_INSERT_HEAD
	movl	4(%r13), %edi
	movq	%r12, %rsi
	callq	_blockif_read
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_assert                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AHCI_CL_SIZE,4,2               ## @AHCI_CL_SIZE
	.comm	_READ_10,8,3                    ## @READ_10
	.comm	_ATA_I_CMD,8,3                  ## @ATA_I_CMD
	.comm	_ATA_I_IN,8,3                   ## @ATA_I_IN
	.comm	_ATA_S_READY,4,2                ## @ATA_S_READY
	.comm	_ATA_S_DSC,4,2                  ## @ATA_S_DSC
	.comm	_io_flist,4,2                   ## @io_flist
	.comm	_io_blist,4,2                   ## @io_blist
	.no_dead_strip	_atapi_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atapi_read
_atapi_read:                            ; @atapi_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #16]
Lloh0:
	adrp	x8, _AHCI_CL_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AHCI_CL_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x26, [x8]
	add	x0, x2, #528
	bl	_be32dec
	ldr	x8, [x22, #512]
Lloh3:
	adrp	x9, _READ_10@GOTPAGE
Lloh4:
	ldr	x9, [x9, _READ_10@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	b.ne	LBB0_2
; %bb.1:
	add	x0, x22, #568
	bl	_be16dec
	mov	x24, x0
	cbnz	w0, LBB0_4
	b	LBB0_3
LBB0_2:
	add	x0, x22, #560
	bl	_be32dec
	mov	x24, x0
	cbnz	w0, LBB0_4
LBB0_3:
	ldr	x8, [x22, #32]
	and	x8, x8, #0xfffffffffffffff8
Lloh6:
	adrp	x9, _ATA_I_CMD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATA_I_CMD@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	orr	x8, x8, x9
Lloh9:
	adrp	x9, _ATA_I_IN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATA_I_IN@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	orr	x8, x8, x9
Lloh12:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
	str	x8, [x22, #32]
Lloh14:
	ldr	w8, [x9]
Lloh15:
	adrp	x9, _ATA_S_DSC@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATA_S_DSC@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_ahci_write_fis_d2h
LBB0_4:
	add	x25, x22, #1024
	sxtw	x8, w20
	mul	x28, x26, x8
	lsl	w27, w24, #11
	add	x24, x19, #12
	mov	x0, x24
	bl	_STAILQ_FIRST
	mov	x26, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
Lloh18:
	adrp	x8, _io_flist@GOTPAGE
Lloh19:
	ldr	x8, [x8, _io_flist@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_STAILQ_REMOVE_HEAD
	str	x22, [x26]
	stp	w20, w27, [x26, #8]
	str	w21, [x26, #16]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w21, w8, lsl #11
	mov	x21, x26
	str	w8, [x21, #20]!
	ldr	w3, [x23, x28]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x25
	bl	_ahci_build_iov
	mov	w8, #1
	lsl	w8, w8, w20
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	add	x0, x19, #8
Lloh21:
	adrp	x8, _io_blist@GOTPAGE
Lloh22:
	ldr	x8, [x8, _io_blist@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x1, x26
	bl	_TAILQ_INSERT_HEAD
	ldr	w0, [x19, #4]
	mov	x1, x21
	bl	_blockif_read
	cmp	w0, #0
	cset	w0, eq
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_assert
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AHCI_CL_SIZE,4,2               ; @AHCI_CL_SIZE
	.comm	_READ_10,8,3                    ; @READ_10
	.comm	_ATA_I_CMD,8,3                  ; @ATA_I_CMD
	.comm	_ATA_I_IN,8,3                   ; @ATA_I_IN
	.comm	_ATA_S_READY,4,2                ; @ATA_S_READY
	.comm	_ATA_S_DSC,4,2                  ; @ATA_S_DSC
	.comm	_io_flist,4,2                   ; @io_flist
	.comm	_io_blist,4,2                   ; @io_blist
	.no_dead_strip	_atapi_read
.subsections_via_symbols
