	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SND_setup                      ## -- Begin function SND_setup
	.p2align	4, 0x90
_SND_setup:                             ## @SND_setup
	.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
	movq	_DEF_COMSOUNDMEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CVAR_LATCH@GOTPCREL(%rip), %rax
	movq	_CVAR_ARCHIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	callq	_Cvar_Get
	movslq	(%rax), %rax
	shlq	$9, %rax
	leaq	(%rax,%rax,2), %r14
	leal	(,%r14,4), %ebx
	movl	%ebx, %edi
	callq	_malloc
	movq	_buffer@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	movq	_SND_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$3, %edi
	callq	_malloc
	movq	_sfxScratchBuffer@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_sfxScratchPointer@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_inUse@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	(%r15), %rcx
	leaq	(%rcx,%r14,4), %rax
	addq	$-4, %rax
	movq	%rax, %rdx
	cmpq	%rcx, %rax
	jbe	LBB0_3
## %bb.1:
	movq	%rax, %rsi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-4(%rsi), %rdx
	movq	%rdx, (%rsi)
	movq	%rdx, %rsi
	cmpq	%rcx, %rdx
	ja	LBB0_2
LBB0_3:
	movq	$0, (%rdx)
	movq	_freelist@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	leaq	L_.str.1(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Com_Printf                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"com_soundMegs"

	.comm	_DEF_COMSOUNDMEGS,4,2           ## @DEF_COMSOUNDMEGS
	.comm	_CVAR_LATCH,4,2                 ## @CVAR_LATCH
	.comm	_CVAR_ARCHIVE,4,2               ## @CVAR_ARCHIVE
	.comm	_buffer,8,3                     ## @buffer
	.comm	_SND_CHUNK_SIZE,4,2             ## @SND_CHUNK_SIZE
	.comm	_sfxScratchBuffer,8,3           ## @sfxScratchBuffer
	.comm	_sfxScratchPointer,8,3          ## @sfxScratchPointer
	.comm	_inUse,4,2                      ## @inUse
	.comm	_freelist,8,3                   ## @freelist
L_.str.1:                               ## @.str.1
	.asciz	"Sound memory manager started\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SND_setup                      ; -- Begin function SND_setup
	.p2align	2
_SND_setup:                             ; @SND_setup
	.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
Lloh0:
	adrp	x8, _DEF_COMSOUNDMEGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEF_COMSOUNDMEGS@GOTPAGEOFF]
Lloh2:
	adrp	x9, _CVAR_LATCH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CVAR_LATCH@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _CVAR_ARCHIVE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CVAR_ARCHIVE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Cvar_Get
	ldrsw	x8, [x0]
	add	x20, x8, x8, lsl #1
	lsl	w19, w20, #11
	mov	x0, x19
	bl	_malloc
Lloh11:
	adrp	x21, _buffer@GOTPAGE
Lloh12:
	ldr	x21, [x21, _buffer@GOTPAGEOFF]
	str	x0, [x21]
Lloh13:
	adrp	x8, _SND_CHUNK_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SND_CHUNK_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	lsl	w0, w8, #3
	bl	_malloc
Lloh16:
	adrp	x8, _sfxScratchBuffer@GOTPAGE
Lloh17:
	ldr	x8, [x8, _sfxScratchBuffer@GOTPAGEOFF]
Lloh18:
	str	x0, [x8]
Lloh19:
	adrp	x8, _sfxScratchPointer@GOTPAGE
Lloh20:
	ldr	x8, [x8, _sfxScratchPointer@GOTPAGEOFF]
Lloh21:
	str	xzr, [x8]
Lloh22:
	adrp	x8, _inUse@GOTPAGE
Lloh23:
	ldr	x8, [x8, _inUse@GOTPAGEOFF]
Lloh24:
	str	w19, [x8]
	ldr	x9, [x21]
	add	x8, x9, x20, lsl #11
	sub	x8, x8, #4
	mov	x10, x8
	cmp	x8, x9
	b.ls	LBB0_3
; %bb.1:
	mov	x11, x8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	x10, x11, #4
	str	x10, [x11]
	mov	x11, x10
	cmp	x10, x9
	b.hi	LBB0_2
LBB0_3:
	str	xzr, [x10]
Lloh25:
	adrp	x9, _freelist@GOTPAGE
Lloh26:
	ldr	x9, [x9, _freelist@GOTPAGEOFF]
Lloh27:
	str	x8, [x9]
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, 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	_Com_Printf
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"com_soundMegs"

	.comm	_DEF_COMSOUNDMEGS,4,2           ; @DEF_COMSOUNDMEGS
	.comm	_CVAR_LATCH,4,2                 ; @CVAR_LATCH
	.comm	_CVAR_ARCHIVE,4,2               ; @CVAR_ARCHIVE
	.comm	_buffer,8,3                     ; @buffer
	.comm	_SND_CHUNK_SIZE,4,2             ; @SND_CHUNK_SIZE
	.comm	_sfxScratchBuffer,8,3           ; @sfxScratchBuffer
	.comm	_sfxScratchPointer,8,3          ; @sfxScratchPointer
	.comm	_inUse,4,2                      ; @inUse
	.comm	_freelist,8,3                   ; @freelist
l_.str.1:                               ; @.str.1
	.asciz	"Sound memory manager started\n"

.subsections_via_symbols
