	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hsdma_free_active_desc
_mtk_hsdma_free_active_desc:            ## @mtk_hsdma_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_to_hsdma_vchan
	movq	%rax, %rbx
	leaq	8(%rax), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	12(%rbx), %r14
	movq	%r14, %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_spin_unlock
	jmp	LBB0_3
LBB0_1:
	movl	$1, (%rbx)
	movq	%r15, %rdi
	callq	_spin_unlock
	leaq	16(%rbx), %rdi
	callq	_wait_for_completion
LBB0_3:
	addq	$4, %rbx
	movq	%r14, %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN_ONCE
	movq	%rbx, %rdi
	callq	_vchan_synchronize
	movq	%rbx, %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	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_hw_processing\n"

L_.str.1:                               ## @.str.1
	.asciz	"Desc pending still in list desc_completed\n"

	.no_dead_strip	_mtk_hsdma_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_hsdma_free_active_desc
_mtk_hsdma_free_active_desc:            ; @mtk_hsdma_free_active_desc
	.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
	bl	_to_hsdma_vchan
	mov	x19, x0
	add	x21, x0, #8
	mov	x0, x21
	bl	_spin_lock
	add	x20, x19, #12
	mov	x0, x20
	bl	_list_empty
	cbz	w0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_spin_unlock
	b	LBB0_3
LBB0_2:
	mov	w8, #1
	mov	x22, x19
	str	w8, [x22], #16
	mov	x0, x21
	bl	_spin_unlock
	mov	x0, x22
	bl	_wait_for_completion
LBB0_3:
	add	x19, x19, #4
	mov	x0, x20
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN_ONCE
	mov	x0, x19
	bl	_vchan_synchronize
	mov	x0, x19
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	b	_WARN_ONCE
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Desc pending still in list desc_hw_processing\n"

l_.str.1:                               ; @.str.1
	.asciz	"Desc pending still in list desc_completed\n"

	.no_dead_strip	_mtk_hsdma_free_active_desc
.subsections_via_symbols
