	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns3_clean_rx_ring             ## -- Begin function hns3_clean_rx_ring
	.p2align	4, 0x90
_hns3_clean_rx_ring:                    ## @hns3_clean_rx_ring
	.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	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r15
	callq	_hns3_desc_unused
	movl	%eax, %ebx
	movq	(%r15), %rax
	movq	%rax, -56(%rbp)
	movq	16(%r15), %rax
	movq	_HNS3_RING_RX_RING_FBDNUM_REG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, %r12d
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_rmb
	movl	%ebx, %eax
	subl	8(%r15), %ebx
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_14
## %bb.1:
	subl	%eax, %r12d
	testl	%r12d, %r12d
	jle	LBB0_14
## %bb.2:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$16, %ebx
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_hns3_nic_alloc_rx_buffers
	movq	%r15, %rdi
	callq	_hns3_desc_unused
	movl	%eax, %ebx
	subl	8(%r15), %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%r15, %rdi
	leaq	-56(%rbp), %rsi
	callq	_hns3_handle_rx_bd
	movl	%eax, %r14d
	xorl	%edi, %edi
	cmpq	$0, -56(%rbp)
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r14d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	8(%r15), %eax
	addl	%eax, %r13d
	addl	%eax, %ebx
	movq	$0, (%r15)
	movl	$0, 8(%r15)
	cmpl	%r12d, %r13d
	jl	LBB0_4
	jmp	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	*-72(%rbp)                      ## 8-byte Folded Reload
	movl	8(%r15), %eax
	addl	%eax, %ebx
	movq	$0, (%r15)
	movl	$0, 8(%r15)
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	incl	%r14d
	cmpl	-60(%rbp), %r14d                ## 4-byte Folded Reload
	jge	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	addl	%eax, %r13d
	cmpl	%r12d, %r13d
	jl	LBB0_3
	jmp	LBB0_14
LBB0_12:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	testl	%ebx, %ebx
	jg	LBB0_15
	jmp	LBB0_16
LBB0_13:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_14:
	testl	%ebx, %ebx
	jle	LBB0_16
LBB0_15:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_hns3_nic_alloc_rx_buffers
LBB0_16:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS3_RING_RX_RING_FBDNUM_REG,8,3 ## @HNS3_RING_RX_RING_FBDNUM_REG
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_RCB_NOF_ALLOC_RX_BUFF_ONCE,4,2 ## @RCB_NOF_ALLOC_RX_BUFF_ONCE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns3_clean_rx_ring             ; -- Begin function hns3_clean_rx_ring
	.p2align	2
_hns3_clean_rx_ring:                    ; @hns3_clean_rx_ring
	.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, x2
	mov	x23, x1
	mov	x19, x0
	bl	_hns3_desc_unused
	mov	x24, x0
	ldr	x8, [x19]
	str	x8, [sp, #8]
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _HNS3_RING_RX_RING_FBDNUM_REG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HNS3_RING_RX_RING_FBDNUM_REG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x25, x0
	bl	_rmb
	mov	w20, #0
	ldr	w8, [x19, #8]
	sub	w21, w24, w8
	cmp	w23, #1
	b.lt	LBB0_11
; %bb.1:
	sub	w25, w25, w24
	cmp	w25, #1
	b.lt	LBB0_11
; %bb.2:
	mov	w26, #0
	mov	w20, #0
Lloh3:
	adrp	x27, _ENXIO@GOTPAGE
Lloh4:
	ldr	x27, [x27, _ENXIO@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w21, #16
	b.lt	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_hns3_nic_alloc_rx_buffers
	mov	x0, x19
	bl	_hns3_desc_unused
	ldr	w8, [x19, #8]
	sub	w21, w0, w8
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	bl	_hns3_handle_rx_bd
	mov	x24, x0
	ldr	x8, [sp, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x27]
	cmn	w24, w8
	b.eq	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x24
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19, #8]
	add	w21, w8, w21
	str	xzr, [x19]
	str	wzr, [x19, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w26, w8, w26
	cmp	w26, w25
	b.lt	LBB0_3
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [sp, #8]
	mov	x0, x19
	blr	x22
	ldr	w8, [x19, #8]
	add	w21, w8, w21
	str	xzr, [x19]
	str	wzr, [x19, #8]
	add	w20, w20, #1
	cmp	w20, w23
	b.lt	LBB0_9
LBB0_11:
	cmp	w21, #1
	b.lt	LBB0_13
; %bb.12:
	mov	x0, x19
	mov	x1, x21
	bl	_hns3_nic_alloc_rx_buffers
LBB0_13:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS3_RING_RX_RING_FBDNUM_REG,8,3 ; @HNS3_RING_RX_RING_FBDNUM_REG
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_RCB_NOF_ALLOC_RX_BUFF_ONCE,4,2 ; @RCB_NOF_ALLOC_RX_BUFF_ONCE
.subsections_via_symbols
