	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_rx_work
_niu_rx_work:                           ## @niu_rx_work
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	24(%rdx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rdx), %edi
	callq	_RX_DMA_CTL_STAT
	movl	%eax, %edi
	callq	_nr64
	movl	%eax, %ebx
	movl	16(%r12), %edi
	callq	_RCRSTAT_A
	movl	%eax, %edi
	callq	_nr64
	movl	%eax, %r15d
	movq	_RCRSTAT_A_QLEN@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	xorps	%xmm0, %xmm0
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, (%rax)
	movq	_RX_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movl	(%rax), %edx
	movl	16(%r12), %ecx
	movslq	%ebx, %r8
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %r9d
	callq	_niudbg
	movl	%r15d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_min
	movl	%eax, %r15d
	testl	%eax, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_niu_process_rx_pkt
	addl	%eax, %r14d
	decl	%r15d
	jne	LBB0_3
## %bb.4:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %r13d
	jmp	LBB0_5
LBB0_1:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_5:
	movq	(%r12), %rax
	cmpq	8(%r12), %rax
	jl	LBB0_10
## %bb.6:
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	testq	%rax, %rax
	movq	%rbx, %r13
	jle	LBB0_9
## %bb.7:
	movl	$1, %ebx
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_niu_rbr_refill
	movl	%ebx, %eax
	incl	%ebx
	cmpq	%rax, (%r12)
	jg	LBB0_8
LBB0_9:
	movq	$0, (%r12)
	movq	%r13, %rbx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	-56(%rbp), %r13d                ## 4-byte Reload
LBB0_10:
	movq	_RX_DMA_CTL_STAT_PKTREAD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r13d, %eax
	shll	%cl, %eax
	movq	_RX_DMA_CTL_STAT_PTRREAD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_RX_DMA_CTL_STAT_MEX@GOTPCREL(%rip), %rdx
	shll	%cl, %r14d
	orl	(%rdx), %eax
	orl	%eax, %r14d
	movl	16(%r12), %edi
	callq	_RX_DMA_CTL_STAT
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_nw64
	cmpl	$11, %r15d
	jl	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$32767, %edx                    ## imm = 0x7FFF
	callq	_niu_sync_rx_discard_stats
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RCRSTAT_A_QLEN,4,2             ## @RCRSTAT_A_QLEN
	.comm	_RX_STATUS,4,2                  ## @RX_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: niu_rx_work(chan[%d]), stat[%llx] qlen=%d\n"

	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_RX_DMA_CTL_STAT_MEX,4,2        ## @RX_DMA_CTL_STAT_MEX
	.comm	_RX_DMA_CTL_STAT_PKTREAD_SHIFT,4,2 ## @RX_DMA_CTL_STAT_PKTREAD_SHIFT
	.comm	_RX_DMA_CTL_STAT_PTRREAD_SHIFT,4,2 ## @RX_DMA_CTL_STAT_PTRREAD_SHIFT
	.no_dead_strip	_niu_rx_work
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_rx_work
_niu_rx_work:                           ; @niu_rx_work
	.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	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x25, [x2, #24]
	ldr	w0, [x2, #16]
	bl	_RX_DMA_CTL_STAT
	bl	_nr64
	mov	x23, x0
	ldr	w0, [x19, #16]
	bl	_RCRSTAT_A
	bl	_nr64
Lloh0:
	adrp	x8, _RCRSTAT_A_QLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RCRSTAT_A_QLEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w24, w8, w0
Lloh3:
	adrp	x8, _RX_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RX_STATUS@GOTPAGEOFF]
	stp	xzr, xzr, [x25]
Lloh5:
	ldr	w0, [x8]
	ldr	x8, [x20]
	ldr	w2, [x8]
	ldr	w3, [x19, #16]
	sxtw	x4, w23
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x5, x24
	bl	_niudbg
	mov	x0, x24
	mov	x1, x21
	bl	_min
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #0
	mov	x24, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_niu_process_rx_pkt
	add	w23, w23, w0
	subs	w24, w24, #1
	b.ne	LBB0_2
; %bb.3:
	mov	x22, x21
	b	LBB0_5
LBB0_4:
	mov	w23, #0
	mov	w22, #0
LBB0_5:
	ldp	x8, x9, [x19]
	cmp	x8, x9
	b.lt	LBB0_10
; %bb.6:
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	w24, #1
Lloh8:
	adrp	x25, _GFP_ATOMIC@GOTPAGE
Lloh9:
	ldr	x25, [x25, _GFP_ATOMIC@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x19
	bl	_niu_rbr_refill
	ldr	x8, [x19]
	cmp	x8, w24, uxtw
	add	w24, w24, #1
	b.gt	LBB0_8
LBB0_9:
	str	xzr, [x19]
LBB0_10:
Lloh10:
	adrp	x8, _RX_DMA_CTL_STAT_MEX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RX_DMA_CTL_STAT_MEX@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _RX_DMA_CTL_STAT_PKTREAD_SHIFT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RX_DMA_CTL_STAT_PKTREAD_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _RX_DMA_CTL_STAT_PTRREAD_SHIFT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _RX_DMA_CTL_STAT_PTRREAD_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	lsl	w9, w23, w9
	orr	w23, w8, w9
	ldr	w0, [x19, #16]
	bl	_RX_DMA_CTL_STAT
	mov	x1, x23
	bl	_nw64
	cmp	w21, #11
	b.lt	LBB0_12
; %bb.11:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #32767
	bl	_niu_sync_rx_discard_stats
LBB0_12:
	mov	x0, x22
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RCRSTAT_A_QLEN,4,2             ; @RCRSTAT_A_QLEN
	.comm	_RX_STATUS,4,2                  ; @RX_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: niu_rx_work(chan[%d]), stat[%llx] qlen=%d\n"

	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_RX_DMA_CTL_STAT_MEX,4,2        ; @RX_DMA_CTL_STAT_MEX
	.comm	_RX_DMA_CTL_STAT_PKTREAD_SHIFT,4,2 ; @RX_DMA_CTL_STAT_PKTREAD_SHIFT
	.comm	_RX_DMA_CTL_STAT_PTRREAD_SHIFT,4,2 ; @RX_DMA_CTL_STAT_PTRREAD_SHIFT
	.no_dead_strip	_niu_rx_work
.subsections_via_symbols
