	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vnet_clean_tx_ring
_vnet_clean_tx_ring:                    ## @vnet_clean_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_VIO_DRIVER_TX_RING@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	shlq	$2, %r15
	addq	16(%rdi), %r15
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	$0, (%rsi)
	movq	_VNET_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %r12
	movl	(%r15), %ebx
	xorl	%ecx, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	%r13d
	movq	_VNET_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	jge	LBB0_12
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	cmovlel	%eax, %ebx
	decl	%ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_vio_dring_entry
	movq	%rax, %r14
	movq	(%rax), %rsi
	movq	_VIO_DESC_READY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rax
	movslq	%ebx, %r15
	shlq	$4, %r15
	movq	8(%rax,%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_VIO_DESC_DONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_pr_notice
	movq	(%r12), %rax
	movq	8(%rax,%r15), %rax
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rax), %rdi
	callq	_BUG_ON
	movq	(%r12), %rax
	movq	8(%rax,%r15), %r12
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%r12)
	movq	$0, 8(%rax,%r15)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %edi
	movl	(%rax,%r15), %edx
	movl	4(%rax,%r15), %esi
	callq	_ldc_unmap
	movq	_VIO_DESC_FREE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_VIO_DESC_FREE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, (%r14)
	jmp	LBB0_11
LBB0_1:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$40, %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,4,2          ## @VNET_TX_RING_SIZE
	.comm	_VIO_DESC_READY,8,3             ## @VIO_DESC_READY
	.comm	_VIO_DESC_DONE,8,3              ## @VIO_DESC_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid ring buffer state %d\n"

	.comm	_VIO_DESC_FREE,8,3              ## @VIO_DESC_FREE
	.no_dead_strip	_vnet_clean_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_clean_tx_ring
_vnet_clean_tx_ring:                    ; @vnet_clean_tx_ring
	.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
	ldr	x9, [x0, #16]
Lloh0:
	adrp	x8, _VIO_DRIVER_TX_RING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIO_DRIVER_TX_RING@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
	str	wzr, [x1]
Lloh3:
	adrp	x26, _VNET_TX_RING_SIZE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _VNET_TX_RING_SIZE@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x24, #0
	mov	w27, #0
	add	x21, x9, x10, lsl #2
	ldr	w22, [x21]
Lloh5:
	adrp	x28, _VIO_DESC_READY@GOTPAGE
Lloh6:
	ldr	x28, [x28, _VIO_DESC_READY@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w27, w27, #1
	ldr	w8, [x26]
	cmp	w27, w8
	b.ge	LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, #1
	csel	w8, w8, w22, lt
	sxtw	x8, w8
	sub	x22, x8, #1
	mov	x0, x21
	mov	x1, x22
	bl	_vio_dring_entry
	ldr	x1, [x0]
	ldr	x8, [x28]
	cmp	x1, x8
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	ldr	x8, [x20]
	add	x8, x8, x22, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh7:
	adrp	x9, _VIO_DESC_DONE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _VIO_DESC_DONE@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x1, x9
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_notice
	ldr	x8, [x20]
	add	x8, x8, x22, lsl #4
	ldr	x8, [x8, #8]
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x8]
	bl	_BUG_ON
	ldr	x8, [x20]
	add	x8, x8, x22, lsl #4
	ldr	x23, [x8, #8]
	str	x24, [x23]
	str	xzr, [x8, #8]
	ldr	w0, [x20, #8]
	ldp	w2, w1, [x8]
	bl	_ldc_unmap
Lloh12:
	adrp	x8, _VIO_DESC_FREE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VIO_DESC_FREE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	mov	x24, x23
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh15:
	adrp	x8, _VIO_DESC_FREE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VIO_DESC_FREE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x8, [x25]
	b	LBB0_3
LBB0_11:
	mov	x24, #0
LBB0_12:
	mov	x0, x24
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VIO_DRIVER_TX_RING,8,3         ; @VIO_DRIVER_TX_RING
	.comm	_VNET_TX_RING_SIZE,4,2          ; @VNET_TX_RING_SIZE
	.comm	_VIO_DESC_READY,8,3             ; @VIO_DESC_READY
	.comm	_VIO_DESC_DONE,8,3              ; @VIO_DESC_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid ring buffer state %d\n"

	.comm	_VIO_DESC_FREE,8,3              ; @VIO_DESC_FREE
	.no_dead_strip	_vnet_clean_tx_ring
.subsections_via_symbols
