	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function et131x_tx_dma_memory_alloc
_et131x_tx_dma_memory_alloc:            ## @et131x_tx_dma_memory_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_NUM_TCB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%r14), %edx
	movl	$4, %esi
	callq	_kcalloc
	movl	%eax, 36(%rbx)
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movq	_NUM_DESC_PER_RING_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$2, %esi
	movq	(%rbx), %rdi
	leaq	32(%rbx), %rdx
	movl	(%r14), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 24(%rbx)
	movq	(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	leaq	16(%rbx), %rdx
	movl	(%r14), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, %rcx
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.4:
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rsi
LBB0_5:
	callq	_dev_err
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_TCB,4,2                    ## @NUM_TCB
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NUM_DESC_PER_RING_TX,4,2       ## @NUM_DESC_PER_RING_TX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot alloc memory for Tx Ring\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot alloc memory for Tx status block\n"

	.no_dead_strip	_et131x_tx_dma_memory_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function et131x_tx_dma_memory_alloc
_et131x_tx_dma_memory_alloc:            ; @et131x_tx_dma_memory_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _NUM_TCB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NUM_TCB@GOTPAGEOFF]
Lloh2:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _GFP_DMA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GFP_DMA@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w1, #4
	bl	_kcalloc
	str	w0, [x19, #36]
	cbz	w0, LBB0_7
; %bb.1:
Lloh8:
	adrp	x8, _NUM_DESC_PER_RING_TX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NUM_DESC_PER_RING_TX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	lsl	w1, w8, #2
	ldr	x0, [x19]
	add	x2, x19, #32
	ldr	w3, [x20]
	bl	_dma_alloc_coherent
	mov	x8, x0
	str	x0, [x19, #24]
	ldr	x0, [x19]
	cbz	x8, LBB0_4
; %bb.2:
	add	x2, x19, #16
	ldr	w3, [x20]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	mov	w0, #0
	b	LBB0_8
LBB0_4:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	bl	_dev_err
LBB0_7:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_TCB,4,2                    ; @NUM_TCB
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NUM_DESC_PER_RING_TX,4,2       ; @NUM_DESC_PER_RING_TX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot alloc memory for Tx Ring\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot alloc memory for Tx status block\n"

	.no_dead_strip	_et131x_tx_dma_memory_alloc
.subsections_via_symbols
