	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_recv
_ag71xx_recv:                           ## @ag71xx_recv
	.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, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r12
	movl	(%r12), %eax
	movq	_AG71XX_RX_RING_SIZE@GOTPCREL(%rip), %r14
	xorl	%edx, %edx
	divl	(%r14)
	movl	%edx, %r13d
	movq	8(%r12), %rax
	movq	(%rax,%r13,8), %rbx
	movq	%rbx, %rdi
	callq	_ag71xx_desc_empty
	testq	%rax, %rax
	je	LBB0_1
LBB0_5:
	movq	_AG71XX_REG_RX_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_ag71xx_rr
	movq	_RX_CTRL_RXE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	jne	LBB0_7
## %bb.6:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_ag71xx_wr
LBB0_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_NetRxPackets@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, (%r12)
	xorl	%edx, %edx
	divl	(%r14)
	movl	%edx, %r13d
	movq	(%rcx,%r13,8), %rbx
	movq	%rbx, %rdi
	callq	_ag71xx_desc_empty
	testq	%rax, %rax
	jne	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	%rbx, %rdi
	callq	_ag71xx_desc_pktlen
	movq	_ETH_FCS_LEN@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movq	(%r15), %rcx
	movq	(%rcx,%r13,8), %rdi
	movl	%eax, %esi
	callq	_NetReceive
	movq	(%r15), %rax
	movl	(%rax,%r13,8), %edi
	movq	_PKTSIZE_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_flush_cache
	movq	_DESC_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r12), %rcx
	movq	(%rcx,%r13,8), %rdx
	movl	%eax, (%rdx)
	movl	(%r12), %eax
	incl	%eax
	movl	%eax, (%r12)
	cmpl	(%r14), %eax
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_RX_RING_SIZE,4,2        ## @AG71XX_RX_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: rx packets, curr=%u\n"

	.comm	_ETH_FCS_LEN,8,3                ## @ETH_FCS_LEN
	.comm	_NetRxPackets,8,3               ## @NetRxPackets
	.comm	_PKTSIZE_ALIGN,4,2              ## @PKTSIZE_ALIGN
	.comm	_DESC_EMPTY,4,2                 ## @DESC_EMPTY
	.comm	_AG71XX_REG_RX_CTRL,4,2         ## @AG71XX_REG_RX_CTRL
	.comm	_RX_CTRL_RXE,4,2                ## @RX_CTRL_RXE
	.no_dead_strip	_ag71xx_recv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_recv
_ag71xx_recv:                           ; @ag71xx_recv
	.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, x0
	ldr	x19, [x0, #8]
	ldr	w8, [x19]
Lloh0:
	adrp	x23, _AG71XX_RX_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AG71XX_RX_RING_SIZE@GOTPAGEOFF]
	ldr	w9, [x23]
	udiv	w10, w8, w9
	msub	w28, w10, w9, w8
	ldr	x8, [x19, #8]
	ldr	x22, [x8, w28, uxtw #3]
	mov	x0, x22
	bl	_ag71xx_desc_empty
	cbnz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
Lloh4:
	adrp	x24, _ETH_FCS_LEN@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ETH_FCS_LEN@GOTPAGEOFF]
Lloh6:
	adrp	x25, _NetRxPackets@GOTPAGE
Lloh7:
	ldr	x25, [x25, _NetRxPackets@GOTPAGEOFF]
Lloh8:
	adrp	x26, _PKTSIZE_ALIGN@GOTPAGE
Lloh9:
	ldr	x26, [x26, _PKTSIZE_ALIGN@GOTPAGEOFF]
Lloh10:
	adrp	x27, _DESC_EMPTY@GOTPAGE
Lloh11:
	ldr	x27, [x27, _DESC_EMPTY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	ldr	w2, [x19]
	mov	x0, x21
	bl	_DBG
	mov	x0, x22
	bl	_ag71xx_desc_pktlen
	ldr	w8, [x24]
	sub	w1, w0, w8
	ldr	x8, [x25]
	lsl	x22, x28, #3
	ldr	x0, [x8, x22]
	bl	_NetReceive
	ldr	x8, [x25]
	ldr	w0, [x8, x22]
	ldr	w1, [x26]
	bl	_flush_cache
	ldr	w8, [x27]
	ldr	x9, [x19, #8]
	ldr	x10, [x9, x22]
	str	w8, [x10]
	ldr	w8, [x19]
	add	w10, w8, #1
	str	w10, [x19]
	ldr	w11, [x23]
	cmp	w10, w11
	csinc	w8, wzr, w8, hs
	str	w8, [x19]
	ldr	w10, [x23]
	udiv	w11, w8, w10
	msub	w28, w11, w10, w8
	ldr	x22, [x9, w28, uxtw #3]
	mov	x0, x22
	bl	_ag71xx_desc_empty
	cbz	x0, LBB0_2
LBB0_3:
Lloh12:
	adrp	x20, _AG71XX_REG_RX_CTRL@GOTPAGE
Lloh13:
	ldr	x20, [x20, _AG71XX_REG_RX_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ag71xx_rr
Lloh14:
	adrp	x8, _RX_CTRL_RXE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RX_CTRL_RXE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	tst	w2, w0
	b.ne	LBB0_5
; %bb.4:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ag71xx_wr
LBB0_5:
	mov	w0, #0
	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 AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_RX_RING_SIZE,4,2        ; @AG71XX_RX_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: rx packets, curr=%u\n"

	.comm	_ETH_FCS_LEN,8,3                ; @ETH_FCS_LEN
	.comm	_NetRxPackets,8,3               ; @NetRxPackets
	.comm	_PKTSIZE_ALIGN,4,2              ; @PKTSIZE_ALIGN
	.comm	_DESC_EMPTY,4,2                 ; @DESC_EMPTY
	.comm	_AG71XX_REG_RX_CTRL,4,2         ; @AG71XX_REG_RX_CTRL
	.comm	_RX_CTRL_RXE,4,2                ; @RX_CTRL_RXE
	.no_dead_strip	_ag71xx_recv
.subsections_via_symbols
