	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gve_rx_alloc_ring
_gve_rx_alloc_ring:                     ## @gve_rx_alloc_ring
	.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, %rbx
	movq	24(%rdi), %r15
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movslq	%esi, %r14
	leaq	(%r14,%r14,2), %r13
	shlq	$5, %r13
	leaq	(%r15,%r13), %r12
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rdi), %edx
	leaq	L_.str(%rip), %rcx
	xorl	%eax, %eax
	callq	_netif_dbg
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$96, %edx
	callq	_memset
	movq	%rbx, 88(%r15,%r13)
	movl	%r14d, (%r15,%r13)
	movslq	(%rbx), %r12
	leal	-1(%r12), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	%eax, 4(%r15,%r13)
	shlq	$2, %r12
	leaq	(%r15,%r13), %rdx
	addq	$24, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r15,%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_gve_prefill_rx_pages
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, 8(%r15,%r13)
	xorl	%eax, %eax
	callq	_dma_wmb
	leaq	(%r15,%r13), %rdx
	addq	$48, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$4, %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	callq	_dma_alloc_coherent
	movq	%rax, 40(%r15,%r13)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r9
	leaq	L_.str.1(%rip), %rcx
	movq	%rbx, %rdi
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_netif_dbg
	movslq	4(%rbx), %rsi
	shlq	$2, %rsi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rsi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_7
## %bb.8:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, %eax
	jmp	LBB0_16
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_15
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	jmp	LBB0_14
LBB0_7:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	cltq
	imulq	%rcx, %rax
	cmpq	%rsi, %rax
	jne	LBB0_10
## %bb.11:
	leaq	(%r15,%r13), %rdx
	addq	$72, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_coherent
	movq	%rax, 64(%r15,%r13)
	testq	%rax, %rax
	je	LBB0_12
## %bb.17:
	leaq	(%r15,%r13), %rax
	addq	$4, %rax
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movq	$0, 80(%r15,%r13)
	movl	$1, 56(%r15,%r13)
	movq	%rbx, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gve_rx_add_to_block
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_13:
	leaq	(%r15,%r13), %rbx
	addq	$40, %rbx
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	(%rbx), %rdx
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	movl	$4, %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_free_coherent
	movq	$0, (%rbx)
LBB0_14:
	movl	32(%r15,%r13), %edi
	callq	_kvfree
	movl	-64(%rbp), %r14d                ## 4-byte Reload
LBB0_15:
	leaq	(%r15,%r13), %rbx
	addq	$16, %rbx
	negl	%r14d
	movq	(%rbx), %rdx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_dma_free_coherent
	movq	$0, (%rbx)
	movl	%r14d, %eax
LBB0_16:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_drv,4,2                        ## @drv
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"allocating rx ring\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"rx[%d]->data.data_bus=%lx\n"

	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_gve_rx_alloc_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gve_rx_alloc_ring
_gve_rx_alloc_ring:                     ; @gve_rx_alloc_ring
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x1
	mov	x23, x0
	mov	w8, #96
	ldp	x19, x25, [x0, #16]
	smaddl	x24, w1, w8, x25
Lloh0:
	adrp	x8, _drv@GOTPAGE
Lloh1:
	ldr	x8, [x8, _drv@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x0, #8]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	bl	_netif_dbg
	mov	x0, x24
	mov	w1, #0
	mov	w2, #96
	bl	_memset
	str	x23, [x24, #88]
	ldrsw	x8, [x23]
	sub	w28, w8, #1
	mov	x27, x24
	str	w28, [x27, #4]!
	str	w22, [x24]
	lsl	x20, x8, #2
	add	x21, x24, #24
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_dma_alloc_coherent
	mov	x26, x24
	str	x0, [x26, #16]!
	cbz	x0, LBB0_6
; %bb.1:
	mov	x0, x24
	bl	_gve_prefill_rx_pages
	tbnz	w0, #31, LBB0_7
; %bb.2:
	sxtw	x9, w22
	mov	w8, #96
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
	madd	x24, x9, x8, x25
	str	w0, [x24, #8]
	bl	_dma_wmb
	add	x2, x24, #48
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #4
	str	x2, [sp, #32]                   ; 8-byte Folded Spill
	bl	_dma_alloc_coherent
	str	x0, [x24, #40]!
	cbz	x0, LBB0_8
; %bb.3:
Lloh11:
	adrp	x8, _drv@GOTPAGE
Lloh12:
	ldr	x8, [x8, _drv@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w2, [x23, #8]
	ldr	x8, [x21]
	mov	x9, x22
	stp	x9, x8, [sp]
Lloh14:
	adrp	x3, l_.str.1@PAGE
Lloh15:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_netif_dbg
	ldrsw	x8, [x23, #4]
Lloh16:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
	lsl	x1, x8, #2
Lloh18:
	ldr	x8, [x9]
	udiv	x9, x1, x8
	sxtw	x9, w9
	mul	x8, x9, x8
	cmp	x8, x1
	b.ne	LBB0_9
; %bb.4:
	mov	w8, #96
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	madd	x8, x9, x8, x25
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	add	x2, x8, #72
Lloh19:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dma_alloc_coherent
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	str	x0, [x8, #64]
	cbz	x0, LBB0_10
; %bb.5:
	str	w28, [x27]
	mov	w8, #96
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	madd	x8, x9, x8, x25
	str	xzr, [x8, #80]
	mov	w9, #1
	str	w9, [x8, #56]
	mov	x0, x23
	mov	x1, x22
	bl	_gve_rx_add_to_block
	mov	w22, #0
	b	LBB0_14
LBB0_6:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_7:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w22, [x8]
	b	LBB0_13
LBB0_8:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w22, [x8]
	b	LBB0_12
LBB0_9:
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w22, [x8]
	ldr	x2, [x24]
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x3, [x8]
	mov	x0, x19
	mov	w1, #4
	bl	_dma_free_coherent
	str	xzr, [x24]
LBB0_12:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	mov	w8, #96
	madd	x8, x9, x8, x25
	ldr	w0, [x8, #32]
	bl	_kvfree
LBB0_13:
	neg	w22, w22
	ldr	x2, [x26]
	ldr	x3, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_dma_free_coherent
	str	xzr, [x26]
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_drv,4,2                        ; @drv
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"allocating rx ring\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"rx[%d]->data.data_bus=%lx\n"

	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_gve_rx_alloc_ring
.subsections_via_symbols
