	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adma_qc_prep
_adma_qc_prep:                          ## @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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	56(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movslq	8(%rax), %r14
	leaq	L_.str(%rip), %rdi
	callq	_VPRINTK
	movq	56(%r15), %rdi
	callq	_adma_enter_reg_mode
	movq	(%r15), %rax
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	$0, (%rbx)
	movq	_cVLD@GOTPCREL(%rip), %rax
	movq	_cDAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_cIEN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movq	%r14, %rdi
	callq	_cpu_to_le32
	movl	%eax, 16(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%rbx)
	movl	8(%r15), %eax
	movl	%eax, 64(%rbx)
	movq	_ADMA_REGS_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%rbx)
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r15)
	je	LBB0_2
## %bb.3:
	movl	16(%r15), %eax
	movl	%eax, 72(%rbx)
	movq	_ADMA_REGS_SECTOR_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 76(%rbx)
	movl	20(%r15), %eax
	movl	%eax, 80(%rbx)
	movq	_ADMA_REGS_LBA_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 84(%rbx)
	movl	24(%r15), %eax
	movl	%eax, 88(%rbx)
	movq	_ADMA_REGS_LBA_MID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 92(%rbx)
	movl	28(%r15), %eax
	movl	%eax, 96(%rbx)
	movq	_ADMA_REGS_LBA_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 100(%rbx)
	movl	$26, %eax
	jmp	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_sff_qc_prep                ## TAILCALL
LBB0_2:
	movl	$18, %eax
LBB0_4:
	movl	32(%r15), %edx
	movl	%eax, %esi
	orl	$1, %esi
	movl	%eax, %ecx
	movl	%edx, (%rbx,%rcx,4)
	movq	_ADMA_REGS_SECTOR_COUNT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%rbx,%rsi,4)
	movl	36(%r15), %edx
	movl	%edx, 8(%rbx,%rcx,4)
	movq	_ADMA_REGS_LBA_LOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%eax, %esi
	orl	$4, %esi
	movl	%edx, 12(%rbx,%rcx,4)
	movl	40(%r15), %edx
	movl	%eax, %edi
	orl	$5, %edi
	movl	%edx, (%rbx,%rsi,4)
	movq	_ADMA_REGS_LBA_MID@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%rbx,%rdi,4)
	movl	44(%r15), %edx
	movl	%edx, 24(%rbx,%rcx,4)
	movq	_ADMA_REGS_LBA_HIGH@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 28(%rbx,%rcx,4)
	movl	$0, 32(%rbx,%rcx,4)
	movq	_ADMA_REGS_CONTROL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 36(%rbx,%rcx,4)
	movq	_rIGN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 40(%rbx,%rcx,4)
	movl	$0, 44(%rbx,%rcx,4)
	movl	48(%r15), %edx
	movl	%edx, 48(%rbx,%rcx,4)
	movq	_ADMA_REGS_COMMAND@GOTPCREL(%rip), %rdx
	movq	_rEND@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	addl	$14, %eax
	movl	%esi, 52(%rbx,%rcx,4)
	shrl	$3, %eax
	addl	$-2, %eax
	movl	%eax, 12(%rbx)
	leaq	(%rcx,%r14), %rdi
	addq	$14, %rdi
	callq	_cpu_to_le32
	movl	%eax, 32(%rbx)
	movq	%r15, %rdi
	callq	_adma_fill_sg
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wmb                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENTER\n"

	.comm	_ATA_PROT_DMA,8,3               ## @ATA_PROT_DMA
	.comm	_cVLD,4,2                       ## @cVLD
	.comm	_cDAT,4,2                       ## @cDAT
	.comm	_cIEN,4,2                       ## @cIEN
	.comm	_ADMA_REGS_DEVICE,4,2           ## @ADMA_REGS_DEVICE
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_ADMA_REGS_SECTOR_COUNT,4,2     ## @ADMA_REGS_SECTOR_COUNT
	.comm	_ADMA_REGS_LBA_LOW,4,2          ## @ADMA_REGS_LBA_LOW
	.comm	_ADMA_REGS_LBA_MID,4,2          ## @ADMA_REGS_LBA_MID
	.comm	_ADMA_REGS_LBA_HIGH,4,2         ## @ADMA_REGS_LBA_HIGH
	.comm	_ADMA_REGS_CONTROL,4,2          ## @ADMA_REGS_CONTROL
	.comm	_rIGN,4,2                       ## @rIGN
	.comm	_ADMA_REGS_COMMAND,4,2          ## @ADMA_REGS_COMMAND
	.comm	_rEND,4,2                       ## @rEND
	.no_dead_strip	_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 adma_qc_prep
_adma_qc_prep:                          ; @adma_qc_prep
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, [x0, #56]
	ldr	x8, [x8]
	ldr	x21, [x8]
	ldrsw	x20, [x8, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VPRINTK
	ldr	x0, [x19, #56]
	bl	_adma_enter_reg_mode
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _ATA_PROT_DMA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	str	xzr, [x21]
Lloh5:
	adrp	x8, _cVLD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _cVLD@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _cDAT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _cDAT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _cIEN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _cIEN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x21, #8]
	mov	x0, x20
	bl	_cpu_to_le32
	str	w0, [x21, #16]
	stp	xzr, xzr, [x21, #48]
	ldr	w8, [x19, #8]
Lloh14:
	adrp	x9, _ADMA_REGS_DEVICE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ADMA_REGS_DEVICE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w8, w9, [x21, #64]
	ldr	w8, [x19, #12]
Lloh17:
	adrp	x9, _ATA_TFLAG_LBA48@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh19:
	adrp	x12, _ADMA_REGS_SECTOR_COUNT@GOTPAGE
Lloh20:
	ldr	x12, [x12, _ADMA_REGS_SECTOR_COUNT@GOTPAGEOFF]
Lloh21:
	adrp	x11, _ADMA_REGS_LBA_LOW@GOTPAGE
Lloh22:
	ldr	x11, [x11, _ADMA_REGS_LBA_LOW@GOTPAGEOFF]
Lloh23:
	ldr	w13, [x9]
Lloh24:
	adrp	x10, _ADMA_REGS_LBA_MID@GOTPAGE
Lloh25:
	ldr	x10, [x10, _ADMA_REGS_LBA_MID@GOTPAGEOFF]
Lloh26:
	adrp	x9, _ADMA_REGS_LBA_HIGH@GOTPAGE
Lloh27:
	ldr	x9, [x9, _ADMA_REGS_LBA_HIGH@GOTPAGEOFF]
	tst	w13, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	w8, [x19, #16]
	ldr	w13, [x12]
	stp	w8, w13, [x21, #72]
	ldr	w8, [x19, #20]
	ldr	w13, [x11]
	stp	w8, w13, [x21, #80]
	ldr	w8, [x19, #24]
	ldr	w13, [x10]
	stp	w8, w13, [x21, #88]
	ldr	w8, [x19, #28]
	ldr	w13, [x9]
	stp	w8, w13, [x21, #96]
	mov	w8, #26
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ata_sff_qc_prep
LBB0_4:
	mov	w8, #18
LBB0_5:
	ldr	w13, [x19, #32]
	str	w13, [x21, w8, uxtw #2]
	orr	w13, w8, #0x1
	ldr	w12, [x12]
	add	w14, w8, #2
	str	w12, [x21, w13, uxtw #2]
	ldr	w12, [x19, #36]
	add	w13, w8, #3
	str	w12, [x21, w14, uxtw #2]
	ldr	w11, [x11]
	str	w11, [x21, w13, uxtw #2]
	orr	w11, w8, #0x4
	ldr	w12, [x19, #40]
	mov	w13, #5
	orr	w13, w8, w13
	str	w12, [x21, w11, uxtw #2]
	ldr	w10, [x10]
	add	w11, w8, #6
	str	w10, [x21, w13, uxtw #2]
	ldr	w10, [x19, #44]
	add	w12, w8, #7
	str	w10, [x21, w11, uxtw #2]
	ldr	w9, [x9]
	add	w10, w8, #8
	str	w9, [x21, w12, uxtw #2]
	add	w9, w8, #9
	str	wzr, [x21, w10, uxtw #2]
Lloh28:
	adrp	x10, _ADMA_REGS_CONTROL@GOTPAGE
Lloh29:
	ldr	x10, [x10, _ADMA_REGS_CONTROL@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	add	w11, w8, #10
	str	w10, [x21, w9, uxtw #2]
Lloh31:
	adrp	x9, _rIGN@GOTPAGE
Lloh32:
	ldr	x9, [x9, _rIGN@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	add	w10, w8, #11
	str	w9, [x21, w11, uxtw #2]
	add	w9, w8, #12
	str	wzr, [x21, w10, uxtw #2]
	ldr	w10, [x19, #48]
	add	w11, w8, #13
	str	w10, [x21, w9, uxtw #2]
Lloh34:
	adrp	x9, _ADMA_REGS_COMMAND@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ADMA_REGS_COMMAND@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _rEND@GOTPAGE
Lloh38:
	ldr	x10, [x10, _rEND@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	orr	w9, w10, w9
	add	w8, w8, #14
	str	w9, [x21, w11, uxtw #2]
	lsr	w9, w8, #3
	sub	w9, w9, #2
	str	w9, [x21, #12]
	add	x0, x8, x20
	bl	_cpu_to_le32
	str	w0, [x21, #32]
	mov	x0, x19
	bl	_adma_fill_sg
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_wmb
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh23
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENTER\n"

	.comm	_ATA_PROT_DMA,8,3               ; @ATA_PROT_DMA
	.comm	_cVLD,4,2                       ; @cVLD
	.comm	_cDAT,4,2                       ; @cDAT
	.comm	_cIEN,4,2                       ; @cIEN
	.comm	_ADMA_REGS_DEVICE,4,2           ; @ADMA_REGS_DEVICE
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_ADMA_REGS_SECTOR_COUNT,4,2     ; @ADMA_REGS_SECTOR_COUNT
	.comm	_ADMA_REGS_LBA_LOW,4,2          ; @ADMA_REGS_LBA_LOW
	.comm	_ADMA_REGS_LBA_MID,4,2          ; @ADMA_REGS_LBA_MID
	.comm	_ADMA_REGS_LBA_HIGH,4,2         ; @ADMA_REGS_LBA_HIGH
	.comm	_ADMA_REGS_CONTROL,4,2          ; @ADMA_REGS_CONTROL
	.comm	_rIGN,4,2                       ; @rIGN
	.comm	_ADMA_REGS_COMMAND,4,2          ; @ADMA_REGS_COMMAND
	.comm	_rEND,4,2                       ; @rEND
	.no_dead_strip	_adma_qc_prep
.subsections_via_symbols
