	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vnet_port_alloc_tx_ring
_vnet_port_alloc_tx_ring:               ## @vnet_port_alloc_tx_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	addq	$8, %rdi
	movq	16(%r14), %r12
	movq	_VIO_DRIVER_TX_RING@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	shlq	$6, %r15
	movl	$1, %esi
	movl	$7, %edx
	callq	_vio_version_after_eq
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	leaq	12(,%rcx,4), %rax
	movq	_VNET_TX_RING_SIZE@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	imulq	%rax, %rsi
	movq	_VIO_MAX_RING_COOKIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	8(%r14), %edi
	movq	_LDC_MAP_SHADOW@GOTPCREL(%rip), %rax
	movq	_LDC_MAP_DIRECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	orl	(%rax), %r8d
	movl	56(%r12,%r15), %edx
	movq	_LDC_MAP_RW@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	leaq	-44(%rbp), %rcx
	callq	_ldc_alloc_exp_dring
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_sunvnet_port_free_tx_bufs_common
	jmp	LBB0_6
LBB0_2:
	movq	%r12, %rcx
	addq	%r15, %r12
	movq	%rbx, 48(%rcx,%r15)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r12)
	movq	(%r13), %rax
	movq	%rax, 8(%rcx,%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rcx,%r15)
	movl	$1, (%r14)
	movq	(%r13), %rax
	movq	%rax, 16(%rcx,%r15)
	movl	-44(%rbp), %eax
	movl	%eax, 24(%rcx,%r15)
	cmpq	$0, (%r13)
	je	LBB0_3
## %bb.4:
	xorl	%r15d, %r15d
	movq	_VIO_DESC_FREE@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_vio_dring_entry
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	incq	%rbx
	cmpq	%rbx, (%r13)
	ja	LBB0_5
	jmp	LBB0_6
LBB0_3:
	xorl	%r15d, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIO_DRIVER_TX_RING,8,3         ## @VIO_DRIVER_TX_RING
	.comm	_VNET_TX_RING_SIZE,8,3          ## @VNET_TX_RING_SIZE
	.comm	_VIO_MAX_RING_COOKIES,4,2       ## @VIO_MAX_RING_COOKIES
	.comm	_LDC_MAP_SHADOW,4,2             ## @LDC_MAP_SHADOW
	.comm	_LDC_MAP_DIRECT,4,2             ## @LDC_MAP_DIRECT
	.comm	_LDC_MAP_RW,4,2                 ## @LDC_MAP_RW
	.comm	_VIO_DESC_FREE,4,2              ## @VIO_DESC_FREE
	.no_dead_strip	_vnet_port_alloc_tx_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vnet_port_alloc_tx_ring
_vnet_port_alloc_tx_ring:               ; @vnet_port_alloc_tx_ring
	.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	x20, x0
	add	x0, x0, #8
	ldr	x8, [x20, #16]
Lloh0:
	adrp	x9, _VIO_DRIVER_TX_RING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIO_DRIVER_TX_RING@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x19, x8, x9, lsl #6
	mov	w23, #1
	mov	w1, #1
	mov	w2, #7
	bl	_vio_version_after_eq
	mov	w8, #16
	mov	w9, #12
	cmp	x0, #0
	csel	x24, x9, x8, eq
Lloh3:
	adrp	x22, _VNET_TX_RING_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _VNET_TX_RING_SIZE@GOTPAGEOFF]
	ldr	x8, [x22]
	mul	x1, x24, x8
Lloh5:
	adrp	x8, _VIO_MAX_RING_COOKIES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VIO_MAX_RING_COOKIES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	w0, [x20, #8]
	ldr	w2, [x19, #56]
Lloh8:
	adrp	x8, _LDC_MAP_SHADOW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LDC_MAP_SHADOW@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _LDC_MAP_DIRECT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _LDC_MAP_DIRECT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _LDC_MAP_RW@GOTPAGE
Lloh15:
	ldr	x9, [x9, _LDC_MAP_RW@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w4, w8, w9
	add	x3, sp, #12
	bl	_ldc_alloc_exp_dring
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x19, x0
	mov	x0, x20
	bl	_sunvnet_port_free_tx_bufs_common
	b	LBB0_6
LBB0_2:
	str	x21, [x19, #48]
	str	x24, [x19]
	ldr	x8, [x22]
	str	x8, [x19, #8]
	stp	xzr, xzr, [x19, #32]
	str	w23, [x20]
	ldr	x8, [x22]
	str	x8, [x19, #16]
	ldr	w8, [sp, #12]
	str	w8, [x19, #24]
	ldr	x8, [x22]
	cbz	x8, LBB0_5
; %bb.3:
	mov	x20, #0
Lloh17:
	adrp	x21, _VIO_DESC_FREE@GOTPAGE
Lloh18:
	ldr	x21, [x21, _VIO_DESC_FREE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_vio_dring_entry
	ldr	w8, [x21]
	str	w8, [x0]
	add	x20, x20, #1
	ldr	x8, [x22]
	cmp	x8, x20
	b.hi	LBB0_4
LBB0_5:
	mov	w19, #0
LBB0_6:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_VIO_DRIVER_TX_RING,8,3         ; @VIO_DRIVER_TX_RING
	.comm	_VNET_TX_RING_SIZE,8,3          ; @VNET_TX_RING_SIZE
	.comm	_VIO_MAX_RING_COOKIES,4,2       ; @VIO_MAX_RING_COOKIES
	.comm	_LDC_MAP_SHADOW,4,2             ; @LDC_MAP_SHADOW
	.comm	_LDC_MAP_DIRECT,4,2             ; @LDC_MAP_DIRECT
	.comm	_LDC_MAP_RW,4,2                 ; @LDC_MAP_RW
	.comm	_VIO_DESC_FREE,4,2              ; @VIO_DESC_FREE
	.no_dead_strip	_vnet_port_alloc_tx_ring
.subsections_via_symbols
