	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shdma_free_chan_resources
_shdma_free_chan_resources:             ## @shdma_free_chan_resources
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_to_shdma_chan
	movq	%rax, %rbx
	movl	8(%r14), %edi
	callq	_to_shdma_dev
	movq	(%rax), %r12
	movq	_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	leaq	12(%rbx), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irq
	movq	%rbx, %rdi
	callq	*(%r12)
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	leaq	40(%rbx), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_shdma_chan_ld_cleanup
LBB0_2:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	js	LBB0_4
## %bb.3:
	movq	_shdma_slave_used@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clear_bit
	movq	$0, (%r14)
LBB0_4:
	movq	$0, 32(%rbx)
	movq	%r15, %rdi
	callq	_spin_lock_irq
	movq	%rbx, %rdi
	addq	$24, %rdi
	movq	_list@GOTPCREL(%rip), %rsi
	callq	_list_splice_init
	movq	$0, 16(%rbx)
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	movl	8(%rbx), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_list,4,2                       ## @list
	.comm	_shdma_slave_used,4,2           ## @shdma_slave_used
	.no_dead_strip	_shdma_free_chan_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shdma_free_chan_resources
_shdma_free_chan_resources:             ; @shdma_free_chan_resources
	.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, x0
	bl	_to_shdma_chan
	mov	x19, x0
	ldr	w0, [x20, #8]
	bl	_to_shdma_dev
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _list@GOTPAGE
Lloh1:
	ldr	x8, [x8, _list@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	x8, [x22]
	mov	x0, x19
	blr	x8
	mov	x0, x21
	bl	_spin_unlock_irq
	add	x0, x19, #40
	bl	_list_empty
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x0, [x19]
	tbnz	x0, #63, LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _shdma_slave_used@GOTPAGE
Lloh4:
	ldr	x8, [x8, _shdma_slave_used@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_clear_bit
	str	xzr, [x20]
LBB0_3:
	str	xzr, [x19, #32]
	mov	x0, x21
	bl	_spin_lock_irq
	add	x0, x19, #24
Lloh6:
	adrp	x1, _list@GOTPAGE
Lloh7:
	ldr	x1, [x1, _list@GOTPAGEOFF]
	bl	_list_splice_init
	str	xzr, [x19, #16]
	mov	x0, x21
	bl	_spin_unlock_irq
	ldr	w0, [x19, #8]
	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	_kfree
LBB0_4:
	mov	x0, x19
	mov	w1, #1
	bl	_shdma_chan_ld_cleanup
	ldr	x0, [x19]
	tbz	x0, #63, LBB0_2
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_list,4,2                       ; @list
	.comm	_shdma_slave_used,4,2           ; @shdma_slave_used
	.no_dead_strip	_shdma_free_chan_resources
.subsections_via_symbols
