	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sky2_rx_alloc
_sky2_rx_alloc:                         ## @sky2_rx_alloc
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	24(%rdi), %r15d
	movq	8(%rdi), %rdi
	movq	16(%r12), %rbx
	callq	_sky2_rx_pad
	addq	%rax, %rbx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	___netdev_alloc_skb
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r15
	movq	8(%r12), %rax
	movq	_SKY2_HW_RAM_BUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.2:
	movl	(%r15), %edi
	movl	$8, %esi
	callq	_PTR_ALIGN
	movq	%rax, %rsi
	movslq	(%r15), %rax
	subq	%rax, %rsi
	jmp	LBB0_4
LBB0_3:
	movq	_NET_IP_ALIGN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_4:
	movq	%r15, %rdi
	callq	_skb_reserve
	cmpl	$0, (%r12)
	jle	LBB0_10
## %bb.5:
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r13), %r8d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_skb_fill_page_desc
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_6
	jmp	LBB0_10
LBB0_8:
	movq	%r15, %rdi
	callq	_kfree_skb
LBB0_9:
	xorl	%r15d, %r15d
LBB0_10:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SKY2_HW_RAM_BUFFER,4,2         ## @SKY2_HW_RAM_BUFFER
	.comm	_NET_IP_ALIGN,8,3               ## @NET_IP_ALIGN
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_sky2_rx_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sky2_rx_alloc
_sky2_rx_alloc:                         ; @sky2_rx_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x20, x0
	ldr	w21, [x0, #24]
	ldp	x0, x22, [x0, #8]
	bl	_sky2_rx_pad
	add	x1, x0, x22
	mov	x0, x21
	mov	x2, x19
	bl	___netdev_alloc_skb
	mov	x21, x0
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _SKY2_HW_RAM_BUFFER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SKY2_HW_RAM_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	w0, [x21]
	mov	w1, #8
	bl	_PTR_ALIGN
	ldrsw	x8, [x21]
	sub	x1, x0, x8
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _NET_IP_ALIGN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NET_IP_ALIGN@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
LBB0_4:
	mov	x0, x21
	bl	_skb_reserve
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	w22, #0
Lloh6:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_alloc_page
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x2, x0
	ldr	w4, [x23]
	mov	x0, x21
	mov	x1, x22
	mov	w3, #0
	bl	_skb_fill_page_desc
	add	w22, w22, #1
	ldr	w8, [x20]
	cmp	w22, w8
	b.lt	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	x0, x21
	bl	_kfree_skb
	mov	x21, #0
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SKY2_HW_RAM_BUFFER,4,2         ; @SKY2_HW_RAM_BUFFER
	.comm	_NET_IP_ALIGN,8,3               ; @NET_IP_ALIGN
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_sky2_rx_alloc
.subsections_via_symbols
