	.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, %r12
	leaq	8(%rdi), %r14
	movl	40(%rdi), %edi
	callq	_BIT
	movl	%eax, %r15d
	movl	40(%r12), %edi
	callq	_BIT
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.1:
	movl	%eax, %r13d
	decl	%r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ag71xx_ring_desc
	incl	%ebx
	movl	%ebx, %edx
	andl	%r13d, %edx
	movq	_AG71XX_DESC_SIZE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %edx
	addq	32(%r12), %rdx
	movq	%rdx, 8(%rax)
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_DBG
	cmpl	%ebx, %r15d
	jne	LBB0_2
## %bb.3:
	movl	%r15d, %eax
	shlq	$2, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ag71xx_ring_desc
	movq	%rax, %r15
	movq	24(%r12), %rsi
	addq	%r13, %rsi
	movl	(%r12), %edx
	movq	_netdev_alloc_frag@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_ag71xx_fill_rx_buf
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_DESC_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	addq	$4, %r13
	incl	%ebx
	cmpq	%r13, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_4
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	xorl	%eax, %eax
	callq	_wmb
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_DESC_SIZE,4,2           ## @AG71XX_DESC_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ag71xx: RX desc at %p, next is %08x\n"

	.comm	_netdev_alloc_frag,4,2          ## @netdev_alloc_frag
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	add	x19, x0, #8
	ldr	w0, [x0, #40]
	bl	_BIT
	mov	x22, x0
	ldr	w0, [x20, #40]
	bl	_BIT
	cbz	w22, LBB0_6
; %bb.1:
	mov	w21, #0
	sub	w24, w0, #1
Lloh0:
	adrp	x25, _AG71XX_DESC_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AG71XX_DESC_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x23, l_.str@PAGE
Lloh3:
	add	x23, x23, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_ag71xx_ring_desc
	mov	x1, x0
	ldr	x8, [x20, #32]
	ldr	w9, [x25]
	add	w21, w21, #1
	and	w10, w21, w24
	mul	w9, w9, w10
	add	x2, x8, x9
	str	x2, [x1, #8]
	mov	x0, x23
	bl	_DBG
	cmp	w22, w21
	b.ne	LBB0_2
; %bb.3:
	mov	w21, #0
	mov	x23, #0
	mov	w8, w22
	lsl	x24, x8, #2
Lloh4:
	adrp	x25, _netdev_alloc_frag@GOTPAGE
Lloh5:
	ldr	x25, [x25, _netdev_alloc_frag@GOTPAGEOFF]
Lloh6:
	adrp	x26, _DESC_EMPTY@GOTPAGE
Lloh7:
	ldr	x26, [x26, _DESC_EMPTY@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_ag71xx_ring_desc
	mov	x22, x0
	ldr	x8, [x20, #24]
	add	x1, x8, x23
	ldr	w2, [x20]
	ldr	w3, [x25]
	mov	x0, x20
	bl	_ag71xx_fill_rx_buf
	cbz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	str	w8, [x22]
	add	x23, x23, #4
	add	w21, w21, #1
	cmp	x24, x23
	b.ne	LBB0_4
LBB0_6:
	mov	w20, #0
	b	LBB0_8
LBB0_7:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	bl	_wmb
	stp	xzr, xzr, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_DESC_SIZE,4,2           ; @AG71XX_DESC_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ag71xx: RX desc at %p, next is %08x\n"

	.comm	_netdev_alloc_frag,4,2          ; @netdev_alloc_frag
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DESC_EMPTY,4,2                 ; @DESC_EMPTY
	.no_dead_strip	_ag71xx_ring_rx_init
.subsections_via_symbols
