	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atapi_xlat
_atapi_xlat:                            ## @atapi_xlat
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %rcx
	movq	40(%rdi), %r14
	movq	(%r14), %r12
	movq	_DMA_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	cmpq	%r13, %r12
	jne	LBB0_2
## %bb.1:
	movb	$1, %r15b
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_3
LBB0_2:
	movq	_ATA_DFLAG_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rcx)
	setne	%r15b
	movl	%r15d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_3:
	movl	28(%rbx), %edi
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rcx), %edx
	xorl	%esi, %esi
	callq	_memset
	movl	28(%rbx), %edi
	movl	8(%r14), %edx
	movl	12(%r14), %esi
	callq	_memcpy
	movq	_atapi_qc_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_ATA_TFLAG_ISADDR@GOTPCREL(%rip), %rcx
	movq	_ATA_TFLAG_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	orl	(%rbx), %eax
	movl	%eax, (%rbx)
	movq	(%r14), %rcx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_5
## %bb.4:
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_DPRINTK
LBB0_5:
	movq	_ATA_CMD_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	%rbx, %rdi
	callq	_ata_qc_set_pc_nbytes
	testb	%r15b, %r15b
	je	LBB0_7
## %bb.6:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_8
LBB0_7:
	movq	%rbx, %rdi
	callq	_atapi_check_dma
	testq	%rax, %rax
	setne	%al
	orb	-44(%rbp), %al                  ## 1-byte Folded Reload
	movl	%eax, %r15d
LBB0_8:
	movq	%rbx, %rdi
	callq	_ata_qc_raw_nbytes
	movl	%eax, %edi
	movl	$64512, %esi                    ## imm = 0xFC00
	callq	_min
	movl	%eax, %ecx
	andl	$1, %ecx
	addl	%eax, %ecx
	movzbl	%cl, %eax
	shrl	$8, %ecx
	movl	%eax, 4(%rbx)
	movl	%ecx, 8(%rbx)
	cmpq	%r13, %r12
	jne	LBB0_11
## %bb.9:
	movq	_ATAPI_PROT_NODATA@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_11:
	testb	%r15b, %r15b
	je	LBB0_13
## %bb.12:
	movq	_ATAPI_PROT_PIO@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
LBB0_16:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_ATAPI_PROT_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_ATAPI_PKT_DMA@GOTPCREL(%rip), %rcx
	movl	12(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, 12(%rbx)
	movq	_ATA_DFLAG_DMADIR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	testl	%ecx, (%rdx)
	je	LBB0_16
## %bb.14:
	movq	(%r14), %rcx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_16
## %bb.15:
	movq	_ATAPI_DMADIR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 12(%rbx)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_NONE,8,3                   ## @DMA_NONE
	.comm	_ATA_DFLAG_PIO,4,2              ## @ATA_DFLAG_PIO
	.comm	_atapi_qc_complete,4,2          ## @atapi_qc_complete
	.comm	_ATA_TFLAG_ISADDR,4,2           ## @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_DEVICE,4,2           ## @ATA_TFLAG_DEVICE
	.comm	_DMA_TO_DEVICE,8,3              ## @DMA_TO_DEVICE
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"direction: write\n"

	.comm	_ATA_CMD_PACKET,4,2             ## @ATA_CMD_PACKET
	.comm	_ATAPI_PROT_NODATA,4,2          ## @ATAPI_PROT_NODATA
	.comm	_ATAPI_PROT_PIO,4,2             ## @ATAPI_PROT_PIO
	.comm	_ATAPI_PROT_DMA,4,2             ## @ATAPI_PROT_DMA
	.comm	_ATAPI_PKT_DMA,4,2              ## @ATAPI_PKT_DMA
	.comm	_ATA_DFLAG_DMADIR,4,2           ## @ATA_DFLAG_DMADIR
	.comm	_ATAPI_DMADIR,4,2               ## @ATAPI_DMADIR
	.no_dead_strip	_atapi_xlat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atapi_xlat
_atapi_xlat:                            ; @atapi_xlat
	.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	x19, x0
	ldp	x21, x20, [x0, #32]
	ldr	x22, [x20]
Lloh0:
	adrp	x8, _DMA_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	cmp	x22, x23
	b.ne	LBB0_2
; %bb.1:
	mov	w24, #0
	mov	w26, #1
	b	LBB0_3
LBB0_2:
	ldr	w8, [x21]
Lloh3:
	adrp	x9, _ATA_DFLAG_PIO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_DFLAG_PIO@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w26, ne
	mov	x24, x26
LBB0_3:
	ldr	w0, [x19, #28]
	ldr	w2, [x21, #4]
	mov	w1, #0
	bl	_memset
	ldr	w0, [x19, #28]
	ldp	w2, w1, [x20, #8]
	bl	_memcpy
Lloh6:
	adrp	x8, _atapi_qc_complete@GOTPAGE
Lloh7:
	ldr	x8, [x8, _atapi_qc_complete@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #24]
Lloh9:
	adrp	x8, _ATA_TFLAG_ISADDR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_TFLAG_ISADDR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _ATA_TFLAG_DEVICE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATA_TFLAG_DEVICE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
	ldr	x9, [x20]
Lloh15:
	adrp	x25, _DMA_TO_DEVICE@GOTPAGE
Lloh16:
	ldr	x25, [x25, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	x10, [x25]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.4:
Lloh17:
	adrp	x9, _ATA_TFLAG_WRITE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTK
LBB0_5:
Lloh22:
	adrp	x8, _ATA_CMD_PACKET@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ATA_CMD_PACKET@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	mov	x0, x19
	bl	_ata_qc_set_pc_nbytes
	tbnz	w26, #0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_atapi_check_dma
	cmp	x0, #0
	cset	w8, ne
	orr	w24, w8, w24
LBB0_7:
	mov	x0, x19
	bl	_ata_qc_raw_nbytes
	mov	w1, #64512
	bl	_min
	and	w8, w0, #0x1
	add	w8, w8, w0
	and	w9, w8, #0xff
	lsr	w8, w8, #8
	stp	w9, w8, [x19, #4]
	cmp	x22, x23
	b.ne	LBB0_9
; %bb.8:
Lloh25:
	adrp	x8, _ATAPI_PROT_NODATA@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ATAPI_PROT_NODATA@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
	cbz	w24, LBB0_13
; %bb.10:
Lloh27:
	adrp	x8, _ATAPI_PROT_PIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ATAPI_PROT_PIO@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x19, #16]
LBB0_12:
	mov	w0, #0
	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
LBB0_13:
Lloh29:
	adrp	x8, _ATAPI_PROT_DMA@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ATAPI_PROT_DMA@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x8]
Lloh32:
	adrp	x8, _ATAPI_PKT_DMA@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ATAPI_PKT_DMA@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	ldr	w10, [x19, #12]
	orr	w8, w10, w8
	stp	w8, w9, [x19, #12]
	ldr	w9, [x21]
Lloh35:
	adrp	x10, _ATA_DFLAG_DMADIR@GOTPAGE
Lloh36:
	ldr	x10, [x10, _ATA_DFLAG_DMADIR@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_12
; %bb.14:
	ldr	x9, [x20]
	ldr	x10, [x25]
	cmp	x9, x10
	b.eq	LBB0_12
; %bb.15:
Lloh38:
	adrp	x9, _ATAPI_DMADIR@GOTPAGE
Lloh39:
	ldr	x9, [x9, _ATAPI_DMADIR@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_NONE,8,3                   ; @DMA_NONE
	.comm	_ATA_DFLAG_PIO,4,2              ; @ATA_DFLAG_PIO
	.comm	_atapi_qc_complete,4,2          ; @atapi_qc_complete
	.comm	_ATA_TFLAG_ISADDR,4,2           ; @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_DEVICE,4,2           ; @ATA_TFLAG_DEVICE
	.comm	_DMA_TO_DEVICE,8,3              ; @DMA_TO_DEVICE
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"direction: write\n"

	.comm	_ATA_CMD_PACKET,4,2             ; @ATA_CMD_PACKET
	.comm	_ATAPI_PROT_NODATA,4,2          ; @ATAPI_PROT_NODATA
	.comm	_ATAPI_PROT_PIO,4,2             ; @ATAPI_PROT_PIO
	.comm	_ATAPI_PROT_DMA,4,2             ; @ATAPI_PROT_DMA
	.comm	_ATAPI_PKT_DMA,4,2              ; @ATAPI_PKT_DMA
	.comm	_ATA_DFLAG_DMADIR,4,2           ; @ATA_DFLAG_DMADIR
	.comm	_ATAPI_DMADIR,4,2               ; @ATAPI_DMADIR
	.no_dead_strip	_atapi_xlat
.subsections_via_symbols
