	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxbf_tmfifo_rxtx_header
_mlxbf_tmfifo_rxtx_header:              ## @mlxbf_tmfifo_rxtx_header
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	32(%rdi), %r13
	testl	%edx, %edx
	je	LBB0_6
## %bb.1:
	movq	%rcx, %r12
	movq	_MLXBF_TMFIFO_RX_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r13), %rdi
	callq	_readq
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	movq	_VIRTIO_ID_CONSOLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	%ecx, (%rbx)
	je	LBB0_5
## %bb.3:
	movq	16(%r13), %rdx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.4:
	movq	%r15, 24(%rbx)
	movq	_MLXBF_TMFIFO_VRING_RX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	(%rdx,%rdx,4), %rbx
	shlq	$3, %rbx
	addq	(%rcx), %rbx
	movl	$1, (%r12)
LBB0_5:
	movl	%eax, %edi
	callq	_ntohs
	movq	%rax, 8(%rbx)
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_6:
	movslq	(%rbx), %rax
	movq	_VIRTIO_ID_NET@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	%rax, (%rcx)
	sete	%r12b
	shll	$2, %r12d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mlxbf_tmfifo_get_pkt_len
	movq	%rax, 8(%rbx)
	subq	%r12, %rax
	movq	%rax, %rdi
	callq	_htons
	movq	_MLXBF_TMFIFO_TX_DATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%r13), %rsi
	movl	%eax, %edi
	callq	_writeq
	movq	8(%rbx), %rax
LBB0_7:
	movl	%r12d, 4(%rbx)
	movq	%rax, 16(%rbx)
	movq	(%r13), %rax
	movslq	%r14d, %rcx
	movq	%rbx, (%rax,%rcx,8)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXBF_TMFIFO_RX_DATA,8,3       ## @MLXBF_TMFIFO_RX_DATA
	.comm	_VIRTIO_ID_NET,8,3              ## @VIRTIO_ID_NET
	.comm	_MLXBF_TMFIFO_NET_L2_OVERHEAD,8,3 ## @MLXBF_TMFIFO_NET_L2_OVERHEAD
	.comm	_VIRTIO_ID_CONSOLE,8,3          ## @VIRTIO_ID_CONSOLE
	.comm	_MLXBF_TMFIFO_VRING_RX,8,3      ## @MLXBF_TMFIFO_VRING_RX
	.comm	_MLXBF_TMFIFO_TX_DATA,8,3       ## @MLXBF_TMFIFO_TX_DATA
	.no_dead_strip	_mlxbf_tmfifo_rxtx_header
.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_header
_mlxbf_tmfifo_rxtx_header:              ; @mlxbf_tmfifo_rxtx_header
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x23, [x0, #32]
	cbz	w2, LBB0_6
; %bb.1:
	mov	x21, x3
	ldr	x8, [x23, #24]
Lloh0:
	adrp	x9, _MLXBF_TMFIFO_RX_DATA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLXBF_TMFIFO_RX_DATA@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readq
	cbz	w0, LBB0_8
; %bb.2:
Lloh3:
	adrp	x8, _VIRTIO_ID_CONSOLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIRTIO_ID_CONSOLE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w9, [x20]
	cmp	w9, w8
	b.eq	LBB0_5
; %bb.3:
	ldr	x9, [x23, #16]
	sbfiz	x8, x8, #3, #32
	ldr	x8, [x9, x8]
	cbz	x8, LBB0_8
; %bb.4:
	str	x22, [x20, #24]
Lloh6:
	adrp	x9, _MLXBF_TMFIFO_VRING_RX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MLXBF_TMFIFO_VRING_RX@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh8:
	ldr	x9, [x9]
	mov	w10, #40
	madd	x20, x9, x10, x8
	mov	w8, #1
	str	w8, [x21]
LBB0_5:
	mov	w0, w0
	bl	_ntohs
	mov	w21, #0
	str	x0, [x20, #8]
	b	LBB0_7
LBB0_6:
	ldrsw	x8, [x20]
Lloh9:
	adrp	x9, _VIRTIO_ID_NET@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VIRTIO_ID_NET@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	cset	w8, eq
	lsl	w21, w8, #2
	mov	x0, x20
	mov	x1, x22
	bl	_mlxbf_tmfifo_get_pkt_len
	str	x0, [x20, #8]
	sub	x0, x0, x21
	bl	_htons
	ldr	x8, [x23, #8]
Lloh12:
	adrp	x9, _MLXBF_TMFIFO_TX_DATA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MLXBF_TMFIFO_TX_DATA@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_writeq
	ldr	x0, [x20, #8]
LBB0_7:
	str	w21, [x20, #4]
	str	x0, [x20, #16]
	ldr	x8, [x23]
	str	x20, [x8, w19, sxtw #3]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXBF_TMFIFO_RX_DATA,8,3       ; @MLXBF_TMFIFO_RX_DATA
	.comm	_VIRTIO_ID_NET,8,3              ; @VIRTIO_ID_NET
	.comm	_MLXBF_TMFIFO_NET_L2_OVERHEAD,8,3 ; @MLXBF_TMFIFO_NET_L2_OVERHEAD
	.comm	_VIRTIO_ID_CONSOLE,8,3          ; @VIRTIO_ID_CONSOLE
	.comm	_MLXBF_TMFIFO_VRING_RX,8,3      ; @MLXBF_TMFIFO_VRING_RX
	.comm	_MLXBF_TMFIFO_TX_DATA,8,3       ; @MLXBF_TMFIFO_TX_DATA
	.no_dead_strip	_mlxbf_tmfifo_rxtx_header
.subsections_via_symbols
