	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rx_alloc_pkts
_rx_alloc_pkts:                         ## @rx_alloc_pkts
	.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
	movl	4(%rdi), %edi
	callq	_netdev_priv
	movq	%rax, %rbx
	movl	(%r14), %edi
	callq	_hinic_get_rq_free_wqebbs
	movl	(%rbx), %ecx
	cmpl	%ecx, %eax
	cmovbl	%eax, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	je	LBB0_10
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	leaq	-52(%rbp), %rsi
	callq	_rx_alloc_skb
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	movl	-52(%rbp), %esi
	movl	(%rax), %edx
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	callq	_hinic_set_sge
	movl	(%r14), %edi
	movq	_HINIC_RQ_WQE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_hinic_rq_get_wqe
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r13
	movl	(%r14), %edi
	movl	-44(%rbp), %esi
	movq	%rax, %rdx
	movq	%r12, %rcx
	callq	_hinic_rq_prepare_wqe
	movl	(%r14), %edi
	movl	-44(%rbp), %esi
	movq	%r13, %rdx
	movq	%r15, %rcx
	callq	_hinic_rq_write_wqe
	incl	%ebx
	cmpl	%ebx, -48(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_1
## %bb.6:
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	jne	LBB0_9
	jmp	LBB0_8
LBB0_2:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_err
	testl	%ebx, %ebx
	je	LBB0_8
LBB0_9:
	xorl	%eax, %eax
	callq	_wmb
	movl	(%r14), %edi
	movl	-44(%rbp), %esi
	callq	_hinic_rq_update
	jmp	LBB0_10
LBB0_4:
	movl	-52(%rbp), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_rx_free_skb
	testl	%ebx, %ebx
	jne	LBB0_9
LBB0_8:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	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	"Failed to alloc Rx skb\n"

	.comm	_HINIC_RQ_WQE_SIZE,4,2          ## @HINIC_RQ_WQE_SIZE
	.no_dead_strip	_rx_alloc_pkts
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rx_alloc_pkts
_rx_alloc_pkts:                         ; @rx_alloc_pkts
	.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
	ldr	w0, [x0, #4]
	bl	_netdev_priv
	mov	x20, x0
	ldr	w0, [x19]
	bl	_hinic_get_rq_free_wqebbs
	ldr	w8, [x20]
	cmp	w0, w8
	mov	w20, #0
	csel	w23, w0, w8, lo
	cbz	w23, LBB0_9
; %bb.1:
Lloh0:
	adrp	x24, _HINIC_RQ_WQE_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _HINIC_RQ_WQE_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #4
	mov	x0, x19
	bl	_rx_alloc_skb
	cbz	x0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	ldr	w1, [sp, #4]
	ldr	w2, [x0]
	add	x0, sp, #8
	bl	_hinic_set_sge
	ldr	w0, [x19]
	ldr	w1, [x24]
	mov	x2, sp
	bl	_hinic_rq_get_wqe
	cbz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	ldr	w0, [x19]
	ldr	w1, [sp]
	add	x3, sp, #8
	mov	x2, x22
	bl	_hinic_rq_prepare_wqe
	ldr	w0, [x19]
	ldr	w1, [sp]
	mov	x2, x22
	mov	x3, x21
	bl	_hinic_rq_write_wqe
	add	w20, w20, #1
	cmp	w23, w20
	b.ne	LBB0_2
; %bb.5:
	mov	x20, x23
	cbnz	w20, LBB0_8
	b	LBB0_9
LBB0_6:
	ldr	w0, [x19, #4]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
	cbnz	w20, LBB0_8
	b	LBB0_9
LBB0_7:
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	x1, x21
	bl	_rx_free_skb
	cbz	w20, LBB0_9
LBB0_8:
	bl	_wmb
	ldr	w0, [x19]
	ldr	w1, [sp]
	bl	_hinic_rq_update
LBB0_9:
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to alloc Rx skb\n"

	.comm	_HINIC_RQ_WQE_SIZE,4,2          ; @HINIC_RQ_WQE_SIZE
	.no_dead_strip	_rx_alloc_pkts
.subsections_via_symbols
