	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_fill_dma_desc
_ag71xx_fill_dma_desc:                  ## @ag71xx_fill_dma_desc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_BIT
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r15d
	testl	%r15d, %r15d
	cmovel	%r13d, %r15d
	testl	%r13d, %r13d
	jle	LBB0_1
## %bb.2:
	decl	%eax
	leal	4(%r15), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	leal	-4(%r15), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	addl	%eax, %r14d
	orl	%eax, %edx
	orl	%edx, %ecx
	incl	%ebx
	movl	%ecx, 4(%r12)
	testl	%r13d, %r13d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	jle	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %esi
	addl	%ebx, %esi
	andl	%eax, %esi
	callq	_ag71xx_ring_desc
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_ag71xx_desc_empty
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmovgl	%r15d, %eax
	cmpl	%r15d, %r13d
	cmovbel	%r13d, %eax
	movl	%r14d, (%r12)
	subl	%eax, %r13d
	xorl	%edx, %edx
	movl	$0, %ecx
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_DESC_MORE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%ebx, %ebx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_DESC_EMPTY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_4:
	movl	$-1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DESC_MORE,4,2                  ## @DESC_MORE
	.comm	_DESC_EMPTY,4,2                 ## @DESC_EMPTY
	.no_dead_strip	_ag71xx_fill_dma_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_fill_dma_desc
_ag71xx_fill_dma_desc:                  ; @ag71xx_fill_dma_desc
	.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, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_BIT
	ldr	w8, [x21]
	cmp	w8, #0
	csel	w24, w19, w8, eq
	cmp	w19, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w22, #0
	sub	w25, w0, #1
	add	w26, w24, #4
	sub	w27, w24, #4
Lloh0:
	adrp	x28, _DESC_EMPTY@GOTPAGE
Lloh1:
	ldr	x28, [x28, _DESC_EMPTY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21, #4]
	add	w8, w22, w8
	and	w1, w8, w25
	mov	x0, x21
	bl	_ag71xx_ring_desc
	mov	x23, x0
	bl	_ag71xx_desc_empty
	cbz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w19, w26
	csel	w8, w24, w27, gt
	cmp	w19, w24
	csel	w8, w8, w19, hi
	str	w20, [x23]
	add	w20, w8, w20
	sub	w19, w19, w8
Lloh2:
	adrp	x9, _DESC_MORE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DESC_MORE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	ldr	w10, [x28]
	cmp	w22, #0
	csel	w10, w10, wzr, eq
	cmp	w19, #0
	csel	w9, w9, wzr, gt
	orr	w8, w9, w8
	orr	w8, w8, w10
	str	w8, [x23, #4]
	add	w22, w22, #1
	b.gt	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w22, #0
	b	LBB0_6
LBB0_5:
	mov	w22, #-1
LBB0_6:
	mov	x0, x22
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DESC_MORE,4,2                  ; @DESC_MORE
	.comm	_DESC_EMPTY,4,2                 ; @DESC_EMPTY
	.no_dead_strip	_ag71xx_fill_dma_desc
.subsections_via_symbols
