	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_sata_begin_transaction
_fsl_sata_begin_transaction:            ## @fsl_sata_begin_transaction
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	20(%rsi), %edi
	movq	_CAM_DEBUG_TRACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rdx
	callq	_CAM_DEBUG
	movq	_FSL_SATA_MAX_SLOTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r14), %rax
	movq	_XPT_ATA_IO@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	jne	LBB0_3
## %bb.1:
	movq	_CAM_ATAIO_FPDMA@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	80(%r15), %rax
	movq	8(%r14), %rcx
	movl	(%rax,%rcx,4), %edx
LBB0_3:
	movl	(%r15), %ecx
	movl	4(%r15), %eax
	incl	%ecx
	cmpl	%edx, %ecx
	jge	LBB0_6
## %bb.4:
	movl	%eax, %esi
	sarl	%cl, %esi
	cmpl	$-1, %esi
	je	LBB0_6
## %bb.5:
	notl	%esi
	bsfl	%esi, %esi
	addl	%esi, %ecx
	cmpl	%edx, %ecx
	jl	LBB0_7
LBB0_6:
	movl	%eax, %ecx
	notl	%ecx
	bsfl	%ecx, %ecx
	cmpl	$-1, %eax
	cmovel	%eax, %ecx
LBB0_7:
	movl	%ecx, (%r15)
	movq	72(%r15), %r13
	movslq	%ecx, %rbx
	leaq	(%rbx,%rbx,4), %r12
	movq	%r14, 32(%r13,%r12,8)
	movq	$0, 24(%r13,%r12,8)
	movq	8(%r15), %rsi
	testq	%rsi, %rsi
	jne	LBB0_11
## %bb.8:
	cmpl	$4, 16(%r15)
	jl	LBB0_9
## %bb.10:
	leaq	64(%r15), %rdi
	callq	_callout_stop
	movq	_XPT_ATA_IO@GOTPCREL(%rip), %rdi
	movl	4(%r15), %eax
	movq	8(%r15), %rsi
	jmp	LBB0_11
LBB0_9:
	xorl	%esi, %esi
LBB0_11:
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	btsl	%ebx, %eax
	movl	%eax, 4(%r15)
	incq	%rsi
	movq	%rsi, 8(%r15)
	movq	56(%r15), %rax
	movq	8(%r14), %rcx
	incl	(%rax,%rcx,4)
	movq	(%r14), %rax
	movq	(%rdi), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_14
## %bb.12:
	movq	_CAM_ATAIO_FPDMA@GOTPCREL(%rip), %rsi
	testl	%eax, (%rsi)
	je	LBB0_14
## %bb.13:
	incl	48(%r15)
	movq	40(%r15), %rax
	movq	8(%r14), %rsi
	incl	(%rax,%rsi,4)
	movq	8(%r14), %rax
	movq	%rax, 24(%r15)
	movq	(%r14), %rax
LBB0_14:
	cmpq	%rcx, %rax
	jne	LBB0_17
## %bb.15:
	movq	_CAM_ATAIO_CONTROL@GOTPCREL(%rip), %rcx
	movq	_CAM_ATAIO_NEEDRESULT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rcx), %esi
	testl	%eax, %esi
	je	LBB0_17
## %bb.16:
	orl	%edx, 32(%r15)
LBB0_17:
	movq	_CAM_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%r14), %eax
	leaq	(,%r12,8), %r8
	addq	%r13, %r8
	movq	_CAM_DIR_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_18
## %bb.19:
	movq	$0, (%r8)
	movq	%r8, %rdi
	callq	_fsl_sata_execute_transaction
	jmp	LBB0_20
LBB0_18:
	movq	_FSL_SATA_SLOT_LOADING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13,%r12,8)
	movl	36(%r15), %edi
	movl	8(%r13,%r12,8), %esi
	movq	_fsl_sata_dmasetprd@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdx
	xorl	%r9d, %r9d
	callq	_bus_dmamap_load_ccb
LBB0_20:
	movl	20(%r14), %edi
	movq	_CAM_DEBUG_TRACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_CAM_DEBUG                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CAM_DEBUG_TRACE,4,2            ## @CAM_DEBUG_TRACE
	.comm	_FSL_SATA_MAX_SLOTS,4,2         ## @FSL_SATA_MAX_SLOTS
	.comm	_XPT_ATA_IO,8,3                 ## @XPT_ATA_IO
	.comm	_CAM_ATAIO_FPDMA,4,2            ## @CAM_ATAIO_FPDMA
	.comm	_CAM_ATAIO_CONTROL,4,2          ## @CAM_ATAIO_CONTROL
	.comm	_CAM_ATAIO_NEEDRESULT,4,2       ## @CAM_ATAIO_NEEDRESULT
	.comm	_CAM_DIR_MASK,4,2               ## @CAM_DIR_MASK
	.comm	_CAM_DIR_NONE,4,2               ## @CAM_DIR_NONE
	.comm	_FSL_SATA_SLOT_LOADING,4,2      ## @FSL_SATA_SLOT_LOADING
	.comm	_fsl_sata_dmasetprd,4,2         ## @fsl_sata_dmasetprd
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"fsl_sata_begin_transaction exit\n"

	.no_dead_strip	_fsl_sata_begin_transaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_sata_begin_transaction
_fsl_sata_begin_transaction:            ; @fsl_sata_begin_transaction
	.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, x1
	mov	x20, x0
	ldr	w0, [x1, #20]
Lloh0:
	adrp	x22, _CAM_DEBUG_TRACE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CAM_DEBUG_TRACE@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x2, [x19]
	bl	_CAM_DEBUG
Lloh2:
	adrp	x8, _FSL_SATA_MAX_SLOTS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FSL_SATA_MAX_SLOTS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x19]
Lloh5:
	adrp	x26, _XPT_ATA_IO@GOTPAGE
Lloh6:
	ldr	x26, [x26, _XPT_ATA_IO@GOTPAGEOFF]
	ldr	x10, [x26]
Lloh7:
	adrp	x25, _CAM_ATAIO_FPDMA@GOTPAGE
Lloh8:
	ldr	x25, [x25, _CAM_ATAIO_FPDMA@GOTPAGEOFF]
	cmp	x9, x10
	b.ne	LBB0_3
; %bb.1:
	ldr	w10, [x25]
	tst	w10, w9
	b.eq	LBB0_3
; %bb.2:
	ldr	x8, [x20, #80]
	ldr	x9, [x19, #8]
	ldr	w8, [x8, x9, lsl #2]
LBB0_3:
	ldp	w10, w9, [x20]
	add	w10, w10, #1
	mvn	w11, w9
	rbit	w11, w11
	clz	w11, w11
	cmn	w9, #1
	csinv	w11, w11, wzr, ne
	cmp	w10, w8
	asr	w12, w9, w10
	mvn	w13, w12
	rbit	w13, w13
	clz	w13, w13
	add	w10, w10, w13
	ccmn	w12, #1, #4, lt
	ccmp	w10, w8, #0, ne
	csel	w8, w10, w11, lt
	str	w8, [x20]
	ldr	x23, [x20, #72]
	sxtw	x24, w8
	mov	w10, #40
	smaddl	x21, w8, w10, x23
	stp	xzr, x19, [x21, #24]
	ldr	x10, [x20, #8]
	cbnz	x10, LBB0_7
; %bb.4:
	ldr	w8, [x20, #16]
	cmp	w8, #4
	b.lt	LBB0_6
; %bb.5:
	add	x0, x20, #64
	bl	_callout_stop
	ldr	w9, [x20, #4]
	ldr	x10, [x20, #8]
	b	LBB0_7
LBB0_6:
	mov	x10, #0
LBB0_7:
	mov	w8, #1
	lsl	w8, w8, w24
	orr	w9, w9, w8
	str	w9, [x20, #4]
	add	x9, x10, #1
	str	x9, [x20, #8]
	ldr	x9, [x20, #56]
	ldr	x10, [x19, #8]
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	add	w11, w11, #1
	str	w11, [x9, x10]
	ldr	x10, [x19]
	ldr	x9, [x26]
	cmp	x10, x9
	b.ne	LBB0_10
; %bb.8:
	ldr	w11, [x25]
	tst	w11, w10
	b.eq	LBB0_10
; %bb.9:
	ldr	w10, [x20, #48]
	add	w10, w10, #1
	str	w10, [x20, #48]
	ldr	x10, [x20, #40]
	ldr	x11, [x19, #8]
	lsl	x11, x11, #2
	ldr	w12, [x10, x11]
	add	w12, w12, #1
	str	w12, [x10, x11]
	ldr	x10, [x19, #8]
	str	x10, [x20, #24]
	ldr	x10, [x19]
LBB0_10:
	cmp	x10, x9
	b.ne	LBB0_13
; %bb.11:
Lloh9:
	adrp	x9, _CAM_ATAIO_CONTROL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CAM_ATAIO_CONTROL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x11, _CAM_ATAIO_NEEDRESULT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CAM_ATAIO_NEEDRESULT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	orr	w9, w11, w9
	tst	w9, w10
	b.eq	LBB0_13
; %bb.12:
	ldr	w9, [x20, #32]
	orr	w8, w9, w8
	str	w8, [x20, #32]
LBB0_13:
	ldr	w8, [x19, #16]
Lloh15:
	adrp	x9, _CAM_DIR_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CAM_DIR_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh18:
	adrp	x9, _CAM_DIR_NONE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CAM_DIR_NONE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.14:
	str	xzr, [x21]
	mov	x0, x21
	bl	_fsl_sata_execute_transaction
	b	LBB0_16
LBB0_15:
Lloh21:
	adrp	x8, _FSL_SATA_SLOT_LOADING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _FSL_SATA_SLOT_LOADING@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	mov	w9, #40
	madd	x9, x24, x9, x23
	str	w8, [x9, #16]
	ldr	w0, [x20, #36]
	ldr	w1, [x9, #8]
Lloh24:
	adrp	x8, _fsl_sata_dmasetprd@GOTPAGE
Lloh25:
	ldr	x8, [x8, _fsl_sata_dmasetprd@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	x2, x19
	mov	x4, x21
	mov	w5, #0
	bl	_bus_dmamap_load_ccb
LBB0_16:
	ldr	w0, [x19, #20]
	ldr	w1, [x22]
Lloh27:
	adrp	x2, l_.str.1@PAGE
Lloh28:
	add	x2, x2, l_.str.1@PAGEOFF
	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	_CAM_DEBUG
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CAM_DEBUG_TRACE,4,2            ; @CAM_DEBUG_TRACE
	.comm	_FSL_SATA_MAX_SLOTS,4,2         ; @FSL_SATA_MAX_SLOTS
	.comm	_XPT_ATA_IO,8,3                 ; @XPT_ATA_IO
	.comm	_CAM_ATAIO_FPDMA,4,2            ; @CAM_ATAIO_FPDMA
	.comm	_CAM_ATAIO_CONTROL,4,2          ; @CAM_ATAIO_CONTROL
	.comm	_CAM_ATAIO_NEEDRESULT,4,2       ; @CAM_ATAIO_NEEDRESULT
	.comm	_CAM_DIR_MASK,4,2               ; @CAM_DIR_MASK
	.comm	_CAM_DIR_NONE,4,2               ; @CAM_DIR_NONE
	.comm	_FSL_SATA_SLOT_LOADING,4,2      ; @FSL_SATA_SLOT_LOADING
	.comm	_fsl_sata_dmasetprd,4,2         ; @fsl_sata_dmasetprd
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"fsl_sata_begin_transaction exit\n"

	.no_dead_strip	_fsl_sata_begin_transaction
.subsections_via_symbols
