	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxbf_tmfifo_rxtx_one_desc
_mlxbf_tmfifo_rxtx_one_desc:            ## @mlxbf_tmfifo_rxtx_one_desc
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	40(%rdi), %edi
	callq	_virtqueue_get_vring
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	48(%rbx), %r15
	movl	$0, -48(%rbp)
	movq	16(%r15), %rax
	movq	(%rbx), %rcx
	movq	32(%rbx), %r14
	movq	(%rax,%rcx,8), %r13
	testq	%r14, %r14
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_mlxbf_tmfifo_get_next_pkt
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	cmpq	$0, 8(%rbx)
	je	LBB0_4
## %bb.5:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	8(%r14), %esi
	movq	%r13, %rdi
	callq	_virtio32_to_cpu
	movq	16(%rbx), %r12
	movq	24(%rbx), %rcx
	cmpq	%r12, %rax
	cmovlq	%rax, %r12
	cmpq	%r12, %rcx
	jge	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r12, %rcx
	callq	_mlxbf_tmfifo_rxtx_word
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	decl	(%rax)
	movq	24(%rbx), %rcx
LBB0_7:
	cmpq	%r12, %rcx
	jne	LBB0_12
## %bb.8:
	movq	$0, 24(%rbx)
	subq	%r12, 16(%rbx)
	jle	LBB0_11
## %bb.9:
	movl	4(%r14), %esi
	movq	%r13, %rdi
	callq	_virtio16_to_cpu
	movq	_VRING_DESC_F_NEXT@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_11
## %bb.10:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_virtio16_to_cpu
	leaq	(%rax,%rax,2), %r14
	shlq	$2, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %r14
	jmp	LBB0_12
LBB0_4:
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_mlxbf_tmfifo_rxtx_header
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	decl	(%rax)
	xorl	%eax, %eax
	cmpl	$0, -48(%rbp)
	jne	LBB0_13
	jmp	LBB0_12
LBB0_11:
	movq	%rbx, %rdi
	callq	_mlxbf_tmfifo_release_pending_pkt
	movq	8(%r15), %rax
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	$0, (%rax,%rcx,8)
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	40(%rbx), %esi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_vring_interrupt
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
LBB0_12:
	movq	%r14, 32(%rbx)
	movl	$1, %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_VRING_DESC_F_NEXT,8,3          ## @VRING_DESC_F_NEXT
	.no_dead_strip	_mlxbf_tmfifo_rxtx_one_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxbf_tmfifo_rxtx_one_desc
_mlxbf_tmfifo_rxtx_one_desc:            ; @mlxbf_tmfifo_rxtx_one_desc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x25, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #40]
	bl	_virtqueue_get_vring
	mov	x23, x0
	ldr	x21, [x19, #48]
	str	wzr, [sp, #12]
	ldr	x8, [x21, #16]
	ldr	x9, [x19]
	ldr	x24, [x8, x9, lsl #3]
	ldr	x22, [x19, #32]
	cbnz	x22, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_mlxbf_tmfifo_get_next_pkt
	mov	x22, x0
	cbz	x0, LBB0_13
LBB0_2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
; %bb.3:
	ldr	w1, [x22, #8]
	mov	x0, x24
	bl	_virtio32_to_cpu
	ldp	x9, x8, [x19, #16]
	cmp	x0, x9
	csel	x26, x0, x9, lt
	cmp	x8, x26
	b.ge	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	mov	x3, x26
	bl	_mlxbf_tmfifo_rxtx_word
	ldr	w8, [x25]
	sub	w8, w8, #1
	str	w8, [x25]
	ldr	x8, [x19, #24]
LBB0_5:
	cmp	x8, x26
	b.ne	LBB0_12
; %bb.6:
	ldr	x8, [x19, #16]
	sub	x8, x8, x26
	stp	x8, xzr, [x19, #16]
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.7:
	ldr	w1, [x22, #4]
	mov	x0, x24
	bl	_virtio16_to_cpu
Lloh0:
	adrp	x8, _VRING_DESC_F_NEXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VRING_DESC_F_NEXT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	tst	x8, x0
	b.eq	LBB0_11
; %bb.8:
	ldr	w1, [x22]
	mov	x0, x24
	bl	_virtio16_to_cpu
	ldr	x8, [x23]
	mov	w9, #12
	madd	x22, x0, x9, x8
	b	LBB0_12
LBB0_9:
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_mlxbf_tmfifo_rxtx_header
	ldr	w8, [x25]
	sub	w8, w8, #1
	str	w8, [x25]
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_12
; %bb.10:
	mov	w0, #0
	b	LBB0_13
LBB0_11:
	mov	x0, x19
	bl	_mlxbf_tmfifo_release_pending_pkt
	ldr	x8, [x21, #8]
	str	xzr, [x8, w20, sxtw #3]
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w1, [x19, #40]
	mov	w0, #0
	bl	_vring_interrupt
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x22, #0
LBB0_12:
	str	x22, [x19, #32]
	mov	w0, #1
LBB0_13:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VRING_DESC_F_NEXT,8,3          ; @VRING_DESC_F_NEXT
	.no_dead_strip	_mlxbf_tmfifo_rxtx_one_desc
.subsections_via_symbols
