	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_ata_cmd                  ## -- Begin function build_ata_cmd
	.p2align	4, 0x90
_build_ata_cmd:                         ## @build_ata_cmd
	.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, %r14d
	movl	%r8d, %r15d
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movq	%rdi, %rbx
	movl	104(%rbp), %r12d
	movq	96(%rbp), %r10
	movq	48(%rbp), %r11
	movl	40(%rbp), %eax
	movq	_CC_DT_ATA@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	32(%rbp), %r13
	cmpq	112(%rbp), %rdx
	jne	LBB0_15
## %bb.1:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movq	56(%rbp), %r9
	pushq	%r10
	pushq	64(%rbp)
	callq	_cam_fill_ataio
	addq	$16, %rsp
	testl	%r12d, %r12d
	jne	LBB0_3
## %bb.2:
	movq	_ATA_MAX_28BIT_LBA@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jl	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	movl	40(%rbp), %esi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	16(%rbp), %edx
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r13, %rcx
	movl	24(%rbp), %r8d
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_ata_28bit_cmd
	jmp	LBB0_5
LBB0_15:
	movq	_ATA_MAX_28BIT_LBA@GOTPCREL(%rip), %rdx
	xorl	%r9d, %r9d
	cmpq	%r13, (%rdx)
	movq	_AP_EXTEND@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmovll	%edx, %r9d
	testl	%r12d, %r12d
	cmovnel	%edx, %r9d
	orl	%r15d, %r9d
	movq	%rbx, %rdi
	xorl	%edx, %edx
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%r10
	movl	88(%rbp), %ebx
	pushq	%rbx
	pushq	$0
	pushq	80(%rbp)
	pushq	72(%rbp)
	pushq	64(%rbp)
	pushq	56(%rbp)
	pushq	$0
	pushq	%r11
	pushq	$0
	pushq	$0
	pushq	%rax
	pushq	%r13
	movl	24(%rbp), %eax
	pushq	%rax
	movl	16(%rbp), %eax
	pushq	%rax
	pushq	%r14
	callq	_scsi_ata_pass
	addq	$136, %rsp
	jmp	LBB0_16
LBB0_3:
	movq	%rbx, %rdi
	movl	40(%rbp), %esi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	16(%rbp), %edx
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r13, %rcx
	movl	24(%rbp), %r8d
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_ata_48bit_cmd
LBB0_5:
	movq	48(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.6:
	movq	_ATA_FLAG_AUX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	movq	%rcx, 8(%rbx)
LBB0_7:
	movq	_AP_FLAG_CHK_COND@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.8:
	movq	_CAM_ATAIO_NEEDRESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_9:
	movq	_AP_PROTO_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_AP_PROTO_DMA@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_13
## %bb.10:
	movq	_CAM_ATAIO_DMA@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	movq	_AP_PROTO_FPDMA@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_12
## %bb.14:
	movq	_CAM_ATAIO_FPDMA@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_12:
	xorl	%eax, %eax
	addq	$8, %rsp
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CC_DT_ATA,8,3                  ## @CC_DT_ATA
	.comm	_ATA_MAX_28BIT_LBA,8,3          ## @ATA_MAX_28BIT_LBA
	.comm	_ATA_FLAG_AUX,4,2               ## @ATA_FLAG_AUX
	.comm	_AP_FLAG_CHK_COND,4,2           ## @AP_FLAG_CHK_COND
	.comm	_CAM_ATAIO_NEEDRESULT,4,2       ## @CAM_ATAIO_NEEDRESULT
	.comm	_AP_PROTO_MASK,4,2              ## @AP_PROTO_MASK
	.comm	_AP_PROTO_DMA,4,2               ## @AP_PROTO_DMA
	.comm	_CAM_ATAIO_DMA,4,2              ## @CAM_ATAIO_DMA
	.comm	_AP_PROTO_FPDMA,4,2             ## @AP_PROTO_FPDMA
	.comm	_CAM_ATAIO_FPDMA,4,2            ## @CAM_ATAIO_FPDMA
	.comm	_AP_EXTEND,4,2                  ## @AP_EXTEND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_ata_cmd                  ; -- Begin function build_ata_cmd
	.p2align	2
_build_ata_cmd:                         ; @build_ata_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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	x23, x7
	mov	x22, x6
	mov	x20, x5
	mov	x21, x4
	mov	x4, x3
	mov	x3, x2
	mov	x19, x0
	ldr	w27, [x29, #88]
	ldr	x7, [x29, #80]
	ldp	x5, x6, [x29, #40]
	ldr	x26, [x29, #32]
	ldr	w25, [x29, #24]
	ldr	x24, [x29, #16]
	ldr	x8, [x29, #96]
Lloh0:
	adrp	x9, _CC_DT_ATA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CC_DT_ATA@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.1:
	mov	x0, x19
	mov	x2, #0
	bl	_cam_fill_ataio
	cbnz	w27, LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _ATA_MAX_28BIT_LBA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_MAX_28BIT_LBA@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x24
	b.lt	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x22
	mov	x3, x24
	mov	x4, x23
	bl	_ata_28bit_cmd
	cbnz	x26, LBB0_6
	b	LBB0_7
LBB0_4:
	ldr	w9, [x29, #72]
	ldp	x11, x10, [x29, #56]
Lloh6:
	adrp	x8, _ATA_MAX_28BIT_LBA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_MAX_28BIT_LBA@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x24
	ccmp	w27, #0, #0, ge
Lloh9:
	adrp	x8, _AP_EXTEND@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AP_EXTEND@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	csel	w8, w8, wzr, ne
	orr	w8, w8, w21
	str	x7, [sp, #88]
	stp	wzr, w9, [sp, #80]
	stp	x11, x10, [sp, #64]
	stp	x5, x6, [sp, #48]
	str	wzr, [sp, #40]
	str	x26, [sp, #32]
	stur	xzr, [sp, #20]
	str	w25, [sp, #16]
	str	x24, [sp, #8]
	str	w23, [sp]
	mov	x0, x19
	mov	x2, #0
	mov	x5, x8
	mov	x6, x20
	mov	x7, x22
	bl	_scsi_ata_pass
	b	LBB0_15
LBB0_5:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x22
	mov	x3, x24
	mov	x4, x23
	bl	_ata_48bit_cmd
	cbz	x26, LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _ATA_FLAG_AUX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATA_FLAG_AUX@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	str	x26, [x19, #8]
LBB0_7:
Lloh15:
	adrp	x8, _AP_FLAG_CHK_COND@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AP_FLAG_CHK_COND@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_9
; %bb.8:
Lloh18:
	adrp	x8, _CAM_ATAIO_NEEDRESULT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CAM_ATAIO_NEEDRESULT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_9:
Lloh21:
	adrp	x8, _AP_PROTO_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AP_PROTO_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh24:
	adrp	x9, _AP_PROTO_DMA@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AP_PROTO_DMA@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.10:
Lloh27:
	adrp	x8, _CAM_ATAIO_DMA@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAM_ATAIO_DMA@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
Lloh29:
	adrp	x9, _AP_PROTO_FPDMA@GOTPAGE
Lloh30:
	ldr	x9, [x9, _AP_PROTO_FPDMA@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.12:
Lloh32:
	adrp	x8, _CAM_ATAIO_FPDMA@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CAM_ATAIO_FPDMA@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_CC_DT_ATA,8,3                  ; @CC_DT_ATA
	.comm	_ATA_MAX_28BIT_LBA,8,3          ; @ATA_MAX_28BIT_LBA
	.comm	_ATA_FLAG_AUX,4,2               ; @ATA_FLAG_AUX
	.comm	_AP_FLAG_CHK_COND,4,2           ; @AP_FLAG_CHK_COND
	.comm	_CAM_ATAIO_NEEDRESULT,4,2       ; @CAM_ATAIO_NEEDRESULT
	.comm	_AP_PROTO_MASK,4,2              ; @AP_PROTO_MASK
	.comm	_AP_PROTO_DMA,4,2               ; @AP_PROTO_DMA
	.comm	_CAM_ATAIO_DMA,4,2              ; @CAM_ATAIO_DMA
	.comm	_AP_PROTO_FPDMA,4,2             ; @AP_PROTO_FPDMA
	.comm	_CAM_ATAIO_FPDMA,4,2            ; @CAM_ATAIO_FPDMA
	.comm	_AP_EXTEND,4,2                  ; @AP_EXTEND
.subsections_via_symbols
