	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_cqdma_free_active_desc
_mtk_cqdma_free_active_desc:            ## @mtk_cqdma_free_active_desc
	.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
	callq	_to_cqdma_vchan
	movq	%rax, %rbx
	movq	16(%rax), %rdi
	callq	_spin_lock_irqsave
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	callq	_mtk_cqdma_is_vchan_active
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	$1, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	16(%rbx), %rdi
	callq	_spin_unlock_irqrestore
	leaq	12(%rbx), %rdi
	callq	_wait_for_completion
	jmp	LBB0_3
LBB0_2:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	16(%rbx), %rdi
	callq	_spin_unlock_irqrestore
LBB0_3:
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_vchan_synchronize
	movq	%rbx, %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_WARN_ONCE                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Desc pending still in list desc_completed\n"

	.no_dead_strip	_mtk_cqdma_free_active_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_cqdma_free_active_desc
_mtk_cqdma_free_active_desc:            ; @mtk_cqdma_free_active_desc
	.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
	bl	_to_cqdma_vchan
	mov	x19, x0
	ldr	x0, [x0, #16]
	bl	_spin_lock_irqsave
	add	x20, x19, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_mtk_cqdma_is_vchan_active
	cbz	x0, LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x0, [x19, #16]
	bl	_spin_unlock_irqrestore
	add	x0, x19, #12
	bl	_wait_for_completion
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x0, [x19, #16]
	bl	_spin_unlock_irqrestore
LBB0_3:
	add	x19, x19, #4
	mov	x0, x19
	bl	_vchan_synchronize
	mov	x0, x19
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_WARN_ONCE
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Desc pending still in list desc_completed\n"

	.no_dead_strip	_mtk_cqdma_free_active_desc
.subsections_via_symbols
