	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_remove_stream_from_ctx      ## -- Begin function dc_remove_stream_from_ctx
	.p2align	4, 0x90
_dc_remove_stream_from_ctx:             ## @dc_remove_stream_from_ctx
	.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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%rsi), %rbx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_resource_get_head_pipe_for_stream
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movq	(%rax), %r13
	movl	24(%rax), %edi
	callq	_ASSERT
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movl	24(%r15), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_update_stream_engine_usage
	movq	16(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_update_audio_usage
LBB0_5:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rsi
	movl	8(%r15), %edx
	callq	_resource_unreference_clock_source
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	*%rax
LBB0_7:
	testq	%r13, %r13
	je	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rbx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	%rbx, %r13
	testq	%rbx, %rbx
	jne	LBB0_8
LBB0_9:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	(%r12), %ecx
	movq	16(%r12), %rax
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, (%rax,%rbx,8)
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	cmpq	%rbx, %rcx
	jne	LBB0_11
## %bb.13:
	movl	%ecx, %ebx
LBB0_14:
	movl	%ebx, %r15d
	cmpq	%r14, (%rax,%r15,8)
	je	LBB0_16
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	movq	%r14, %rsi
	callq	_DC_ERROR
	movq	_DC_ERROR_UNEXPECTED@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_16:
	movq	%r14, %rdi
	callq	_dc_stream_release
	movl	(%r12), %ecx
	decl	%ecx
	movl	%ecx, (%r12)
	cmpl	%ecx, %ebx
	jge	LBB0_19
## %bb.17:
	leaq	8(,%r15,8), %rax
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rcx
	movq	(%rcx,%rax), %rdx
	movq	%rdx, -8(%rcx,%rax)
	movq	8(%r12), %rcx
	movups	(%rcx,%rax,4), %xmm0
	movups	16(%rcx,%rax,4), %xmm1
	movups	%xmm1, -16(%rcx,%rax,4)
	movups	%xmm0, -32(%rcx,%rax,4)
	movl	(%r12), %ecx
	addq	$8, %rax
	incl	%ebx
	cmpl	%ebx, %ecx
	jg	LBB0_18
LBB0_19:
	movq	16(%r12), %rax
	movslq	%ecx, %rdi
	movq	$0, (%rax,%rdi,8)
	shlq	$5, %rdi
	addq	8(%r12), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_DC_OK@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pipe not found for stream %p !\n"

	.comm	_DC_ERROR_UNEXPECTED,4,2        ## @DC_ERROR_UNEXPECTED
L_.str.1:                               ## @.str.1
	.asciz	"Context doesn't have stream %p !\n"

	.comm	_DC_OK,4,2                      ## @DC_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_remove_stream_from_ctx      ; -- Begin function dc_remove_stream_from_ctx
	.p2align	2
_dc_remove_stream_from_ctx:             ; @dc_remove_stream_from_ctx
	.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	x20, x2
	mov	x19, x1
	mov	x23, x0
	add	x24, x1, #24
	mov	x0, x24
	mov	x1, x2
	bl	_resource_get_head_pipe_for_stream
	cbz	x0, LBB0_12
; %bb.1:
	mov	x21, x0
	ldr	x22, [x0]
	ldr	w0, [x0, #24]
	bl	_ASSERT
	ldr	x1, [x23]
	ldr	w2, [x21, #24]
	mov	x0, x24
	mov	w3, #0
	bl	_update_stream_engine_usage
	ldr	x2, [x21, #16]
	cbz	x2, LBB0_3
; %bb.2:
	ldr	x1, [x23]
	mov	x0, x24
	mov	w3, #0
	bl	_update_audio_usage
LBB0_3:
	ldr	x1, [x23]
	ldr	w2, [x21, #8]
	mov	x0, x24
	bl	_resource_unreference_clock_source
	ldr	x8, [x23]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x23
	mov	x1, x19
	mov	x2, x20
	blr	x8
LBB0_5:
	cbz	x22, LBB0_7
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x22]
	mov	x0, x22
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	mov	x22, x23
	cbnz	x23, LBB0_6
LBB0_7:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	w10, [x19]
	ldr	x8, [x19, #16]
	cmp	w10, #1
	b.lt	LBB0_13
; %bb.8:
	mov	x9, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x8, x9, lsl #3]
	cmp	x11, x20
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x9, x9, #1
	cmp	x10, x9
	b.ne	LBB0_9
; %bb.11:
	mov	x9, x10
	b	LBB0_14
LBB0_12:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_16
LBB0_13:
	mov	w9, #0
LBB0_14:
	ldr	x8, [x8, w9, uxtw #3]
	cmp	x8, x20
	b.eq	LBB0_17
; %bb.15:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_16:
	mov	x1, x20
	bl	_DC_ERROR
Lloh4:
	adrp	x8, _DC_ERROR_UNEXPECTED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DC_ERROR_UNEXPECTED@GOTPAGEOFF]
	b	LBB0_21
LBB0_17:
	mov	w21, w9
	mov	x0, x20
	bl	_dc_stream_release
	ldr	w8, [x19]
	sub	w9, w8, #1
	str	w9, [x19]
	cmp	w21, w9
	b.ge	LBB0_20
; %bb.18:
	lsl	x8, x21, #5
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	add	x9, x9, x21, lsl #3
	add	x10, x21, #1
	ldr	x11, [x9, #8]
	str	x11, [x9]
	ldr	x9, [x19, #8]
	add	x9, x9, x8
	ldp	q0, q1, [x9, #32]
	stp	q0, q1, [x9]
	ldr	w9, [x19]
	add	x8, x8, #32
	mov	x21, x10
	cmp	w9, w10
	b.gt	LBB0_19
LBB0_20:
	ldr	x8, [x19, #16]
	sxtw	x10, w9
	str	xzr, [x8, w9, sxtw #3]
	ldr	x8, [x19, #8]
	add	x0, x8, x10, lsl #5
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh6:
	adrp	x8, _DC_OK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DC_OK@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pipe not found for stream %p !\n"

	.comm	_DC_ERROR_UNEXPECTED,4,2        ; @DC_ERROR_UNEXPECTED
l_.str.1:                               ; @.str.1
	.asciz	"Context doesn't have stream %p !\n"

	.comm	_DC_OK,4,2                      ; @DC_OK
.subsections_via_symbols
