	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlgmac_free_ring
_xlgmac_free_ring:                      ## @xlgmac_free_ring
	.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
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	88(%rsi), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.2:
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_XLGMAC_GET_DESC_DATA
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_xlgmac_unmap_desc_data
	incl	%ebx
	cmpl	(%r15), %ebx
	jb	LBB0_4
## %bb.5:
	movq	88(%r15), %rdi
LBB0_6:
	callq	_kfree
	movq	$0, 88(%r15)
LBB0_7:
	cmpq	$0, 80(%r15)
	je	LBB0_9
## %bb.8:
	movl	(%r14), %edi
	movq	56(%r15), %rsi
	movq	72(%r15), %rdx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_page
	movq	80(%r15), %rdi
	callq	_put_page
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%r15)
	movups	%xmm0, 72(%r15)
LBB0_9:
	cmpq	$0, 48(%r15)
	je	LBB0_11
## %bb.10:
	movl	(%r14), %edi
	movq	24(%r15), %rsi
	movq	40(%r15), %rdx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_page
	movq	48(%r15), %rdi
	callq	_put_page
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r15)
	movups	%xmm0, 40(%r15)
LBB0_11:
	movq	8(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.12:
	movl	(%r14), %edi
	movl	(%r15), %esi
	movl	16(%r15), %ecx
	shll	$2, %esi
	callq	_dma_free_coherent
	movq	$0, 8(%r15)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_xlgmac_free_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlgmac_free_ring
_xlgmac_free_ring:                      ; @xlgmac_free_ring
	.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
	cbz	x1, LBB0_13
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x0, [x1, #88]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	mov	w21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_XLGMAC_GET_DESC_DATA
	mov	x1, x0
	mov	x0, x20
	bl	_xlgmac_unmap_desc_data
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lo	LBB0_4
; %bb.5:
	ldr	x0, [x19, #88]
LBB0_6:
	bl	_kfree
	str	xzr, [x19, #88]
LBB0_7:
	ldr	x8, [x19, #80]
Lloh0:
	adrp	x21, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DMA_FROM_DEVICE@GOTPAGEOFF]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	w0, [x20]
	ldr	x1, [x19, #56]
	ldr	x2, [x19, #72]
	ldr	w3, [x21]
	bl	_dma_unmap_page
	ldr	x0, [x19, #80]
	bl	_put_page
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #56]
	stur	q0, [x19, #72]
LBB0_9:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	w0, [x20]
	ldr	x1, [x19, #24]
	ldr	x2, [x19, #40]
	ldr	w3, [x21]
	bl	_dma_unmap_page
	ldr	x0, [x19, #48]
	bl	_put_page
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #24]
	stur	q0, [x19, #40]
LBB0_11:
	ldr	x2, [x19, #8]
	cbz	x2, LBB0_13
; %bb.12:
	ldr	w0, [x20]
	ldr	w8, [x19]
	lsl	w1, w8, #2
	ldr	w3, [x19, #16]
	bl	_dma_free_coherent
	str	xzr, [x19, #8]
LBB0_13:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_xlgmac_free_ring
.subsections_via_symbols
