	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_rx_packets
_ag71xx_rx_packets:                     ## @ag71xx_rx_packets
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	40(%rdi), %r13
	callq	_ag71xx_buffer_offset
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	(%r14), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movl	32(%r14), %edi
	callq	_BIT
	movl	%eax, %r12d
	movl	32(%r14), %edi
	callq	_BIT
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	(%r13), %esi
	movl	16(%r14), %ecx
	movl	20(%r14), %r8d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_DBG
	leaq	-48(%rbp), %rdi
	callq	_skb_queue_head_init
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_1
## %bb.2:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	leaq	16(%r14), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	decl	%r12d
	movl	16(%r14), %r13d
	xorl	%r15d, %r15d
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movq	_CHECKSUM_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	callq	___skb_queue_tail
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movq	24(%r14), %rax
	movq	$0, (%rax,%r13)
	incl	%r15d
	movl	16(%r14), %r13d
	incl	%r13d
	movl	%r13d, 16(%r14)
	cmpl	%r15d, -68(%rbp)                ## 4-byte Folded Reload
	je	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	andl	%r12d, %r13d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_ag71xx_ring_desc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_ag71xx_desc_empty
	testq	%rax, %rax
	jne	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%r14), %eax
	addl	-80(%rbp), %eax                 ## 4-byte Folded Reload
	cmpl	16(%r14), %eax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_AG71XX_REG_RX_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RX_STATUS_PR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ag71xx_wr
	movl	(%rbx), %r12d
	andl	-76(%rbp), %r12d                ## 4-byte Folded Reload
	movq	_ETH_FCS_LEN@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movq	8(%r14), %rdi
	movq	24(%r14), %rax
	movl	%r13d, %r13d
	shlq	$4, %r13
	movl	8(%rax,%r13), %esi
	movl	4(%r14), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_single
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	incl	12(%rax)
	addl	%r12d, 4(%rax)
	movq	24(%r14), %rax
	movq	(%rax,%r13), %rbx
	movq	%r14, %rdi
	callq	_ag71xx_buffer_size
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_build_skb
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	callq	_skb_reserve
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_skb_put
	movq	%r14, %rdi
	callq	_ag71xx_has_ar8216
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_ag71xx_remove_ar8216_header
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	incl	8(%rax)
	movq	%rbx, %rdi
	callq	_kfree_skb
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r14), %rax
	movq	(%rax,%r13), %rdi
	callq	_skb_free_frag
	jmp	LBB0_12
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_15
LBB0_13:
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_14
LBB0_5:
	xorl	%edi, %edi
	callq	_ag71xx_assert
LBB0_14:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
LBB0_15:
	movq	%r14, %rdi
	callq	_ag71xx_ring_rx_refill
	leaq	-48(%rbp), %rdi
	callq	___skb_dequeue
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	movq	%rax, %rbx
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_eth_type_trans
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_netif_receive_skb
	movq	%r12, %rdi
	callq	___skb_dequeue
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_17
LBB0_18:
	movl	(%r13), %esi
	movl	16(%r14), %edx
	movl	20(%r14), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %r8d
	callq	_DBG
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: rx packets, limit=%d, curr=%u, dirty=%u\n"

	.comm	_AG71XX_REG_RX_STATUS,4,2       ## @AG71XX_REG_RX_STATUS
	.comm	_RX_STATUS_PR,4,2               ## @RX_STATUS_PR
	.comm	_ETH_FCS_LEN,8,3                ## @ETH_FCS_LEN
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_CHECKSUM_NONE,4,2              ## @CHECKSUM_NONE
L_.str.1:                               ## @.str.1
	.asciz	"%s: rx finish, curr=%u, dirty=%u, done=%d\n"

	.no_dead_strip	_ag71xx_rx_packets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_rx_packets
_ag71xx_rx_packets:                     ; @ag71xx_rx_packets
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x1
	mov	x19, x0
	ldr	x20, [x0, #40]
	bl	_ag71xx_buffer_offset
	ldr	w8, [x19]
	stp	w0, w8, [sp]                    ; 8-byte Folded Spill
	ldr	w0, [x19, #32]
	bl	_BIT
	mov	x26, x0
	ldr	w0, [x19, #32]
	bl	_BIT
	mov	x24, x0
	mov	x25, x19
	ldp	w3, w4, [x25, #16]!
	ldr	w1, [x20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x22
	bl	_DBG
	add	x0, sp, #8
	bl	_skb_queue_head_init
	cmp	w22, #1
	b.lt	LBB0_11
; %bb.1:
	mov	w21, #0
	sub	w23, w26, #1
	ldr	w8, [x19, #16]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	x20, [x27, #8]
Lloh2:
	adrp	x8, _CHECKSUM_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CHECKSUM_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x27, #4]
	add	x0, sp, #8
	mov	x1, x27
	bl	___skb_queue_tail
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	str	xzr, [x8, x28]
	add	w21, w21, #1
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	cmp	w22, w21
	b.eq	LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	and	w27, w8, w23
	mov	x0, x25
	mov	x1, x27
	bl	_ag71xx_ring_desc
	mov	x26, x0
	bl	_ag71xx_desc_empty
	cbnz	x0, LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w9, w8, [x19, #16]
	add	w8, w8, w24
	cmp	w8, w9
	b.eq	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh5:
	adrp	x8, _AG71XX_REG_RX_STATUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AG71XX_REG_RX_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _RX_STATUS_PR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RX_STATUS_PR@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ag71xx_wr
	ldr	w8, [x26]
	ldr	w9, [sp, #4]                    ; 4-byte Folded Reload
	and	w8, w8, w9
Lloh11:
	adrp	x9, _ETH_FCS_LEN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ETH_FCS_LEN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	sub	w26, w8, w9
	ldr	x0, [x19, #8]
	ldr	x8, [x19, #24]
	lsl	x28, x27, #4
	add	x8, x8, x28
	ldr	w1, [x8, #8]
	ldr	w2, [x19, #4]
Lloh14:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	bl	_dma_unmap_single
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
	ldr	w8, [x20, #4]
	add	w8, w8, w26
	str	w8, [x20, #4]
	ldr	x8, [x19, #24]
	ldr	x27, [x8, x28]
	mov	x0, x19
	bl	_ag71xx_buffer_size
	mov	x1, x0
	mov	x0, x27
	bl	_build_skb
	cbz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
	ldr	w1, [sp]                        ; 4-byte Folded Reload
	bl	_skb_reserve
	mov	x0, x27
	mov	x1, x26
	bl	_skb_put
	mov	x0, x19
	bl	_ag71xx_has_ar8216
	cbz	x0, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x27
	mov	x2, x26
	bl	_ag71xx_remove_ar8216_header
	cbz	w0, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
	mov	x0, x27
	bl	_kfree_skb
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	ldr	x0, [x8, x28]
	bl	_skb_free_frag
	b	LBB0_3
LBB0_11:
	mov	w21, #0
	b	LBB0_14
LBB0_12:
	mov	x21, x22
	b	LBB0_14
LBB0_13:
	mov	w0, #0
	bl	_ag71xx_assert
LBB0_14:
	mov	x0, x19
	bl	_ag71xx_ring_rx_refill
	add	x0, sp, #8
	bl	___skb_dequeue
	cbz	x0, LBB0_17
; %bb.15:
	mov	x22, x0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_eth_type_trans
	str	w0, [x22]
	mov	x0, x22
	bl	_netif_receive_skb
	add	x0, sp, #8
	bl	___skb_dequeue
	mov	x22, x0
	cbnz	x0, LBB0_16
LBB0_17:
	ldr	w1, [x20]
	ldp	w2, w3, [x19, #16]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x4, x21
	bl	_DBG
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: rx packets, limit=%d, curr=%u, dirty=%u\n"

	.comm	_AG71XX_REG_RX_STATUS,4,2       ; @AG71XX_REG_RX_STATUS
	.comm	_RX_STATUS_PR,4,2               ; @RX_STATUS_PR
	.comm	_ETH_FCS_LEN,8,3                ; @ETH_FCS_LEN
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_CHECKSUM_NONE,4,2              ; @CHECKSUM_NONE
l_.str.1:                               ; @.str.1
	.asciz	"%s: rx finish, curr=%u, dirty=%u, done=%d\n"

	.no_dead_strip	_ag71xx_rx_packets
.subsections_via_symbols
