	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_rbufs
_alloc_rbufs:                           ## @alloc_rbufs
	.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, %rbx
	callq	_netdev_priv
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	cmpl	$1501, %edi                     ## imm = 0x5DD
	jge	LBB0_1
## %bb.2:
	movq	_PKT_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_3
LBB0_1:
	addl	$32, %edi
LBB0_3:
	movl	%edi, (%r15)
	movq	_RX_RING_SIZE@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.7:
	movl	4(%r15), %r12d
	addl	$4, %r12d
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rbx
	movq	8(%r15), %rax
	movq	$0, 16(%rax,%r13)
	callq	_cpu_to_le32
	movq	8(%r15), %rcx
	movq	%rax, 8(%rcx,%r13)
	movl	%r12d, %edi
	callq	_cpu_to_le32
	movq	8(%r15), %rcx
	movq	%rax, (%rcx,%r13)
	movq	16(%r15), %rax
	movq	$0, (%rax,%rbx,8)
	leaq	1(%rbx), %rax
	movslq	(%r14), %rcx
	cmpq	%rcx, %rax
	jge	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r15), %edi
	addq	$24, %r13
	addl	$4, %r12d
	jmp	LBB0_8
LBB0_4:
	movq	$-1, %rbx
LBB0_5:
	movl	4(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%r15), %rcx
	leaq	(%rbx,%rbx,2), %rdx
	movq	%rax, (%rcx,%rdx,8)
	cmpl	$0, (%r14)
	jle	LBB0_6
## %bb.10:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r13
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_rhine_skb_dma_init
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_rhine_skb_dma_nic_store
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_11
	jmp	LBB0_14
LBB0_6:
                                        ## implicit-def: $r12d
LBB0_14:
	movq	%r15, %rdi
	callq	_rhine_reset_rbufs
	jmp	LBB0_15
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_free_rbufs
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PKT_BUF_SZ,4,2                 ## @PKT_BUF_SZ
	.comm	_RX_RING_SIZE,4,2               ## @RX_RING_SIZE
	.no_dead_strip	_alloc_rbufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_rbufs
_alloc_rbufs:                           ; @alloc_rbufs
	.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
	bl	_netdev_priv
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _PKT_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PKT_BUF_SZ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w8, #32
	cmp	w8, #1501
	csel	w0, w9, w10, lt
	str	w0, [x20]
Lloh3:
	adrp	x23, _RX_RING_SIZE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _RX_RING_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x24, #0
	mov	x22, #0
	ldr	w8, [x20, #4]
	add	w21, w8, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x24
	str	xzr, [x8, #16]
	bl	_cpu_to_le32
	ldr	x8, [x20, #8]
	add	x8, x8, x24
	str	x0, [x8, #8]
	mov	x0, x21
	bl	_cpu_to_le32
	ldp	x8, x9, [x20, #8]
	str	x0, [x8, x24]
	str	xzr, [x9, x22, lsl #3]
	add	x8, x22, #1
	ldrsw	x9, [x23]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x20]
	add	x24, x24, #24
	add	w21, w21, #4
	mov	x22, x8
	b	LBB0_2
LBB0_4:
	mov	x22, #-1
LBB0_5:
	ldr	w0, [x20, #4]
	bl	_cpu_to_le32
	ldr	x8, [x20, #8]
	mov	w9, #24
	mul	x9, x22, x9
	str	x0, [x8, x9]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	w22, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #8
	mov	x0, x19
	bl	_rhine_skb_dma_init
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x22
	bl	_rhine_skb_dma_nic_store
	add	w22, w22, #1
	ldr	w8, [x23]
	cmp	w22, w8
	b.lt	LBB0_7
	b	LBB0_10
LBB0_9:
                                        ; implicit-def: $w21
LBB0_10:
	mov	x0, x20
	bl	_rhine_reset_rbufs
	b	LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_free_rbufs
LBB0_12:
	mov	x0, x21
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PKT_BUF_SZ,4,2                 ; @PKT_BUF_SZ
	.comm	_RX_RING_SIZE,4,2               ; @RX_RING_SIZE
	.no_dead_strip	_alloc_rbufs
.subsections_via_symbols
