	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function niu_reset_buffers
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_niu_reset_buffers:                     ## @niu_reset_buffers
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_16
## %bb.2:
	movq	_MAX_RBR_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	movq	_RBR_DESCR_ADDR_SHIFT@GOTPCREL(%rip), %r13
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
                                        ##       Child Loop BB0_13 Depth 3
                                        ##     Child Loop BB0_6 Depth 2
	imulq	$56, %rdx, %rsi
	testl	%ecx, %ecx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_4
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rsi), %r15
	addq	$48, %r15
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=2
	incq	%r12
	movslq	%ecx, %rax
	cmpq	%rax, %r12
	jge	LBB0_5
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_13 Depth 3
	movq	(%r15), %rax
	movq	(%rax,%r12,8), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movslq	%ebx, %rbx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_11 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	8(%rax), %r14
	movl	(%rax), %edi
	movzbl	(%r13), %ecx
	sarl	%cl, %edi
	callq	_cpu_to_le32
	movq	-8(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movq	%r14, %rax
	testq	%r14, %r14
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_MAX_RBR_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rax,%rdx), %r15
	cmpl	%ecx, %ebx
	movq	_MAX_RBR_RING_SIZE@GOTPCREL(%rip), %r12
	jge	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %ecx
	callq	_niu_rbr_add_page
	movl	%eax, %edi
	callq	_unlikely
	movl	(%r12), %ecx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	incl	%ebx
	cmpl	%ecx, %ebx
	jl	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	24(%rdx,%rsi), %rax
	decq	%rax
	movq	%rax, 32(%rdx,%rsi)
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	incq	%rdx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	$0, 16(%r15)
	movslq	(%r14), %rax
	cmpq	%rax, %rdx
	jge	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
LBB0_16:
	movq	8(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_27
## %bb.17:
	movl	4(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_27
## %bb.18:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_21 Depth 2
	leaq	(,%r13,4), %rsi
	addq	%r13, %rsi
	leaq	(%rdx,%rsi,8), %r15
	movq	_MAX_TX_RING_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_25
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%rsi,8), %r12
	addq	$32, %r12
	xorl	%ebx, %ebx
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_21 Depth=2
	incq	%rbx
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jge	LBB0_24
LBB0_21:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=2
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_release_tx_packet
	movq	_MAX_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_19 Depth=1
	movl	4(%r14), %eax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_25:                                ##   in Loop: Header=BB0_19 Depth=1
	movl	%ecx, (%r15)
	incq	%r13
	movslq	%eax, %rcx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rdx,%rsi,8)
	movq	$0, 24(%rdx,%rsi,8)
	cmpq	%rcx, %r13
	jge	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	8(%r14), %rdx
	jmp	LBB0_19
LBB0_27:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_RBR_RING_SIZE,4,2          ## @MAX_RBR_RING_SIZE
	.comm	_RBR_DESCR_ADDR_SHIFT,4,2       ## @RBR_DESCR_ADDR_SHIFT
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_MAX_TX_RING_SIZE,4,2           ## @MAX_TX_RING_SIZE
	.no_dead_strip	_niu_reset_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_reset_buffers
_niu_reset_buffers:                     ; @niu_reset_buffers
	.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	x19, x0
	ldr	x9, [x0, #16]
	cbz	x9, LBB0_15
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.2:
	mov	x22, #0
Lloh0:
	adrp	x23, _MAX_RBR_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAX_RBR_RING_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w24, #56
Lloh2:
	adrp	x26, _RBR_DESCR_ADDR_SHIFT@GOTPAGE
Lloh3:
	ldr	x26, [x26, _RBR_DESCR_ADDR_SHIFT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w8, #1
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	b.lt	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, #0
	mov	w20, #0
	madd	x9, x22, x24, x9
	add	x28, x9, #48
	add	x24, x9, #40
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_11
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	x9, [x28]
	ldr	x9, [x9, x21, lsl #3]
	cbz	x9, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	sbfiz	x25, x20, #2, #32
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x27, [x9, #8]
	ldr	w8, [x9]
	ldr	w9, [x26]
	asr	w0, w8, w9
	bl	_cpu_to_le32
	ldr	x8, [x24]
	str	w0, [x8, x25]
	add	x25, x25, #4
	add	w20, w20, #1
	mov	x9, x27
	cbnz	x27, LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [x23]
	b	LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w20, #0
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w24, #56
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	madd	x21, x22, x24, x25
	cmp	w20, w8
Lloh4:
	adrp	x27, _GFP_ATOMIC@GOTPAGE
Lloh5:
	ldr	x27, [x27, _GFP_ATOMIC@GOTPAGEOFF]
	b.ge	LBB0_13
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w2, [x27]
	mov	x0, x19
	mov	x1, x21
	mov	x3, x20
	bl	_niu_rbr_add_page
	bl	_unlikely
	add	w20, w20, #1
	ldr	w8, [x23]
	cmp	x0, #0
	ccmp	w20, w8, #0, eq
	b.lt	LBB0_12
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x9, x22, x24, x25
	ldr	x10, [x9, #24]
	sub	x10, x10, #1
	str	x10, [x9, #32]
	add	x22, x22, #1
	stp	xzr, xzr, [x21, #8]
	str	xzr, [x21]
	ldrsw	x9, [x19]
	cmp	x22, x9
	b.ge	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19, #16]
	b	LBB0_3
LBB0_15:
	ldr	x23, [x19, #8]
	cbz	x23, LBB0_26
; %bb.16:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.17:
	mov	x22, #0
	mov	w24, #40
Lloh6:
	adrp	x25, _MAX_TX_RING_SIZE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _MAX_TX_RING_SIZE@GOTPAGEOFF]
LBB0_18:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_21 Depth 2
	madd	x20, x22, x24, x23
	ldr	w9, [x25]
	cmp	w9, #1
	b.lt	LBB0_24
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x21, #0
	madd	x8, x22, x24, x23
	add	x26, x8, #32
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=2
	add	x21, x21, #1
	cmp	x21, w9, sxtw
	b.ge	LBB0_23
LBB0_21:                                ;   Parent Loop BB0_18 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x26]
	ldr	x8, [x8, x21, lsl #3]
	cbz	x8, LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_release_tx_packet
	ldr	w9, [x25]
	b	LBB0_20
LBB0_23:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x19, #4]
LBB0_24:                                ;   in Loop: Header=BB0_18 Depth=1
	str	w9, [x20]
	madd	x9, x22, x24, x23
	add	x22, x22, #1
	stp	xzr, xzr, [x9, #16]
	str	xzr, [x9, #8]
	cmp	x22, w8, sxtw
	b.ge	LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x23, [x19, #8]
	b	LBB0_18
LBB0_26:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_RBR_RING_SIZE,4,2          ; @MAX_RBR_RING_SIZE
	.comm	_RBR_DESCR_ADDR_SHIFT,4,2       ; @RBR_DESCR_ADDR_SHIFT
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_MAX_TX_RING_SIZE,4,2           ; @MAX_TX_RING_SIZE
	.no_dead_strip	_niu_reset_buffers
.subsections_via_symbols
