	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_ClearSoundBuffer             ## -- Begin function S_ClearSoundBuffer
	.p2align	4, 0x90
_S_ClearSoundBuffer:                    ## @S_ClearSoundBuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_s_soundStarted@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_loopSounds@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MAX_GENTITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_Com_Memset
	movq	_loop_channels@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MAX_CHANNELS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_Com_Memset
	movq	_numLoopChannels@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorl	%eax, %eax
	callq	_S_ChannelSetup
	movq	_s_rawend@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_dma@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r14d
	xorl	%eax, %eax
	callq	_SNDDMA_BeginPainting
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	xorl	%esi, %esi
	cmpl	$8, %r14d
	sete	%sil
	shll	$7, %esi
	movl	(%rbx), %eax
	imull	4(%rbx), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$3, %edx
	callq	_Snd_Memset
LBB0_3:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_SNDDMA_Submit                  ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_s_soundStarted,4,2             ## @s_soundStarted
	.comm	_loopSounds,4,2                 ## @loopSounds
	.comm	_MAX_GENTITIES,4,2              ## @MAX_GENTITIES
	.comm	_loop_channels,4,2              ## @loop_channels
	.comm	_MAX_CHANNELS,4,2               ## @MAX_CHANNELS
	.comm	_numLoopChannels,8,3            ## @numLoopChannels
	.comm	_s_rawend,8,3                   ## @s_rawend
	.comm	_dma,16,3                       ## @dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_ClearSoundBuffer             ; -- Begin function S_ClearSoundBuffer
	.p2align	2
_S_ClearSoundBuffer:                    ; @S_ClearSoundBuffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _s_soundStarted@GOTPAGE
Lloh1:
	ldr	x8, [x8, _s_soundStarted@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _loopSounds@GOTPAGE
Lloh4:
	ldr	x8, [x8, _loopSounds@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _MAX_GENTITIES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_GENTITIES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_Com_Memset
Lloh9:
	adrp	x8, _loop_channels@GOTPAGE
Lloh10:
	ldr	x8, [x8, _loop_channels@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _MAX_CHANNELS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX_CHANNELS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_Com_Memset
Lloh15:
	adrp	x8, _numLoopChannels@GOTPAGE
Lloh16:
	ldr	x8, [x8, _numLoopChannels@GOTPAGEOFF]
Lloh17:
	str	xzr, [x8]
	bl	_S_ChannelSetup
Lloh18:
	adrp	x8, _s_rawend@GOTPAGE
Lloh19:
	ldr	x8, [x8, _s_rawend@GOTPAGEOFF]
Lloh20:
	str	xzr, [x8]
Lloh21:
	adrp	x19, _dma@GOTPAGE
Lloh22:
	ldr	x19, [x19, _dma@GOTPAGEOFF]
	ldr	w20, [x19]
	bl	_SNDDMA_BeginPainting
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.2:
	cmp	w20, #8
	cset	w8, eq
	lsl	w1, w8, #7
	ldp	w9, w8, [x19]
	mul	w8, w9, w8
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #3
	bl	_Snd_Memset
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_SNDDMA_Submit
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_s_soundStarted,4,2             ; @s_soundStarted
	.comm	_loopSounds,4,2                 ; @loopSounds
	.comm	_MAX_GENTITIES,4,2              ; @MAX_GENTITIES
	.comm	_loop_channels,4,2              ; @loop_channels
	.comm	_MAX_CHANNELS,4,2               ; @MAX_CHANNELS
	.comm	_numLoopChannels,8,3            ; @numLoopChannels
	.comm	_s_rawend,8,3                   ; @s_rawend
	.comm	_dma,16,3                       ; @dma
.subsections_via_symbols
