	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gelic_descr_prepare_tx
_gelic_descr_prepare_tx:                ## @gelic_descr_prepare_tx
	.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	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpq	$0, 16(%rdi)
	je	LBB0_3
## %bb.1:
	movl	8(%rbx), %edi
	callq	_netdev_port
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	(%rcx,%rax,4), %esi
	movq	%rbx, %rdi
	callq	_gelic_put_vlan_tag
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	callq	_ctodev
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %edi
	callq	_dma_map_single
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %edi
	callq	_cpu_to_be32
	movq	%rax, 40(%r15)
	movl	(%rbx), %edi
	callq	_cpu_to_be32
	movq	%rax, 32(%r15)
	movq	%rbx, 24(%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_gelic_descr_set_tx_cmdstat
	movl	(%r15), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_4:
	movq	%r14, %rdi
	callq	_ctodev
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma map 2 failed (%p, %i). Dropping packet\n"

	.no_dead_strip	_gelic_descr_prepare_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gelic_descr_prepare_tx
_gelic_descr_prepare_tx:                ; @gelic_descr_prepare_tx
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x20, #8]
	bl	_netdev_port
	ldr	w8, [x0]
	ldr	x9, [x19, #8]
	ldr	w1, [x9, x8, lsl #2]
	mov	x0, x20
	bl	_gelic_put_vlan_tag
	mov	x20, x0
	cbz	x0, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_ctodev
	ldp	w2, w1, [x20]
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	bl	_dma_map_single
	cbz	w0, LBB0_4
; %bb.3:
	bl	_cpu_to_be32
	str	x0, [x21, #40]
	ldr	w0, [x20]
	bl	_cpu_to_be32
	stp	x20, x0, [x21, #24]
	stp	xzr, xzr, [x21, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_gelic_descr_set_tx_cmdstat
	mov	w0, #0
	ldr	w8, [x21]
	str	w8, [x19]
	b	LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_ctodev
	ldp	w3, w2, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma map 2 failed (%p, %i). Dropping packet\n"

	.no_dead_strip	_gelic_descr_prepare_tx
.subsections_via_symbols
