	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_adma_qc_prep
_nv_adma_qc_prep:                       ## @nv_adma_qc_prep
	.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, %r15
	movq	(%rdi), %r14
	movq	24(%rdi), %rax
	movq	(%rax), %rbx
	movq	8(%rbx), %r13
	movq	_NV_CPB_CTL_CPB_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_NV_CPB_CTL_IEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	callq	_nv_adma_use_reg_mode
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	_NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	testl	%eax, (%rbx)
	jne	LBB0_3
## %bb.2:
	movq	_ATA_QCFLAG_DMAMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	testl	%eax, 8(%r15)
	setne	%dil
LBB0_3:
	callq	_BUG_ON
	movq	24(%r15), %rdi
	callq	_nv_adma_register_mode
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_sff_qc_prep                ## TAILCALL
LBB0_4:
	movl	%r12d, %eax
	leaq	(%r14,%r14,2), %r12
	shlq	$4, %r12
	leaq	(%r12,%r13), %rbx
	orl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_NV_CPB_RESP_DONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%r12,%r13), %rcx
	addq	$16, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, 16(%r13,%r12)
	xorl	%eax, %eax
	callq	_wmb
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	$0, (%rbx)
	xorl	%eax, %eax
	callq	_wmb
	movl	$3, 4(%r13,%r12)
	movq	(%r15), %rax
	movq	%rax, 8(%r13,%r12)
	movq	$0, 40(%r13,%r12)
	leaq	16(%r15), %rbx
	movq	16(%r15), %rax
	movq	_ATA_PROT_NCQ@GOTPCREL(%rip), %rcx
	movq	_NV_CPB_CTL_QUEUE@GOTPCREL(%rip), %rdx
	movq	_NV_CPB_CTL_FPDMA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r14d
	orl	(%rdx), %r14d
	cmpq	(%rcx), %rax
	movl	$0, %eax
	cmovnel	%eax, %r14d
	orl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	movl	8(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_VPRINTK
	movl	32(%r13,%r12), %esi
	movq	%rbx, %rdi
	callq	_nv_adma_tf_to_cpb
	movq	_ATA_QCFLAG_DMAMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_nv_adma_fill_sg
	movq	_NV_CPB_CTL_APRD_VALID@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	jmp	LBB0_7
LBB0_6:
	movq	24(%r13,%r12), %rdi
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_memset
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_7:
	xorl	%eax, %eax
	callq	_wmb
	movl	%r14d, (%rbx)
	xorl	%eax, %eax
	callq	_wmb
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_CPB_CTL_CPB_VALID,4,2       ## @NV_CPB_CTL_CPB_VALID
	.comm	_NV_CPB_CTL_IEN,4,2             ## @NV_CPB_CTL_IEN
	.comm	_NV_ADMA_ATAPI_SETUP_COMPLETE,4,2 ## @NV_ADMA_ATAPI_SETUP_COMPLETE
	.comm	_ATA_QCFLAG_DMAMAP,4,2          ## @ATA_QCFLAG_DMAMAP
	.comm	_NV_CPB_RESP_DONE,8,3           ## @NV_CPB_RESP_DONE
	.comm	_ATA_PROT_NCQ,8,3               ## @ATA_PROT_NCQ
	.comm	_NV_CPB_CTL_QUEUE,4,2           ## @NV_CPB_CTL_QUEUE
	.comm	_NV_CPB_CTL_FPDMA,4,2           ## @NV_CPB_CTL_FPDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qc->flags = 0x%lx\n"

	.comm	_NV_CPB_CTL_APRD_VALID,4,2      ## @NV_CPB_CTL_APRD_VALID
	.no_dead_strip	_nv_adma_qc_prep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_adma_qc_prep
_nv_adma_qc_prep:                       ; @nv_adma_qc_prep
	.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
	ldr	x8, [x0, #24]
	ldr	x20, [x8]
	ldr	x23, [x20, #8]
	ldr	x24, [x0]
Lloh0:
	adrp	x8, _NV_CPB_CTL_CPB_VALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV_CPB_CTL_CPB_VALID@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _NV_CPB_CTL_IEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NV_CPB_CTL_IEN@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	bl	_nv_adma_use_reg_mode
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x20]
Lloh6:
	adrp	x9, _NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	mov	w0, #0
	b	LBB0_6
LBB0_3:
	mov	w8, #48
	madd	x20, x24, x8, x23
Lloh9:
	adrp	x8, _NV_CPB_RESP_DONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NV_CPB_RESP_DONE@GOTPAGEOFF]
	orr	w25, w22, w21
Lloh11:
	ldr	x8, [x8]
	mov	w9, #48
	madd	x22, x24, x9, x23
	str	x8, [x22, #16]!
	bl	_wmb
	str	wzr, [x20]
	bl	_wmb
	mov	w8, #3
	stur	w8, [x22, #-12]
	ldr	x8, [x19]
	stur	x8, [x22, #-8]
	str	xzr, [x22, #24]
	mov	x21, x19
	ldr	x8, [x21, #16]!
Lloh12:
	adrp	x9, _ATA_PROT_NCQ@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATA_PROT_NCQ@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
Lloh15:
	adrp	x10, _NV_CPB_CTL_QUEUE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _NV_CPB_CTL_QUEUE@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _NV_CPB_CTL_FPDMA@GOTPAGE
Lloh19:
	ldr	x11, [x11, _NV_CPB_CTL_FPDMA@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	orr	w10, w11, w10
	cmp	x8, x9
	csel	w8, w10, wzr, eq
	orr	w25, w25, w8
	ldr	w1, [x19, #8]
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VPRINTK
	ldr	w1, [x22, #16]
	mov	x0, x21
	bl	_nv_adma_tf_to_cpb
	ldr	w8, [x19, #8]
Lloh23:
	adrp	x9, _ATA_QCFLAG_DMAMAP@GOTPAGE
Lloh24:
	ldr	x9, [x9, _ATA_QCFLAG_DMAMAP@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_nv_adma_fill_sg
Lloh26:
	adrp	x8, _NV_CPB_CTL_APRD_VALID@GOTPAGE
Lloh27:
	ldr	x8, [x8, _NV_CPB_CTL_APRD_VALID@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	orr	w25, w8, w25
	b	LBB0_8
LBB0_5:
	ldr	w8, [x19, #8]
Lloh29:
	adrp	x9, _ATA_QCFLAG_DMAMAP@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ATA_QCFLAG_DMAMAP@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, ne
LBB0_6:
	bl	_BUG_ON
	ldr	x0, [x19, #24]
	bl	_nv_adma_register_mode
	mov	x0, x19
	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
	b	_ata_sff_qc_prep
LBB0_7:
	mov	w8, #48
	madd	x8, x24, x8, x23
	ldr	x0, [x8, #24]
	mov	w1, #0
	mov	w2, #20
	bl	_memset
LBB0_8:
	bl	_wmb
	str	w25, [x20]
	bl	_wmb
	str	xzr, [x22]
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_CPB_CTL_CPB_VALID,4,2       ; @NV_CPB_CTL_CPB_VALID
	.comm	_NV_CPB_CTL_IEN,4,2             ; @NV_CPB_CTL_IEN
	.comm	_NV_ADMA_ATAPI_SETUP_COMPLETE,4,2 ; @NV_ADMA_ATAPI_SETUP_COMPLETE
	.comm	_ATA_QCFLAG_DMAMAP,4,2          ; @ATA_QCFLAG_DMAMAP
	.comm	_NV_CPB_RESP_DONE,8,3           ; @NV_CPB_RESP_DONE
	.comm	_ATA_PROT_NCQ,8,3               ; @ATA_PROT_NCQ
	.comm	_NV_CPB_CTL_QUEUE,4,2           ; @NV_CPB_CTL_QUEUE
	.comm	_NV_CPB_CTL_FPDMA,4,2           ; @NV_CPB_CTL_FPDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qc->flags = 0x%lx\n"

	.comm	_NV_CPB_CTL_APRD_VALID,4,2      ; @NV_CPB_CTL_APRD_VALID
	.no_dead_strip	_nv_adma_qc_prep
.subsections_via_symbols
