	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_ring_rx_refill
_ag71xx_ring_rx_refill:                 ## @ag71xx_ring_rx_refill
	.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	%rdi, %r14
	movl	32(%rdi), %edi
	callq	_BIT
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_ag71xx_buffer_offset
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movslq	16(%r14), %r12
	xorl	%ebx, %ebx
	cmpq	%r12, 8(%r14)
	jle	LBB0_5
## %bb.1:
	leaq	8(%r14), %r13
	decl	-44(%rbp)                       ## 4-byte Folded Spill
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_DESC_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	incl	%ebx
	movslq	16(%r14), %r12
	incq	%r12
	movl	%r12d, 16(%r14)
	cmpq	%r12, 8(%r14)
	jle	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	andl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_ag71xx_ring_desc
	movq	%rax, %r15
	movq	24(%r14), %rax
	cmpl	$0, (%rax,%r12,4)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%r12,4), %rsi
	movq	_napi_alloc_frag@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_ag71xx_fill_rx_buf
	testl	%eax, %eax
	jne	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	callq	_wmb
	movq	(%r14), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_DBG
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_napi_alloc_frag,4,2            ## @napi_alloc_frag
	.comm	_DESC_EMPTY,4,2                 ## @DESC_EMPTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %u rx descriptors refilled\n"

	.no_dead_strip	_ag71xx_ring_rx_refill
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_ring_rx_refill
_ag71xx_ring_rx_refill:                 ; @ag71xx_ring_rx_refill
	.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	w0, [x0, #32]
	bl	_BIT
	mov	x23, x0
	mov	x0, x19
	bl	_ag71xx_buffer_offset
	mov	x22, x19
	ldr	x9, [x22, #8]!
	ldrsw	x8, [x22, #8]
	cmp	x9, x8
	b.le	LBB0_5
; %bb.1:
	mov	x21, x0
	mov	w20, #0
	sub	w25, w23, #1
Lloh0:
	adrp	x26, _napi_alloc_frag@GOTPAGE
Lloh1:
	ldr	x26, [x26, _napi_alloc_frag@GOTPAGEOFF]
Lloh2:
	adrp	x27, _DESC_EMPTY@GOTPAGE
Lloh3:
	ldr	x27, [x27, _DESC_EMPTY@GOTPAGEOFF]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x27]
	str	w8, [x23]
	add	w20, w20, #1
	ldrsw	x8, [x19, #16]
	add	x8, x8, #1
	str	w8, [x19, #16]
	ldr	x9, [x19, #8]
	cmp	x9, x8
	b.le	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	and	w24, w8, w25
	mov	x0, x22
	mov	x1, x24
	bl	_ag71xx_ring_desc
	mov	x23, x0
	ldr	x8, [x19, #24]
	add	x1, x8, w24, uxtw #2
	ldr	w8, [x1]
	cbnz	w8, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w3, [x26]
	mov	x0, x19
	mov	x2, x21
	bl	_ag71xx_fill_rx_buf
	cbnz	w0, LBB0_2
	b	LBB0_6
LBB0_5:
	mov	w20, #0
LBB0_6:
	bl	_wmb
	ldr	x8, [x19]
	ldr	w1, [x8]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_DBG
	mov	x0, x20
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_napi_alloc_frag,4,2            ; @napi_alloc_frag
	.comm	_DESC_EMPTY,4,2                 ; @DESC_EMPTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %u rx descriptors refilled\n"

	.no_dead_strip	_ag71xx_ring_rx_refill
.subsections_via_symbols
