	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tbnet_alloc_tx_buffers
_tbnet_alloc_tx_buffers:                ## @tbnet_alloc_tx_buffers
	.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
	movl	32(%rdi), %edi
	callq	_tb_ring_dma_device
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_TBNET_RING_SIZE@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	leaq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$24, %r13d
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	movq	%rax, (%r15,%r13)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	_TBNET_FRAME_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%r12, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movl	%eax, %ebx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %eax
	movl	%eax, -8(%r15,%r13)
	movl	%ebx, -12(%r15,%r13)
	movq	_tbnet_tx_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -16(%r15,%r13)
	movq	_TBIP_PDF_FRAME_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%r15,%r13)
	movq	_TBIP_PDF_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%r15,%r13)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	incq	%rbx
	movq	_TBNET_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$32, %r13
	cmpq	%rax, %rbx
	jb	LBB0_3
## %bb.8:
	decl	%eax
	jmp	LBB0_9
LBB0_1:
	movl	$-1, %eax
LBB0_9:
	movq	$0, 16(%r14)
	movl	%eax, 8(%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_6:
	movq	(%r15,%r13), %rdi
	callq	___free_page
	movq	$0, (%r15,%r13)
LBB0_4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_tbnet_free_buffers
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TBNET_RING_SIZE,4,2            ## @TBNET_RING_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TBNET_FRAME_SIZE,4,2           ## @TBNET_FRAME_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_tbnet_tx_callback,4,2          ## @tbnet_tx_callback
	.comm	_TBIP_PDF_FRAME_START,4,2       ## @TBIP_PDF_FRAME_START
	.comm	_TBIP_PDF_FRAME_END,4,2         ## @TBIP_PDF_FRAME_END
	.no_dead_strip	_tbnet_alloc_tx_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tbnet_alloc_tx_buffers
_tbnet_alloc_tx_buffers:                ; @tbnet_alloc_tx_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_tb_ring_dma_device
Lloh0:
	adrp	x23, _TBNET_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TBNET_RING_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x21, x0
	mov	x24, #0
	mov	x25, #0
	add	x8, x19, #8
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh2:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	adrp	x28, _DMA_TO_DEVICE@GOTPAGE
Lloh5:
	ldr	x28, [x28, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh6:
	adrp	x27, _TBIP_PDF_FRAME_END@GOTPAGE
Lloh7:
	ldr	x27, [x27, _TBIP_PDF_FRAME_END@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x19, #24]
	ldr	w0, [x26]
	bl	_alloc_page
	add	x8, x20, x24
	str	x0, [x8, #24]
	cbz	x0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x1, x0
Lloh8:
	adrp	x8, _TBNET_FRAME_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TBNET_FRAME_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	ldr	w4, [x28]
	mov	x0, x21
	mov	w2, #0
	bl	_dma_map_page
	mov	x22, x0
	mov	x0, x21
	mov	x1, x22
	bl	_dma_mapping_error
	cbnz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x19]
	add	x9, x20, x24
	stp	w22, w8, [x9, #12]
Lloh11:
	adrp	x8, _tbnet_tx_callback@GOTPAGE
Lloh12:
	ldr	x8, [x8, _tbnet_tx_callback@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x9, #8]
Lloh14:
	adrp	x8, _TBIP_PDF_FRAME_START@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TBIP_PDF_FRAME_START@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x9, #4]
	ldr	w8, [x27]
	str	w8, [x9]
	add	x25, x25, #1
	ldr	w8, [x23]
	add	x24, x24, #32
	cmp	x25, x8
	b.lo	LBB0_2
; %bb.5:
	sub	w8, w8, #1
	b	LBB0_7
LBB0_6:
	mov	w8, #-1
LBB0_7:
	mov	w0, #0
	str	xzr, [x19, #16]
	str	w8, [x19, #8]
	b	LBB0_10
LBB0_8:
	add	x19, x20, x24
	ldr	x0, [x19, #24]
	bl	___free_page
	str	xzr, [x19, #24]
LBB0_9:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_tbnet_free_buffers
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_TBNET_RING_SIZE,4,2            ; @TBNET_RING_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TBNET_FRAME_SIZE,4,2           ; @TBNET_FRAME_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_tbnet_tx_callback,4,2          ; @tbnet_tx_callback
	.comm	_TBIP_PDF_FRAME_START,4,2       ; @TBIP_PDF_FRAME_START
	.comm	_TBIP_PDF_FRAME_END,4,2         ; @TBIP_PDF_FRAME_END
	.no_dead_strip	_tbnet_alloc_tx_buffers
.subsections_via_symbols
