	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_thread_audio_free
_switch_thread_audio_free:              ## @switch_thread_audio_free
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.1:
	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
	movq	%rdi, %r15
	cmpl	$0, (%rdi)
	je	LBB0_3
## %bb.2:
	movl	$0, (%r15)
	leaq	24(%r15), %r14
	movq	%r14, %rdi
	callq	_compat_thread_join
	movq	%r14, %rdi
	callq	_compat_thread_close
LBB0_3:
	movq	%r15, %rdi
	callq	_switch_audio_ipc_output_stop
	xorl	%eax, %eax
	callq	_switch_audio_ipc_finalize
	movq	16(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_fifo_free
	movq	$0, 16(%r15)
LBB0_5:
	movq	8(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%r14), %edi
	callq	_free_pages
	incq	%rbx
	movq	8(%r15), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$16, %r14
	cmpq	%rax, %rbx
	jb	LBB0_7
LBB0_8:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free                           ## TAILCALL
LBB0_9:
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_switch_thread_audio_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_thread_audio_free
_switch_thread_audio_free:              ; @switch_thread_audio_free
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_9
; %bb.1:
	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	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.2:
	mov	x20, x19
	str	wzr, [x20], #24
	mov	x0, x20
	bl	_compat_thread_join
	mov	x0, x20
	bl	_compat_thread_close
LBB0_3:
	mov	x0, x19
	bl	_switch_audio_ipc_output_stop
	bl	_switch_audio_ipc_finalize
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.4:
	bl	_fifo_free
	str	xzr, [x19, #16]
LBB0_5:
	ldr	x0, [x19, #8]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_8
; %bb.6:
	mov	x20, #0
	mov	x21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x20]
	bl	_free_pages
	add	x21, x21, #1
	ldr	x0, [x19, #8]
	bl	_ARRAY_SIZE
	add	x20, x20, #16
	cmp	x21, w0, uxtw
	b.lo	LBB0_7
LBB0_8:
	mov	x0, x19
	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	_free
LBB0_9:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_switch_thread_audio_free
.subsections_via_symbols
