	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idmac_free_chan_resources
_idmac_free_chan_resources:             ## @idmac_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_to_idmac_chan
	movq	%rax, %rbx
	movl	4(%r12), %edi
	callq	_to_idmac
	movq	%rax, %r14
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	___idmac_terminate_all
	movq	_IPU_CHANNEL_FREE@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpq	%rax, (%rbx)
	jle	LBB0_2
## %bb.1:
	movl	12(%rbx), %edi
	movq	%rbx, %rsi
	callq	_free_irq
	movl	(%r12), %edi
	callq	_ipu_irq_unmap
	movq	(%r13), %rax
LBB0_2:
	movq	%rax, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ipu_uninit_channel
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_to_ipu
	movq	%rax, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tasklet_schedule               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IPU_CHANNEL_FREE,8,3           ## @IPU_CHANNEL_FREE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IDMAC_IC_7,4,2                 ## @IDMAC_IC_7
	.comm	_ic_eof,4,2                     ## @ic_eof
	.comm	_ic_sof,4,2                     ## @ic_sof
	.no_dead_strip	_idmac_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 idmac_free_chan_resources
_idmac_free_chan_resources:             ; @idmac_free_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x0
	bl	_to_idmac_chan
	mov	x20, x0
	ldr	w0, [x22, #4]
	bl	_to_idmac
	mov	x19, x0
	add	x21, x20, #8
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x22
	bl	___idmac_terminate_all
	ldr	x9, [x20]
Lloh0:
	adrp	x23, _IPU_CHANNEL_FREE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IPU_CHANNEL_FREE@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
	ldr	w0, [x20, #12]
	mov	x1, x20
	bl	_free_irq
	ldr	w0, [x22]
	bl	_ipu_irq_unmap
	ldr	x8, [x23]
LBB0_2:
	str	x8, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_ipu_uninit_channel
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	bl	_to_ipu
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_tasklet_schedule
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_IPU_CHANNEL_FREE,8,3           ; @IPU_CHANNEL_FREE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IDMAC_IC_7,4,2                 ; @IDMAC_IC_7
	.comm	_ic_eof,4,2                     ; @ic_eof
	.comm	_ic_sof,4,2                     ; @ic_sof
	.no_dead_strip	_idmac_free_chan_resources
.subsections_via_symbols
