	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_ring_rx_init
_ag71xx_ring_rx_init:                   ## @ag71xx_ring_rx_init
	.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, %r15
	movq	_AG71XX_RX_RING_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%rbx), %r13
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %edi
	imull	(%r15), %edi
	addq	24(%r15), %rdi
	callq	_virt_to_phys
	movq	16(%r15), %rcx
	movq	(%rcx,%rbx,8), %rsi
	movq	%rax, 16(%rsi)
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_DBG
	movl	(%r12), %ecx
	movq	%r13, %rbx
	cmpq	%rcx, %r13
	jb	LBB0_2
## %bb.3:
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	movq	_NetRxPackets@GOTPCREL(%rip), %r14
	movq	_DESC_EMPTY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_virt_to_phys
	movq	16(%r15), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rax, 8(%rcx)
	movl	(%r13), %eax
	movl	%eax, (%rcx)
	incq	%rbx
	movl	(%r12), %eax
	cmpq	%rax, %rbx
	jb	LBB0_5
LBB0_6:
	movq	$0, 8(%r15)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_RX_RING_SIZE,4,2        ## @AG71XX_RX_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ag71xx: RX desc at %p, next is %08x\n"

	.comm	_NetRxPackets,8,3               ## @NetRxPackets
	.comm	_DESC_EMPTY,4,2                 ## @DESC_EMPTY
	.no_dead_strip	_ag71xx_ring_rx_init
.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_init
_ag71xx_ring_rx_init:                   ; @ag71xx_ring_rx_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _AG71XX_RX_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AG71XX_RX_RING_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x22, #0
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #24]
	ldr	w10, [x19]
	add	x23, x22, #1
	udiv	w11, w23, w8
	msub	w8, w11, w8, w23
	mul	w8, w8, w10
	add	x0, x9, x8
	bl	_virt_to_phys
	mov	x2, x0
	ldr	x8, [x19, #16]
	ldr	x1, [x8, x22, lsl #3]
	str	x0, [x1, #16]
	mov	x0, x20
	bl	_DBG
	ldr	w8, [x21]
	mov	x22, x23
	cmp	x23, x8
	b.lo	LBB0_2
; %bb.3:
	cbz	w8, LBB0_6
; %bb.4:
	mov	x20, #0
Lloh4:
	adrp	x22, _NetRxPackets@GOTPAGE
Lloh5:
	ldr	x22, [x22, _NetRxPackets@GOTPAGEOFF]
Lloh6:
	adrp	x23, _DESC_EMPTY@GOTPAGE
Lloh7:
	ldr	x23, [x23, _DESC_EMPTY@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	lsl	x24, x20, #3
	ldr	x0, [x8, x24]
	bl	_virt_to_phys
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x24]
	str	x0, [x8, #8]
	ldr	w9, [x23]
	str	w9, [x8]
	add	x20, x20, #1
	ldr	w8, [x21]
	cmp	x20, x8
	b.lo	LBB0_5
LBB0_6:
	str	xzr, [x19, #8]
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_RX_RING_SIZE,4,2        ; @AG71XX_RX_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ag71xx: RX desc at %p, next is %08x\n"

	.comm	_NetRxPackets,8,3               ; @NetRxPackets
	.comm	_DESC_EMPTY,4,2                 ; @DESC_EMPTY
	.no_dead_strip	_ag71xx_ring_rx_init
.subsections_via_symbols
