	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns3_nic_alloc_rx_buffers
_hns3_nic_alloc_rx_buffers:             ## @hns3_nic_alloc_rx_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	movl	%esi, %r12d
	leaq	16(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	leaq	-64(%rbp), %r13
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_u64_stats_update_begin
	incl	28(%r14)
	movq	%rbx, %rdi
	callq	_u64_stats_update_end
	movq	(%r14), %rsi
	movq	%r14, %rdi
	callq	_hns3_reuse_buffer
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_next_to_use@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ring_ptr_move_fw
	incl	%r15d
	cmpl	%r15d, %r12d
	je	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	40(%r14), %rcx
	cmpq	$0, (%rcx,%rax,8)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_hns3_reserve_buffer_map
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rsi
	movq	%r14, %rdi
	movq	%r13, %rdx
	callq	_hns3_replace_buffer
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_u64_stats_update_begin
	incl	20(%r14)
	movq	%rbx, %rdi
	callq	_u64_stats_update_end
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_8
LBB0_9:
	movl	%r12d, %r15d
	jmp	LBB0_10
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_6:
	movl	%eax, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_u64_stats_update_begin
	incl	24(%r14)
	movq	%rbx, %rdi
	callq	_u64_stats_update_end
	movq	32(%r14), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_hns3_rl_err
LBB0_10:
	xorl	%eax, %eax
	callq	_wmb
	movq	8(%r14), %rax
	movq	_HNS3_RING_RX_RING_HEAD_REG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	movl	%r15d, %edi
	callq	_writel_relaxed
	addq	$24, %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	"alloc rx buffer failed: %d\n"

	.comm	_next_to_use,4,2                ## @next_to_use
	.comm	_HNS3_RING_RX_RING_HEAD_REG,8,3 ## @HNS3_RING_RX_RING_HEAD_REG
	.no_dead_strip	_hns3_nic_alloc_rx_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns3_nic_alloc_rx_buffers
_hns3_nic_alloc_rx_buffers:             ; @hns3_nic_alloc_rx_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	cmp	w1, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x22, x1
	mov	w20, #0
	add	x21, x19, #16
Lloh0:
	adrp	x24, _next_to_use@GOTPAGE
Lloh1:
	ldr	x24, [x24, _next_to_use@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_u64_stats_update_begin
	ldr	w8, [x19, #28]
	add	w8, w8, #1
	str	w8, [x19, #28]
	mov	x0, x21
	bl	_u64_stats_update_end
	ldr	x1, [x19]
	mov	x0, x19
	bl	_hns3_reuse_buffer
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_ring_ptr_move_fw
	add	w20, w20, #1
	cmp	w22, w20
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	ldr	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
	cbnz	x8, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	bl	_hns3_reserve_buffer_map
	cbnz	w0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [x19]
	add	x2, sp, #8
	mov	x0, x19
	bl	_hns3_replace_buffer
	mov	x0, x21
	bl	_u64_stats_update_begin
	ldr	w8, [x19, #20]
	add	w8, w8, #1
	str	w8, [x19, #20]
	mov	x0, x21
	bl	_u64_stats_update_end
	b	LBB0_3
LBB0_7:
	mov	x20, x22
	b	LBB0_10
LBB0_8:
	mov	w20, #0
	b	LBB0_10
LBB0_9:
	mov	x23, x0
	mov	x0, x21
	bl	_u64_stats_update_begin
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x19, #24]
	mov	x0, x21
	bl	_u64_stats_update_end
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_hns3_rl_err
LBB0_10:
	bl	_wmb
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh4:
	adrp	x9, _HNS3_RING_RX_RING_HEAD_REG@GOTPAGE
Lloh5:
	ldr	x9, [x9, _HNS3_RING_RX_RING_HEAD_REG@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel_relaxed
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alloc rx buffer failed: %d\n"

	.comm	_next_to_use,4,2                ; @next_to_use
	.comm	_HNS3_RING_RX_RING_HEAD_REG,8,3 ; @HNS3_RING_RX_RING_HEAD_REG
	.no_dead_strip	_hns3_nic_alloc_rx_buffers
.subsections_via_symbols
