	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netcp_allocate_rx_buf
_netcp_allocate_rx_buf:                 ## @netcp_allocate_rx_buf
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_knav_pool_desc_get
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	20(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_7
LBB0_2:
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	_NETCP_PACKET_SIZE@GOTPCREL(%rip), %rax
	movq	_NETCP_SOP_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	addl	(%rax), %r13d
	movl	%r13d, %edi
	callq	_SKB_DATA_ALIGN
	movl	%eax, %ebx
	movl	$4, %edi
	callq	_SKB_DATA_ALIGN
	movl	%eax, %r15d
	addl	%ebx, %r15d
	movl	%r15d, %edi
	callq	_netdev_alloc_frag
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_10:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movq	_GFP_DMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_alloc_page
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	movl	20(%r12), %edi
	callq	_dev_warn_ratelimited
LBB0_6:
	movl	4(%r12), %edi
	movq	%r14, %rsi
	callq	_knav_pool_desc_put
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	16(%r12), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_dma_map_single
	movl	%eax, -48(%rbp)
	movl	16(%r12), %edi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_6
## %bb.9:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_13
LBB0_12:
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	16(%r12), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rsi
	xorl	%r15d, %r15d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	xorl	%edx, %edx
	movl	%r13d, %ecx
	callq	_dma_map_page
	movl	%eax, %edi
	movl	%eax, -48(%rbp)
LBB0_13:
	movq	_KNAV_DMA_DESC_PS_INFO_IN_DESC@GOTPCREL(%rip), %rax
	movq	_KNAV_DMA_DESC_PKT_LEN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r13d, %ecx
	orl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_KNAV_DMA_DESC_HAS_EPIB@GOTPCREL(%rip), %rax
	movq	_KNAV_DMA_NUM_PS_WORDS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_KNAV_DMA_DESC_PSLEN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	(%rax), %edx
	movq	_KNAV_DMA_DESC_RETQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	(%r12), %ebx
	movq	_KNAV_DMA_DESC_RETQ_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%edx, %ebx
	movl	%r13d, %esi
	movq	%r14, %rdx
	callq	_set_org_pkt_info
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r14, %rsi
	callq	_SET_SW_DATA0
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_SET_SW_DATA1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%ebx, %esi
	movq	%r14, %rdx
	callq	_set_desc_info
	movl	4(%r12), %edi
	leaq	-48(%rbp), %rcx
	leaq	-68(%rbp), %r8
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_knav_pool_desc_map
	movq	8(%r12), %rax
	movslq	-52(%rbp), %rcx                 ## 4-byte Folded Reload
	movl	(%rax,%rcx,4), %edi
	movl	-48(%rbp), %esi
	xorl	%ebx, %ebx
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_knav_queue_push
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of rx pool desc\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NETCP_PACKET_SIZE,4,2          ## @NETCP_PACKET_SIZE
	.comm	_NETCP_SOP_OFFSET,4,2           ## @NETCP_SOP_OFFSET
L_.str.1:                               ## @.str.1
	.asciz	"Primary RX buffer alloc failed\n"

	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
L_.str.2:                               ## @.str.2
	.asciz	"Secondary page alloc failed\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_KNAV_DMA_DESC_PS_INFO_IN_DESC,4,2 ## @KNAV_DMA_DESC_PS_INFO_IN_DESC
	.comm	_KNAV_DMA_DESC_PKT_LEN_MASK,4,2 ## @KNAV_DMA_DESC_PKT_LEN_MASK
	.comm	_KNAV_DMA_DESC_HAS_EPIB,4,2     ## @KNAV_DMA_DESC_HAS_EPIB
	.comm	_KNAV_DMA_NUM_PS_WORDS,4,2      ## @KNAV_DMA_NUM_PS_WORDS
	.comm	_KNAV_DMA_DESC_PSLEN_SHIFT,4,2  ## @KNAV_DMA_DESC_PSLEN_SHIFT
	.comm	_KNAV_DMA_DESC_RETQ_MASK,4,2    ## @KNAV_DMA_DESC_RETQ_MASK
	.comm	_KNAV_DMA_DESC_RETQ_SHIFT,4,2   ## @KNAV_DMA_DESC_RETQ_SHIFT
	.no_dead_strip	_netcp_allocate_rx_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netcp_allocate_rx_buf
_netcp_allocate_rx_buf:                 ; @netcp_allocate_rx_buf
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_knav_pool_desc_get
	mov	x20, x0
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	b	LBB0_9
LBB0_2:
	cmp	w21, #0
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_5
; %bb.3:
Lloh2:
	adrp	x8, _NETCP_PACKET_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NETCP_PACKET_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _NETCP_SOP_OFFSET@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NETCP_SOP_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	add	w22, w9, w8
	mov	x0, x22
	bl	_SKB_DATA_ALIGN
	mov	x23, x0
	mov	w0, #4
	bl	_SKB_DATA_ALIGN
	add	w24, w0, w23
	mov	x0, x24
	bl	_netdev_alloc_frag
	mov	x23, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.4:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _GFP_DMA@GOTPAGE
Lloh14:
	ldr	x9, [x9, _GFP_DMA@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_alloc_page
	mov	x23, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.6:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	ldr	w0, [x19, #20]
	bl	_dev_warn_ratelimited
LBB0_8:
	ldr	w0, [x19, #4]
	mov	x1, x20
	bl	_knav_pool_desc_put
LBB0_9:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
LBB0_11:
	ldr	w0, [x19, #16]
Lloh21:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x1, x23
	mov	x2, x22
	bl	_dma_map_single
	mov	x25, x0
	str	w0, [sp, #8]
	ldr	w0, [x19, #16]
	mov	x1, x25
	bl	_dma_mapping_error
	bl	_unlikely
	cbnz	x0, LBB0_8
	b	LBB0_13
LBB0_12:
Lloh24:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh26:
	ldr	w22, [x8]
	ldr	w0, [x19, #16]
Lloh27:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh29:
	ldr	w4, [x8]
	mov	x1, x23
	mov	w2, #0
	mov	x3, x22
	bl	_dma_map_page
	mov	x25, x0
	mov	w24, #0
	str	w0, [sp, #8]
LBB0_13:
Lloh30:
	adrp	x8, _KNAV_DMA_DESC_PS_INFO_IN_DESC@GOTPAGE
Lloh31:
	ldr	x8, [x8, _KNAV_DMA_DESC_PS_INFO_IN_DESC@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _KNAV_DMA_DESC_PKT_LEN_MASK@GOTPAGE
Lloh34:
	ldr	x9, [x9, _KNAV_DMA_DESC_PKT_LEN_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	and	w9, w9, w22
	orr	w26, w9, w8
Lloh36:
	adrp	x8, _KNAV_DMA_DESC_HAS_EPIB@GOTPAGE
Lloh37:
	ldr	x8, [x8, _KNAV_DMA_DESC_HAS_EPIB@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
Lloh39:
	adrp	x9, _KNAV_DMA_NUM_PS_WORDS@GOTPAGE
Lloh40:
	ldr	x9, [x9, _KNAV_DMA_NUM_PS_WORDS@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
Lloh42:
	adrp	x10, _KNAV_DMA_DESC_PSLEN_SHIFT@GOTPAGE
Lloh43:
	ldr	x10, [x10, _KNAV_DMA_DESC_PSLEN_SHIFT@GOTPAGEOFF]
Lloh44:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	ldr	w9, [x19]
Lloh45:
	adrp	x10, _KNAV_DMA_DESC_RETQ_MASK@GOTPAGE
Lloh46:
	ldr	x10, [x10, _KNAV_DMA_DESC_RETQ_MASK@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	and	w9, w10, w9
Lloh48:
	adrp	x10, _KNAV_DMA_DESC_RETQ_SHIFT@GOTPAGE
Lloh49:
	ldr	x10, [x10, _KNAV_DMA_DESC_RETQ_SHIFT@GOTPAGEOFF]
Lloh50:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w27, w8, w9
	mov	x0, x25
	mov	x1, x22
	mov	x2, x20
	bl	_set_org_pkt_info
	mov	x0, x23
	mov	x1, x20
	bl	_SET_SW_DATA0
	mov	x0, x24
	mov	x1, x20
	bl	_SET_SW_DATA1
	mov	x0, x26
	mov	x1, x27
	mov	x2, x20
	bl	_set_desc_info
	ldr	w0, [x19, #4]
	add	x3, sp, #8
	add	x4, sp, #12
	mov	x1, x20
	mov	w2, #4
	bl	_knav_pool_desc_map
	ldr	x8, [x19, #8]
	ldr	w0, [x8, w21, sxtw #2]
	ldr	w1, [sp, #8]
	mov	w2, #4
	mov	w3, #0
	bl	_knav_queue_push
	mov	w0, #0
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of rx pool desc\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NETCP_PACKET_SIZE,4,2          ; @NETCP_PACKET_SIZE
	.comm	_NETCP_SOP_OFFSET,4,2           ; @NETCP_SOP_OFFSET
l_.str.1:                               ; @.str.1
	.asciz	"Primary RX buffer alloc failed\n"

	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
l_.str.2:                               ; @.str.2
	.asciz	"Secondary page alloc failed\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_KNAV_DMA_DESC_PS_INFO_IN_DESC,4,2 ; @KNAV_DMA_DESC_PS_INFO_IN_DESC
	.comm	_KNAV_DMA_DESC_PKT_LEN_MASK,4,2 ; @KNAV_DMA_DESC_PKT_LEN_MASK
	.comm	_KNAV_DMA_DESC_HAS_EPIB,4,2     ; @KNAV_DMA_DESC_HAS_EPIB
	.comm	_KNAV_DMA_NUM_PS_WORDS,4,2      ; @KNAV_DMA_NUM_PS_WORDS
	.comm	_KNAV_DMA_DESC_PSLEN_SHIFT,4,2  ; @KNAV_DMA_DESC_PSLEN_SHIFT
	.comm	_KNAV_DMA_DESC_RETQ_MASK,4,2    ; @KNAV_DMA_DESC_RETQ_MASK
	.comm	_KNAV_DMA_DESC_RETQ_SHIFT,4,2   ; @KNAV_DMA_DESC_RETQ_SHIFT
	.no_dead_strip	_netcp_allocate_rx_buf
.subsections_via_symbols
