	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_sata_dmasetprd
_fsl_sata_dmasetprd:                    ## @fsl_sata_dmasetprd
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.16:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	callq	_device_printf
	movq	_FSL_SATA_ERR_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fsl_sata_end_transaction       ## TAILCALL
LBB0_1:
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	_FSL_SATA_SG_ENTRIES@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%edx, (%rax)
	setg	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_FSL_SATA_CTP
	movq	(%rax), %rcx
	testl	%r15d, %r15d
	jle	LBB0_2
## %bb.3:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r15d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_FSL_SATA_PRD_MAX_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r12d, %r12d
                                        ## implicit-def: $edi
	xorl	%r13d, %r13d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_FSL_SATA_CTP_BUS
	movl	%eax, %ebx
	leal	1(%r13), %r14d
	movl	%r14d, %edi
	callq	_FSL_SATA_PRD_OFFSET
	addl	%eax, %ebx
	movl	%ebx, %edi
	callq	_htole32
	movslq	%r13d, %rcx
	shlq	$4, %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %r15
	movq	%rax, 8(%rdx,%rcx)
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%r14d, %r13d
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx,%r12,8), %edi
	movl	$4, %esi
	callq	_roundup2
	movl	%eax, %r14d
	movl	4(%rbx,%r12,8), %edi
	callq	_htole32
	movslq	%r13d, %r13
	movq	%r13, %rbx
	shlq	$4, %rbx
	movq	%rax, 8(%r15,%rbx)
	movq	_FSL_SATA_PRD_SNOOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%r14d, %edi
	callq	_htole32
	movq	%rax, (%r15,%rbx)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addl	%r14d, (%rbx)
	movq	_FSL_SATA_PRD_MAX_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	movl	$0, %ecx
	cmovlel	%ecx, %r14d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	addl	%r14d, %edi
	incq	%r12
	incl	%r13d
	cmpq	%r12, -80(%rbp)                 ## 8-byte Folded Reload
	movq	%r15, %rcx
	je	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_FSL_SATA_PRD_EXT_INDEX@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r13d
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rcx, %r15
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_9
LBB0_2:
	movq	_FSL_SATA_PRD_MAX_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r13d, %r13d
                                        ## implicit-def: $edi
LBB0_10:
	movl	%r13d, 16(%rbx)
	cmpl	%eax, %r13d
	jle	LBB0_12
## %bb.11:
	movq	_FSL_SATA_PRD_SNOOP@GOTPCREL(%rip), %rax
	movq	%rcx, %r14
	movq	_FSL_SATA_PRD_EXT@GOTPCREL(%rip), %rcx
	orl	(%rax), %edi
	orl	(%rcx), %edi
	callq	_htole32
	movq	_FSL_SATA_PRD_EXT_INDEX@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$4, %rcx
	movq	%rax, (%r14,%rcx)
LBB0_12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	20(%rbx), %esi
	movq	8(%rbx), %rax
	movq	_CAM_DIR_IN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	jne	LBB0_13
## %bb.14:
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_13:
	movq	_BUS_DMASYNC_PREREAD@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %edx
	callq	_bus_dmamap_sync
	movq	%rbx, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fsl_sata_execute_transaction   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA load error %d\n"

	.comm	_FSL_SATA_ERR_INVALID,4,2       ## @FSL_SATA_ERR_INVALID
	.comm	_FSL_SATA_SG_ENTRIES,4,2        ## @FSL_SATA_SG_ENTRIES
L_.str.1:                               ## @.str.1
	.asciz	"too many DMA segment entries\n"

	.comm	_FSL_SATA_PRD_EXT_INDEX,4,2     ## @FSL_SATA_PRD_EXT_INDEX
	.comm	_FSL_SATA_PRD_MAX_DIRECT,4,2    ## @FSL_SATA_PRD_MAX_DIRECT
	.comm	_FSL_SATA_PRD_SNOOP,4,2         ## @FSL_SATA_PRD_SNOOP
	.comm	_FSL_SATA_PRD_EXT,4,2           ## @FSL_SATA_PRD_EXT
	.comm	_CAM_DIR_IN,4,2                 ## @CAM_DIR_IN
	.comm	_BUS_DMASYNC_PREREAD,4,2        ## @BUS_DMASYNC_PREREAD
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.no_dead_strip	_fsl_sata_dmasetprd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_sata_dmasetprd
_fsl_sata_dmasetprd:                    ; @fsl_sata_dmasetprd
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x20, [x0, #24]
	cbz	w3, LBB0_2
; %bb.1:
	ldr	w0, [x20, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x3
	bl	_device_printf
Lloh2:
	adrp	x8, _FSL_SATA_ERR_INVALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FSL_SATA_ERR_INVALID@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_fsl_sata_end_transaction
LBB0_2:
	mov	x21, x2
	mov	x22, x1
Lloh5:
	adrp	x8, _FSL_SATA_SG_ENTRIES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FSL_SATA_SG_ENTRIES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w2
	cset	w0, gt
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	mov	x0, x20
	mov	x1, x19
	bl	_FSL_SATA_CTP
	ldr	x24, [x0]
	cmp	w21, #0
	b.le	LBB0_7
; %bb.3:
	mov	w27, #0
	mov	w28, w21
Lloh10:
	adrp	x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	add	x26, x22, #4
                                        ; implicit-def: $w25
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldur	w0, [x26, #-4]
	mov	w1, #4
	bl	_roundup2
	mov	x22, x0
	ldr	w0, [x26], #8
	bl	_htole32
	add	x23, x24, w27, sxtw #4
	str	x0, [x23, #8]
Lloh13:
	adrp	x8, _FSL_SATA_PRD_SNOOP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FSL_SATA_PRD_SNOOP@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w0, w8, w22
	bl	_htole32
	ldr	w8, [x19]
	add	w8, w8, w22
	str	w8, [x19]
Lloh16:
	adrp	x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w27, w8
	csel	w9, w22, wzr, gt
	str	x0, [x23]
	add	w25, w9, w25
	add	w27, w27, #1
	subs	x28, x28, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
Lloh19:
	adrp	x9, _FSL_SATA_PRD_EXT_INDEX@GOTPAGE
Lloh20:
	ldr	x9, [x9, _FSL_SATA_PRD_EXT_INDEX@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w27, w9
	ccmp	w8, w21, #0, eq
	b.ge	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_FSL_SATA_CTP_BUS
	mov	x22, x0
	add	w23, w27, #1
	mov	x0, x23
	bl	_FSL_SATA_PRD_OFFSET
	add	w0, w0, w22
	bl	_htole32
	mov	w25, #0
	add	x8, x24, w27, sxtw #4
	str	x0, [x8, #8]
	mov	x27, x23
	b	LBB0_4
LBB0_7:
	mov	w27, #0
Lloh22:
	adrp	x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FSL_SATA_PRD_MAX_DIRECT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
                                        ; implicit-def: $w25
LBB0_8:
	str	w27, [x19, #16]
	cmp	w27, w8
	b.le	LBB0_10
; %bb.9:
Lloh25:
	adrp	x8, _FSL_SATA_PRD_SNOOP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FSL_SATA_PRD_SNOOP@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _FSL_SATA_PRD_EXT@GOTPAGE
Lloh29:
	ldr	x9, [x9, _FSL_SATA_PRD_EXT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w25
	orr	w0, w8, w9
	bl	_htole32
Lloh31:
	adrp	x8, _FSL_SATA_PRD_EXT_INDEX@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FSL_SATA_PRD_EXT_INDEX@GOTPAGEOFF]
Lloh33:
	ldrsw	x8, [x8]
	lsl	x8, x8, #4
	str	x0, [x24, x8]
LBB0_10:
	ldr	w0, [x20]
	ldr	w1, [x19, #20]
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _CAM_DIR_IN@GOTPAGE
Lloh35:
	ldr	x9, [x9, _CAM_DIR_IN@GOTPAGEOFF]
Lloh36:
	adrp	x10, _BUS_DMASYNC_PREREAD@GOTPAGE
Lloh37:
	ldr	x10, [x10, _BUS_DMASYNC_PREREAD@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
Lloh39:
	adrp	x11, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh40:
	ldr	x11, [x11, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w2, [x8]
	bl	_bus_dmamap_sync
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_fsl_sata_execute_transaction
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA load error %d\n"

	.comm	_FSL_SATA_ERR_INVALID,4,2       ; @FSL_SATA_ERR_INVALID
	.comm	_FSL_SATA_SG_ENTRIES,4,2        ; @FSL_SATA_SG_ENTRIES
l_.str.1:                               ; @.str.1
	.asciz	"too many DMA segment entries\n"

	.comm	_FSL_SATA_PRD_EXT_INDEX,4,2     ; @FSL_SATA_PRD_EXT_INDEX
	.comm	_FSL_SATA_PRD_MAX_DIRECT,4,2    ; @FSL_SATA_PRD_MAX_DIRECT
	.comm	_FSL_SATA_PRD_SNOOP,4,2         ; @FSL_SATA_PRD_SNOOP
	.comm	_FSL_SATA_PRD_EXT,4,2           ; @FSL_SATA_PRD_EXT
	.comm	_CAM_DIR_IN,4,2                 ; @CAM_DIR_IN
	.comm	_BUS_DMASYNC_PREREAD,4,2        ; @BUS_DMASYNC_PREREAD
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.no_dead_strip	_fsl_sata_dmasetprd
.subsections_via_symbols
