	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdc_tx_list_sg_add
_pdc_tx_list_sg_add:                    ## @pdc_tx_list_sg_add
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	%rsi, %rdi
	callq	_sg_nents
	movq	%rax, %r12
	movl	52(%r13), %edi
	movq	(%r13), %r14
	movq	8(%r13), %rsi
	movq	%r14, %rdx
	callq	_NTXDACTIVE
	subq	%rax, %r14
	xorl	%edi, %edi
	cmpq	%r14, %r12
	setg	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	incl	48(%r13)
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_2:
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	cmpq	%rax, %rcx
	jne	LBB0_3
## %bb.4:
	movq	24(%r13), %rax
	movq	$0, (%rax,%rcx,8)
	movq	8(%r13), %rax
	movq	40(%r13), %rcx
	movq	%r15, %rbx
	movq	%r15, (%rcx,%rax,8)
	movq	_D64_CTRL1_SOF@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_6
LBB0_7:
	movq	_PDC_DMA_BUF_MAX@GOTPCREL(%rip), %r15
	xorl	%ecx, %ecx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movslq	32(%r13), %rcx
	decq	%rcx
	xorl	%edi, %edi
	cmpq	%rcx, %rax
	sete	%dil
	callq	_unlikely
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_D64_CTRL1_EOT@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	callq	_sg_dma_len
	movq	%rax, %r14
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_sg_dma_address
	movl	%eax, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	incq	-64(%rbp)                       ## 8-byte Folded Spill
	addl	%r15d, %ebx
	movq	_PDC_DMA_BUF_MAX@GOTPCREL(%rip), %r15
LBB0_11:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15), %rdx
	cmpq	%rdx, %r14
	jle	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	orq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r13, %rcx
	callq	_pdc_build_txd
	movq	(%r15), %r15
	subq	%r15, %r14
	movslq	32(%r12), %rax
	decq	%rax
	xorl	%edi, %edi
	cmpq	%rax, 8(%r12)
	sete	%dil
	callq	_unlikely
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_D64_CTRL1_EOT@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_next
	movq	%rax, %rcx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_D64_CTRL1_IOC@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_D64_CTRL1_EOF@GOTPCREL(%rip), %rax
	orq	(%rax), %r15
	testq	%rcx, %rcx
	movl	$0, %eax
	cmovneq	%rax, %r15
	orq	-48(%rbp), %r15                 ## 8-byte Folded Reload
	orq	%r15, %r13
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, %r12
	movl	%ebx, %esi
	movq	%r14, %rdx
	movq	%r13, %rcx
	callq	_pdc_build_txd
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	incq	%rdx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %rbx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	_D64_CTRL1_SOF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	%rax, %r15
	movq	8(%r12), %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %r13
	movq	_PDC_DMA_BUF_MAX@GOTPCREL(%rip), %r15
	jmp	LBB0_8
LBB0_16:
	movq	%r12, %r13
	jmp	LBB0_17
LBB0_3:
	xorl	%ecx, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rbx
	testq	%rbx, %rbx
	jne	LBB0_7
LBB0_6:
	xorl	%edx, %edx
LBB0_17:
	movq	16(%r13), %rax
	movq	24(%r13), %rcx
	addq	%rdx, (%rcx,%rax,8)
	movq	_PDC_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_D64_CTRL1_SOF,8,3              ## @D64_CTRL1_SOF
	.comm	_D64_CTRL1_EOT,8,3              ## @D64_CTRL1_EOT
	.comm	_PDC_DMA_BUF_MAX,8,3            ## @PDC_DMA_BUF_MAX
	.comm	_D64_CTRL1_EOF,8,3              ## @D64_CTRL1_EOF
	.comm	_D64_CTRL1_IOC,8,3              ## @D64_CTRL1_IOC
	.comm	_PDC_SUCCESS,4,2                ## @PDC_SUCCESS
	.no_dead_strip	_pdc_tx_list_sg_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdc_tx_list_sg_add
_pdc_tx_list_sg_add:                    ; @pdc_tx_list_sg_add
	.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	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_sg_nents
	mov	x21, x0
	ldr	w0, [x19, #52]
	ldp	x22, x1, [x19]
	mov	x2, x22
	bl	_NTXDACTIVE
	sub	x8, x22, x0
	cmp	x21, x8
	cset	w0, gt
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #48]
	add	w8, w8, #1
	str	w8, [x19, #48]
Lloh0:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_2:
	ldp	x8, x9, [x19, #8]
Lloh3:
	adrp	x10, _D64_CTRL1_SOF@GOTPAGE
Lloh4:
	ldr	x10, [x10, _D64_CTRL1_SOF@GOTPAGEOFF]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x19, #24]
	str	xzr, [x8, x9, lsl #3]
	ldr	x9, [x19, #40]
	ldr	x8, [x19, #8]
	str	x20, [x9, x8, lsl #3]
	ldr	x28, [x10]
	mov	x24, #0
	cbnz	x20, LBB0_5
	b	LBB0_11
LBB0_4:
	mov	x28, #0
	mov	x24, #0
	cbz	x20, LBB0_11
LBB0_5:
Lloh5:
	adrp	x25, _D64_CTRL1_EOT@GOTPAGE
Lloh6:
	ldr	x25, [x25, _D64_CTRL1_EOT@GOTPAGEOFF]
Lloh7:
	adrp	x26, _PDC_DMA_BUF_MAX@GOTPAGE
Lloh8:
	ldr	x26, [x26, _PDC_DMA_BUF_MAX@GOTPAGEOFF]
Lloh9:
	adrp	x23, _D64_CTRL1_IOC@GOTPAGE
Lloh10:
	ldr	x23, [x23, _D64_CTRL1_IOC@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldrsw	x9, [x19, #32]
	sub	x9, x9, #1
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	ldr	x8, [x25]
	cmp	x0, #0
	csel	x27, xzr, x8, eq
	mov	x0, x20
	bl	_sg_dma_len
	mov	x21, x0
	mov	x0, x20
	bl	_sg_dma_address
	mov	x22, x0
LBB0_7:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x2, [x26]
	cmp	x21, x2
	b.le	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	orr	x3, x27, x28
	mov	x0, x19
	mov	x1, x22
	bl	_pdc_build_txd
	add	x24, x24, #1
	ldr	x8, [x26]
	sub	x21, x21, x8
	add	w22, w22, w8
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19, #32]
	sub	x9, x9, #1
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	ldr	x8, [x25]
	cmp	x0, #0
	csel	x27, xzr, x8, eq
	b	LBB0_7
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_sg_next
	mov	x20, x0
Lloh11:
	adrp	x8, _D64_CTRL1_EOF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _D64_CTRL1_EOF@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	x9, [x23]
	orr	x8, x9, x8
	cmp	x0, #0
	csel	x8, x8, xzr, eq
	orr	x28, x8, x28
	orr	x3, x28, x27
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_pdc_build_txd
	add	x24, x24, #1
	cbz	x20, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
Lloh14:
	adrp	x8, _D64_CTRL1_SOF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _D64_CTRL1_SOF@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	bic	x28, x28, x8
	ldr	x8, [x19, #8]
	b	LBB0_6
LBB0_11:
	ldp	x9, x8, [x19, #16]
	lsl	x9, x9, #3
	ldr	x10, [x8, x9]
	add	x10, x10, x24
	str	x10, [x8, x9]
Lloh17:
	adrp	x8, _PDC_SUCCESS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PDC_SUCCESS@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
LBB0_12:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_D64_CTRL1_SOF,8,3              ; @D64_CTRL1_SOF
	.comm	_D64_CTRL1_EOT,8,3              ; @D64_CTRL1_EOT
	.comm	_PDC_DMA_BUF_MAX,8,3            ; @PDC_DMA_BUF_MAX
	.comm	_D64_CTRL1_EOF,8,3              ; @D64_CTRL1_EOF
	.comm	_D64_CTRL1_IOC,8,3              ; @D64_CTRL1_IOC
	.comm	_PDC_SUCCESS,4,2                ; @PDC_SUCCESS
	.no_dead_strip	_pdc_tx_list_sg_add
.subsections_via_symbols
