	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AddLoopSounds                ## -- Begin function S_AddLoopSounds
	.p2align	4, 0x90
_S_AddLoopSounds:                       ## @S_AddLoopSounds
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_numLoopChannels@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorl	%eax, %eax
	callq	_Com_Milliseconds
	incl	_S_AddLoopSounds.loopFrame(%rip)
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_MAX_GENTITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.1:
	movl	$104, %r12d
	movl	$1, %r13d
	xorl	%r14d, %r14d
	movq	_loopSounds@GOTPCREL(%rip), %rdi
	jmp	LBB0_2
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_loop_channels@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_numLoopChannels@GOTPCREL(%rip), %r8
	movq	(%r8), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	movl	$127, (%rax,%rcx,8)
	movl	-48(%rbp), %edx
	movl	%edx, 4(%rax,%rcx,8)
	movl	-44(%rbp), %edx
	movl	%edx, 8(%rax,%rcx,8)
	movq	(%r9), %rdx
	movq	%rdx, 32(%rax,%rcx,8)
	movq	16(%rbx,%rsi), %rdx
	movq	%rdx, 24(%rax,%rcx,8)
	movl	8(%rbx,%rsi), %edx
	movl	%edx, 16(%rax,%rcx,8)
	movl	4(%rbx,%rsi), %edx
	movl	%edx, 12(%rax,%rcx,8)
	movq	(%r8), %rax
	incq	%rax
	movq	%rax, (%r8)
	movq	_MAX_CHANNELS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_MAX_GENTITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	addq	$56, %r12
	incl	%r13d
	cmpq	%rcx, %r14
	jge	LBB0_18
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	(%rdi), %r15
	imulq	$56, %r14, %rbx
	cmpl	$0, 48(%r15,%rbx)
	je	LBB0_17
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15,%rbx), %ecx
	cmpl	_S_AddLoopSounds.loopFrame(%rip), %ecx
	je	LBB0_17
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 40(%r15,%rbx)
	movl	32(%r15,%rbx), %edi
	movl	$127, %esi
	movl	$90, %eax
	cmovel	%eax, %esi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	callq	_S_SpatializeOrigin
	leaq	(%r15,%rbx), %r9
	addq	$24, %r9
	movq	24(%r15,%rbx), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	leaq	1(%r14), %rcx
	movq	_MAX_GENTITIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rcx
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	_loopSounds@GOTPCREL(%rip), %rdi
	jl	LBB0_5
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	movl	%edx, %esi
	orl	%ecx, %esi
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$256, %edx                      ## imm = 0x100
	jl	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$255, -48(%rbp)
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$256, %ecx                      ## imm = 0x100
	jl	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$255, -44(%rbp)
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	addq	$56, %r12
	incl	%r13d
	cmpl	%r13d, %eax
	jle	LBB0_10
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rdi), %r15
	cmpl	$0, (%r15,%r12)
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	cmpq	$0, -32(%r15,%r12)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	-24(%r15,%r12), %rcx
	cmpq	(%r9), %rcx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	_S_AddLoopSounds.loopFrame(%rip), %eax
	movl	%eax, -48(%r15,%r12)
	cmpq	$0, -8(%r15,%r12)
	movl	-16(%r15,%r12), %edi
	movl	$127, %esi
	movl	$90, %eax
	cmovel	%eax, %esi
	leaq	-64(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	movq	%r9, %rbx
	callq	_S_SpatializeOrigin
	movq	%rbx, %r9
	movq	_loopSounds@GOTPCREL(%rip), %rdi
	movq	-24(%r15,%r12), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movl	-64(%rbp), %eax
	addl	%eax, -48(%rbp)
	movl	-60(%rbp), %eax
	addl	%eax, -44(%rbp)
	movq	_MAX_GENTITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_18:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_S_AddLoopSounds.loopFrame,4,2 ## @S_AddLoopSounds.loopFrame
	.comm	_numLoopChannels,8,3            ## @numLoopChannels
	.comm	_MAX_GENTITIES,4,2              ## @MAX_GENTITIES
	.comm	_loopSounds,8,3                 ## @loopSounds
	.comm	_loop_channels,8,3              ## @loop_channels
	.comm	_MAX_CHANNELS,8,3               ## @MAX_CHANNELS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_AddLoopSounds                ; -- Begin function S_AddLoopSounds
	.p2align	2
_S_AddLoopSounds:                       ; @S_AddLoopSounds
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _numLoopChannels@GOTPAGE
Lloh1:
	ldr	x8, [x8, _numLoopChannels@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
	bl	_Com_Milliseconds
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	adrp	x9, _S_AddLoopSounds.loopFrame@PAGE
	ldr	w8, [x9, _S_AddLoopSounds.loopFrame@PAGEOFF]
	add	w8, w8, #1
	str	w8, [x9, _S_AddLoopSounds.loopFrame@PAGEOFF]
Lloh3:
	adrp	x8, _MAX_GENTITIES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_GENTITIES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x21, #0
	mov	x24, #0
	mov	w22, #1
Lloh6:
	adrp	x26, _loopSounds@GOTPAGE
Lloh7:
	ldr	x26, [x26, _loopSounds@GOTPAGEOFF]
	mov	w27, #56
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh8:
	adrp	x8, _loop_channels@GOTPAGE
Lloh9:
	ldr	x8, [x8, _loop_channels@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x11, _numLoopChannels@GOTPAGE
Lloh12:
	ldr	x11, [x11, _numLoopChannels@GOTPAGEOFF]
	ldr	x9, [x11]
	mov	w10, #40
	madd	x8, x9, x10, x8
	mov	w9, #127
	str	w9, [x8]
	ldr	w9, [sp, #28]
	str	w9, [x8, #4]
	ldr	w9, [sp, #24]
	str	w9, [x8, #8]
	ldr	x9, [x28]
	str	x9, [x8, #32]
	madd	x9, x24, x27, x20
	ldr	x10, [x9, #16]
	str	x10, [x8, #24]
	ldur	d0, [x9, #4]
	stur	d0, [x8, #12]
	ldr	x8, [x11]
	add	x8, x8, #1
	str	x8, [x11]
Lloh13:
	adrp	x9, _MAX_CHANNELS@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MAX_CHANNELS@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.3:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh16:
	adrp	x8, _MAX_GENTITIES@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MAX_GENTITIES@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #1
	add	x21, x21, #56
	add	w22, w22, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_19
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x20, [x26]
	madd	x9, x24, x27, x20
	ldr	w9, [x9, #48]
	cbz	w9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mul	x9, x24, x27
	ldr	w9, [x20, x9]
Lloh19:
	adrp	x10, _S_AddLoopSounds.loopFrame@PAGE
Lloh20:
	ldr	w10, [x10, _S_AddLoopSounds.loopFrame@PAGEOFF]
	cmp	w9, w10
	b.eq	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	madd	x28, x24, x27, x20
	ldr	x8, [x28, #40]
	ldr	w0, [x28, #32]
	cmp	x8, #0
	mov	w8, #127
	mov	w9, #90
	csel	w1, w9, w8, eq
	add	x2, sp, #28
	add	x3, sp, #24
	bl	_S_SpatializeOrigin
	ldr	x8, [x28, #24]!
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	str	w9, [x8]
	add	x9, x24, #1
Lloh21:
	adrp	x8, _MAX_GENTITIES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAX_GENTITIES@GOTPAGEOFF]
Lloh23:
	ldrsw	x8, [x8]
	cmp	x9, x8
	b.ge	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x22
	mov	x23, x21
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	x23, x23, #56
	add	w25, w25, #1
	cmp	w8, w25
	b.le	LBB0_14
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x26]
	add	x10, x9, x23
	ldr	w11, [x10, #104]
	cbz	w11, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	x10, [x10, #72]
	cbnz	x10, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x19, x9, x23
	ldr	x9, [x19, #80]
	ldr	x10, [x28]
	cmp	x9, x10
	b.ne	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=2
Lloh24:
	adrp	x8, _S_AddLoopSounds.loopFrame@PAGE
Lloh25:
	ldr	w8, [x8, _S_AddLoopSounds.loopFrame@PAGEOFF]
	str	w8, [x19, #56]
	ldr	x8, [x19, #96]
	ldr	w0, [x19, #88]
	cmp	x8, #0
	mov	w8, #127
	mov	w9, #90
	csel	w1, w9, w8, eq
	add	x2, sp, #20
	add	x3, sp, #16
	bl	_S_SpatializeOrigin
	ldr	x8, [x19, #80]
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	str	w9, [x8]
	ldr	w8, [sp, #20]
	ldr	w9, [sp, #28]
	add	w8, w9, w8
	str	w8, [sp, #28]
	ldr	w8, [sp, #16]
	ldr	w9, [sp, #24]
	add	w8, w9, w8
	str	w8, [sp, #24]
Lloh26:
	adrp	x8, _MAX_GENTITIES@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MAX_GENTITIES@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	b	LBB0_9
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	ldp	w9, w10, [sp, #24]
	orr	w11, w10, w9
	cbz	w11, LBB0_4
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	w10, #256
	b.lt	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #255
	str	w8, [sp, #28]
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w9, #256
	b.lt	LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #255
	str	w8, [sp, #24]
	b	LBB0_2
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdr	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdr	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_S_AddLoopSounds.loopFrame,4,2 ; @S_AddLoopSounds.loopFrame
	.comm	_numLoopChannels,8,3            ; @numLoopChannels
	.comm	_MAX_GENTITIES,4,2              ; @MAX_GENTITIES
	.comm	_loopSounds,8,3                 ; @loopSounds
	.comm	_loop_channels,8,3              ; @loop_channels
	.comm	_MAX_CHANNELS,8,3               ; @MAX_CHANNELS
.subsections_via_symbols
