	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atapi_qc_complete
_atapi_qc_complete:                     ## @atapi_qc_complete
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movl	(%rdi), %r15d
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_VPRINTK
	movq	40(%rbx), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movl	$1, %edi
	testl	%r15d, %r15d
	jne	LBB0_4
## %bb.3:
	movq	_ATA_QCFLAG_SENSE_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	testl	%eax, 4(%rbx)
	setne	%dil
	jmp	LBB0_4
LBB0_1:
	xorl	%edi, %edi
LBB0_4:
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	_ATA_QCFLAG_SENSE_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	jne	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_ata_gen_passthru_sense
LBB0_7:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	_ALLOW_MEDIUM_REMOVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	movq	$0, (%rax)
LBB0_9:
	movq	_SAM_STAT_CHECK_CONDITION@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	24(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	%r14, %rdi
	callq	*16(%rbx)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_qc_free                    ## TAILCALL
LBB0_10:
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%r15d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
## %bb.20:
	movq	_SAM_STAT_CHECK_CONDITION@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atapi_request_sense            ## TAILCALL
LBB0_11:
	movl	%r15d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_ata_gen_passthru_sense
	jmp	LBB0_19
LBB0_13:
	movq	(%r14), %rax
	movl	(%rax), %ecx
	movq	_INQUIRY@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_18
## %bb.14:
	testb	$3, 4(%rax)
	jne	LBB0_18
## %bb.15:
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_ata_scsi_rbuf_get
	cmpl	$0, 8(%rax)
	jne	LBB0_17
## %bb.16:
	movabsq	$214748364805, %rcx             ## imm = 0x3200000005
	movq	%rcx, 8(%rax)
LBB0_17:
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_ata_scsi_rbuf_put
LBB0_18:
	movq	_SAM_STAT_GOOD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
LBB0_19:
	movq	%r14, %rdi
	callq	*16(%rbx)
	movq	%rbx, %rdi
	callq	_ata_qc_free
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENTER, err_mask 0x%X\n"

	.comm	_ATA_QCFLAG_SENSE_VALID,4,2     ## @ATA_QCFLAG_SENSE_VALID
	.comm	_ALLOW_MEDIUM_REMOVAL,8,3       ## @ALLOW_MEDIUM_REMOVAL
	.comm	_SAM_STAT_CHECK_CONDITION,8,3   ## @SAM_STAT_CHECK_CONDITION
	.comm	_AC_ERR_DEV,4,2                 ## @AC_ERR_DEV
	.comm	_INQUIRY,4,2                    ## @INQUIRY
	.comm	_SAM_STAT_GOOD,8,3              ## @SAM_STAT_GOOD
	.no_dead_strip	_atapi_qc_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function atapi_qc_complete
lCPI0_0:
	.long	5                               ; 0x5
	.long	50                              ; 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_atapi_qc_complete:                     ; @atapi_qc_complete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x20, [x0, #24]
	ldr	w21, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_VPRINTK
	ldr	x8, [x19, #40]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
	cbz	w21, LBB0_9
; %bb.2:
	mov	w0, #1
	bl	_unlikely
	cbnz	x0, LBB0_4
	b	LBB0_10
LBB0_3:
	mov	w0, #0
	bl	_unlikely
	cbz	x0, LBB0_10
LBB0_4:
	ldr	w8, [x19, #4]
Lloh2:
	adrp	x9, _ATA_QCFLAG_SENSE_VALID@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATA_QCFLAG_SENSE_VALID@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_ata_gen_passthru_sense
LBB0_6:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _ALLOW_MEDIUM_REMOVAL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ALLOW_MEDIUM_REMOVAL@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	str	xzr, [x8]
LBB0_8:
Lloh8:
	adrp	x8, _SAM_STAT_CHECK_CONDITION@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SAM_STAT_CHECK_CONDITION@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	x10, x9, [x19, #16]
	str	x8, [x9, #8]
	mov	x0, x20
	blr	x10
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_ata_qc_free
LBB0_9:
	ldr	w8, [x19, #4]
Lloh11:
	adrp	x9, _ATA_QCFLAG_SENSE_VALID@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_QCFLAG_SENSE_VALID@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_4
LBB0_10:
Lloh14:
	adrp	x8, _AC_ERR_DEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AC_ERR_DEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w0, w8, w21
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.11:
Lloh17:
	adrp	x8, _SAM_STAT_CHECK_CONDITION@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SAM_STAT_CHECK_CONDITION@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_atapi_request_sense
LBB0_12:
	mov	x0, x21
	bl	_unlikely
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_ata_gen_passthru_sense
	b	LBB0_20
LBB0_14:
	ldr	x8, [x20]
	ldr	w9, [x8]
Lloh20:
	adrp	x10, _INQUIRY@GOTPAGE
Lloh21:
	ldr	x10, [x10, _INQUIRY@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_19
; %bb.15:
	ldrb	w8, [x8, #4]
	tst	w8, #0x3
	b.ne	LBB0_19
; %bb.16:
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #1
	bl	_ata_scsi_rbuf_get
	ldr	w8, [x0, #8]
	cbnz	w8, LBB0_18
; %bb.17:
Lloh23:
	adrp	x8, lCPI0_0@PAGE
Lloh24:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x0, #8]
LBB0_18:
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #1
	bl	_ata_scsi_rbuf_put
LBB0_19:
Lloh25:
	adrp	x8, _SAM_STAT_GOOD@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SAM_STAT_GOOD@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	str	x8, [x20, #8]
LBB0_20:
	ldr	x8, [x19, #16]
	mov	x0, x20
	blr	x8
	mov	x0, x19
	bl	_ata_qc_free
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdr	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENTER, err_mask 0x%X\n"

	.comm	_ATA_QCFLAG_SENSE_VALID,4,2     ; @ATA_QCFLAG_SENSE_VALID
	.comm	_ALLOW_MEDIUM_REMOVAL,8,3       ; @ALLOW_MEDIUM_REMOVAL
	.comm	_SAM_STAT_CHECK_CONDITION,8,3   ; @SAM_STAT_CHECK_CONDITION
	.comm	_AC_ERR_DEV,4,2                 ; @AC_ERR_DEV
	.comm	_INQUIRY,4,2                    ; @INQUIRY
	.comm	_SAM_STAT_GOOD,8,3              ; @SAM_STAT_GOOD
	.no_dead_strip	_atapi_qc_complete
.subsections_via_symbols
