	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function typhoon_alloc_rx_skb
_typhoon_alloc_rx_skb:                  ## @typhoon_alloc_rx_skb
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	24(%rdi), %r15
	movq	32(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	shlq	$4, %r14
	movq	$0, 8(%r15,%r14)
	movslq	8(%rdi), %rax
	addq	$16, %rax
	movq	_RXFREE_ENTRIES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$4, %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %rbx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ebx
LBB0_3:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	callq	_le32_to_cpu
	cltq
	cmpq	%rax, %rbx
	je	LBB0_4
## %bb.5:
	movq	%r15, %rbx
	movq	_PKT_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dev_alloc_skb
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r15
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r14), %rax
	addq	$8, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	8(%r12), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %eax
	movl	%eax, 4(%r15)
	movl	(%r12), %edi
	movl	(%r15), %esi
	movq	_PKT_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_pci_map_single
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	16(%r12), %rbx
	movslq	8(%r12), %r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %esi
	callq	_typhoon_inc_rxfree_index
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%rbx,%r13)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movq	%rax, 8(%rbx,%r13)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax,%r14)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wmb
	movl	8(%r12), %edi
	callq	_cpu_to_le32
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	jmp	LBB0_7
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RXFREE_ENTRIES,4,2             ## @RXFREE_ENTRIES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PKT_BUF_SZ,4,2                 ## @PKT_BUF_SZ
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.no_dead_strip	_typhoon_alloc_rx_skb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function typhoon_alloc_rx_skb
_typhoon_alloc_rx_skb:                  ; @typhoon_alloc_rx_skb
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	mov	x21, x0
	ldrsw	x8, [x21, #8]!
	ldp	x25, x24, [x21, #16]
	add	x26, x25, x1, lsl #4
	str	xzr, [x26, #8]!
Lloh0:
	adrp	x9, _RXFREE_ENTRIES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RXFREE_ENTRIES@GOTPAGEOFF]
	add	x8, x8, #16
Lloh2:
	ldrsw	x9, [x9]
	lsl	x9, x9, #4
	udiv	x10, x8, x9
	msub	x22, x10, x9, x8
	ldr	w0, [x24, #8]
	bl	_le32_to_cpu
	cmp	x22, w0, sxtw
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x23, _PKT_BUF_SZ@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PKT_BUF_SZ@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_dev_alloc_skb
	cbz	x0, LBB0_3
; %bb.2:
	mov	x22, x0
	ldp	w0, w8, [x19]
	str	w8, [x22, #4]
	ldr	w1, [x22]
	ldr	w2, [x23]
Lloh5:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	bl	_pci_map_single
	mov	x23, x0
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #8]
	add	x27, x8, x9
	mov	x0, x21
	mov	w1, #1
	bl	_typhoon_inc_rxfree_index
	str	x20, [x27]
	mov	x0, x23
	bl	_cpu_to_le32
	str	x0, [x27, #8]
	str	x22, [x26]
	lsl	x8, x20, #4
	str	w23, [x25, x8]
	bl	_wmb
	ldr	w0, [x19, #8]
	bl	_cpu_to_le32
	mov	x8, x0
	mov	w0, #0
	str	x8, [x24]
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RXFREE_ENTRIES,4,2             ; @RXFREE_ENTRIES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PKT_BUF_SZ,4,2                 ; @PKT_BUF_SZ
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.no_dead_strip	_typhoon_alloc_rx_skb
.subsections_via_symbols
