	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tbnet_get_tx_buffer
_tbnet_get_tx_buffer:                   ## @tbnet_get_tx_buffer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	12(%rdi), %edi
	callq	_tb_ring_dma_device
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_tbnet_available_buffers
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	8(%rbx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movq	_TBNET_RING_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	andl	%eax, %ecx
	movq	(%rbx), %rax
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rbx
	movq	$0, 8(%rax,%rcx)
	movl	(%rax,%rcx), %r15d
	movq	%rbx, %rdi
	callq	_tbnet_frame_size
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_dma_sync_single_for_cpu
	jmp	LBB0_3
LBB0_1:
	xorl	%ebx, %ebx
LBB0_3:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TBNET_RING_SIZE,4,2            ## @TBNET_RING_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_tbnet_get_tx_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tbnet_get_tx_buffer
_tbnet_get_tx_buffer:                   ; @tbnet_get_tx_buffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	w0, [x0, #12]
	bl	_tb_ring_dma_device
	mov	x19, x0
	mov	x0, x20
	bl	_tbnet_available_buffers
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x20, #8]
	add	w9, w8, #1
	str	w9, [x20, #8]
Lloh0:
	adrp	x9, _TBNET_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TBNET_RING_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w9, w9, #1
	and	x8, x9, x8
	ldr	x9, [x20]
	add	x20, x9, x8, lsl #4
	str	xzr, [x20, #8]
	ldr	w21, [x20]
	mov	x0, x20
	bl	_tbnet_frame_size
	mov	x2, x0
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_dma_sync_single_for_cpu
	b	LBB0_3
LBB0_2:
	mov	x20, #0
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TBNET_RING_SIZE,4,2            ; @TBNET_RING_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_tbnet_get_tx_buffer
.subsections_via_symbols
