	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sata_oxnas_qc_prep
_sata_oxnas_qc_prep:                    ## @sata_oxnas_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, %rbx
	movq	8(%rdi), %rdi
	movl	(%rdi), %r14d
	callq	_sata_oxnas_check_link
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_ata_port_err
	movq	_AC_ERR_ATA_BUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 20(%rbx)
	movq	%rbx, %rdi
	callq	_ata_qc_complete
LBB0_2:
	movq	8(%rbx), %rax
	movl	16(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sata_oxnas_reset_ucode
	movl	16(%rbx), %edi
	callq	_ata_is_dma
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movl	16(%rbx), %edi
	callq	_ata_is_pio
	testq	%rax, %rax
	je	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	callq	_ata_bmdma_qc_prep
	movq	8(%rbx), %rax
	movq	8(%rax), %r15
	movl	16(%r15), %edi
	movq	_SGDMA_REQUESTPTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_iowrite32
	testl	%r14d, %r14d
	movq	_SGDMA_REQCTL1IN@GOTPCREL(%rip), %rax
	cmoveq	_SGDMA_REQCTL0IN@GOTPCREL(%rip), %rax
	movq	_SGDMA_REQCTL1OUT@GOTPCREL(%rip), %rcx
	cmoveq	_SGDMA_REQCTL0OUT@GOTPCREL(%rip), %rcx
	movq	(%rbx), %rdx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	cmoveq	%rax, %rcx
	movl	(%rcx), %eax
	movq	8(%r15), %rcx
	movl	%eax, 12(%rcx)
	movq	_SGDMA_REQQUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rcx)
	movq	8(%rbx), %rax
	movl	4(%rax), %eax
	movl	%eax, 4(%rcx)
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	_SGDMA_CONTROL_NOGO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SGDMA_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iowrite32                      ## TAILCALL
LBB0_4:
	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	"port %d not connected completing with error\n"

	.comm	_AC_ERR_ATA_BUS,4,2             ## @AC_ERR_ATA_BUS
	.comm	_SGDMA_REQUESTPTR,8,3           ## @SGDMA_REQUESTPTR
	.comm	_DMA_FROM_DEVICE,8,3            ## @DMA_FROM_DEVICE
	.comm	_SGDMA_REQCTL0IN,4,2            ## @SGDMA_REQCTL0IN
	.comm	_SGDMA_REQCTL0OUT,4,2           ## @SGDMA_REQCTL0OUT
	.comm	_SGDMA_REQCTL1IN,4,2            ## @SGDMA_REQCTL1IN
	.comm	_SGDMA_REQCTL1OUT,4,2           ## @SGDMA_REQCTL1OUT
	.comm	_SGDMA_REQQUAL,4,2              ## @SGDMA_REQQUAL
	.comm	_SGDMA_CONTROL_NOGO,4,2         ## @SGDMA_CONTROL_NOGO
	.comm	_SGDMA_CONTROL,8,3              ## @SGDMA_CONTROL
	.no_dead_strip	_sata_oxnas_qc_prep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sata_oxnas_qc_prep
_sata_oxnas_qc_prep:                    ; @sata_oxnas_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	x0, [x0, #8]
	ldr	w20, [x0]
	bl	_sata_oxnas_check_link
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_ata_port_err
Lloh2:
	adrp	x8, _AC_ERR_ATA_BUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AC_ERR_ATA_BUS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x19, #20]
	orr	w8, w9, w8
	str	w8, [x19, #20]
	mov	x0, x19
	bl	_ata_qc_complete
LBB0_2:
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #16]
	mov	w1, #0
	mov	w2, #0
	bl	_sata_oxnas_reset_ucode
	ldr	w0, [x19, #16]
	bl	_ata_is_dma
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x19, #16]
	bl	_ata_is_pio
	cbz	x0, LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_ata_bmdma_qc_prep
	ldr	x8, [x19, #8]
	ldr	x21, [x8, #8]
	ldr	w0, [x21, #16]
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _SGDMA_REQUESTPTR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SGDMA_REQUESTPTR@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
Lloh8:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh10:
	adrp	x9, _SGDMA_REQCTL0IN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SGDMA_REQCTL0IN@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x10, _SGDMA_REQCTL1IN@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SGDMA_REQCTL1IN@GOTPAGEOFF]
	cmp	w20, #0
Lloh15:
	adrp	x11, _SGDMA_REQCTL0OUT@GOTPAGE
Lloh16:
	ldr	x11, [x11, _SGDMA_REQCTL0OUT@GOTPAGEOFF]
	csel	x9, x9, x10, eq
Lloh17:
	adrp	x10, _SGDMA_REQCTL1OUT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _SGDMA_REQCTL1OUT@GOTPAGEOFF]
	csel	x10, x11, x10, eq
	ldp	x11, x12, [x19]
	cmp	x11, x8
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	ldr	x9, [x21, #8]
Lloh19:
	adrp	x10, _SGDMA_REQQUAL@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SGDMA_REQQUAL@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #8]
	ldr	w8, [x12, #4]
	stp	w8, w8, [x9]
	bl	_smp_wmb
Lloh22:
	adrp	x8, _SGDMA_CONTROL_NOGO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SGDMA_CONTROL_NOGO@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x8, [x21]
Lloh25:
	adrp	x9, _SGDMA_CONTROL@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SGDMA_CONTROL@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	add	x1, x9, x8
	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	_iowrite32
LBB0_5:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port %d not connected completing with error\n"

	.comm	_AC_ERR_ATA_BUS,4,2             ; @AC_ERR_ATA_BUS
	.comm	_SGDMA_REQUESTPTR,8,3           ; @SGDMA_REQUESTPTR
	.comm	_DMA_FROM_DEVICE,8,3            ; @DMA_FROM_DEVICE
	.comm	_SGDMA_REQCTL0IN,4,2            ; @SGDMA_REQCTL0IN
	.comm	_SGDMA_REQCTL0OUT,4,2           ; @SGDMA_REQCTL0OUT
	.comm	_SGDMA_REQCTL1IN,4,2            ; @SGDMA_REQCTL1IN
	.comm	_SGDMA_REQCTL1OUT,4,2           ; @SGDMA_REQCTL1OUT
	.comm	_SGDMA_REQQUAL,4,2              ; @SGDMA_REQQUAL
	.comm	_SGDMA_CONTROL_NOGO,4,2         ; @SGDMA_CONTROL_NOGO
	.comm	_SGDMA_CONTROL,8,3              ; @SGDMA_CONTROL
	.no_dead_strip	_sata_oxnas_qc_prep
.subsections_via_symbols
