	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_UpdateSound                  ## -- Begin function I_UpdateSound
	.p2align	4, 0x90
_I_UpdateSound:                         ## @I_UpdateSound
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SAMPLECOUNT@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	_mixbuffer@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	leaq	(%r8,%rax,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	2(%r8), %r13
	movq	_NUM_CHANNELS@GOTPCREL(%rip), %r9
	movl	(%r9), %r14d
	movq	_channels@GOTPCREL(%rip), %r11
	movq	_channelstepremainder@GOTPCREL(%rip), %r10
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %r15d
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-32767, %ebx                   ## imm = 0x8001
	movl	$-32768, %eax                   ## imm = 0x8000
	cmovll	%eax, %ebx
	movw	%r15w, (%r8)
	cmpl	$32767, %ebx                    ## imm = 0x7FFF
	movl	$32767, %eax                    ## imm = 0x7FFF
	cmovgel	%eax, %ebx
	movw	%bx, (%r13)
	addq	$4, %r8
	addq	$4, %r13
	cmpq	-48(%rbp), %r8                  ## 8-byte Folded Reload
	je	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%r14d, %r14d
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	incq	%r15
	movslq	(%r9), %r14
	cmpq	%r14, %r15
	jge	LBB0_9
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r11), %rax
	movq	(%rax,%r15,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	(%rsi), %ecx
	movq	_channelleftvol_lookup@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	(%rdi,%r15,8), %rdi
	addl	(%rdi,%rcx,8), %r12d
	movq	_channelrightvol_lookup@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	(%rdi,%r15,8), %rdi
	addl	(%rdi,%rcx,8), %ebx
	movq	_channelstep@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r10), %rdi
	movl	(%rdi,%r15,4), %edx
	addl	(%rcx,%r15,8), %edx
	movl	%edx, (%rdi,%r15,4)
	sarl	$16, %edx
	movslq	%edx, %rcx
	leaq	(%rsi,%rcx,4), %rcx
	movq	%rcx, (%rax,%r15,8)
	movq	(%r10), %rax
	movzwl	(%rax,%r15,4), %ecx
	movl	%ecx, (%rax,%r15,4)
	movq	(%r11), %rax
	movq	(%rax,%r15,8), %rcx
	movq	_channelsend@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	(%rdx,%r15,8), %rcx
	jb	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	$0, (%rax,%r15,8)
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movw	$32767, %r15w                   ## imm = 0x7FFF
	cmpl	$32767, %r12d                   ## imm = 0x7FFF
	jg	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movw	$-32768, %r15w                  ## imm = 0x8000
	cmpl	$-32768, %r12d                  ## imm = 0x8000
	jge	LBB0_11
	jmp	LBB0_12
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mixbuffer,8,3                  ## @mixbuffer
	.comm	_SAMPLECOUNT,4,2                ## @SAMPLECOUNT
	.comm	_NUM_CHANNELS,4,2               ## @NUM_CHANNELS
	.comm	_channels,8,3                   ## @channels
	.comm	_channelleftvol_lookup,8,3      ## @channelleftvol_lookup
	.comm	_channelrightvol_lookup,8,3     ## @channelrightvol_lookup
	.comm	_channelstep,8,3                ## @channelstep
	.comm	_channelstepremainder,8,3       ## @channelstepremainder
	.comm	_channelsend,8,3                ## @channelsend
	.comm	_flag,8,3                       ## @flag
	.comm	_stderr,4,2                     ## @stderr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_UpdateSound                  ; -- Begin function I_UpdateSound
	.p2align	2
_I_UpdateSound:                         ; @I_UpdateSound
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
Lloh0:
	adrp	x8, _SAMPLECOUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAMPLECOUNT@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x8]
	cbz	w9, LBB0_14
; %bb.1:
Lloh3:
	adrp	x8, _mixbuffer@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mixbuffer@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x9, x8, x9, lsl #2
	add	x10, x8, #2
Lloh6:
	adrp	x11, _NUM_CHANNELS@GOTPAGE
Lloh7:
	ldr	x11, [x11, _NUM_CHANNELS@GOTPAGEOFF]
	ldr	w4, [x11]
Lloh8:
	adrp	x12, _channels@GOTPAGE
Lloh9:
	ldr	x12, [x12, _channels@GOTPAGEOFF]
Lloh10:
	adrp	x13, _channelleftvol_lookup@GOTPAGE
Lloh11:
	ldr	x13, [x13, _channelleftvol_lookup@GOTPAGEOFF]
Lloh12:
	adrp	x14, _channelrightvol_lookup@GOTPAGE
Lloh13:
	ldr	x14, [x14, _channelrightvol_lookup@GOTPAGEOFF]
Lloh14:
	adrp	x15, _channelstep@GOTPAGE
Lloh15:
	ldr	x15, [x15, _channelstep@GOTPAGEOFF]
Lloh16:
	adrp	x16, _channelstepremainder@GOTPAGE
Lloh17:
	ldr	x16, [x16, _channelstepremainder@GOTPAGEOFF]
Lloh18:
	adrp	x17, _channelsend@GOTPAGE
Lloh19:
	ldr	x17, [x17, _channelsend@GOTPAGEOFF]
	mov	w0, #-32768
	mov	w1, #32767
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w2, #0
	mov	w3, #0
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	strh	w3, [x8], #4
	cmn	w2, #8, lsl #12                 ; =32768
	csel	w2, w2, w0, gt
	cmp	w2, w1
	csel	w2, w2, w1, lt
	strh	w2, [x10], #4
	cmp	x8, x9
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w4, #1
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x5, #0
	mov	w3, #0
	mov	w2, #0
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x5, x5, #1
	ldrsw	x4, [x11]
	cmp	x5, x4
	b.ge	LBB0_10
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x4, [x12]
	ldr	x6, [x4, x5, lsl #3]
	cbz	x6, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w7, [x6]
	ldr	x19, [x13]
	lsl	x20, x5, #3
	ldr	x19, [x19, x20]
	lsl	x7, x7, #3
	ldr	w19, [x19, x7]
	ldr	x21, [x14]
	ldr	x21, [x21, x20]
	add	w3, w3, w19
	ldr	w7, [x21, x7]
	ldr	x19, [x15]
	ldr	w19, [x19, x20]
	add	w2, w2, w7
	ldr	x7, [x16]
	lsl	x21, x5, #2
	ldr	w22, [x7, x21]
	add	w19, w22, w19
	str	w19, [x7, x21]
	asr	w7, w19, #16
	add	x6, x6, w7, sxtw #2
	str	x6, [x4, x20]
	ldr	x4, [x16]
	ldrh	w6, [x4, x21]
	str	w6, [x4, x21]
	ldr	x4, [x12]
	ldr	x6, [x4, x20]
	ldr	x7, [x17]
	ldr	x7, [x7, x20]
	cmp	x6, x7
	b.lo	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	str	xzr, [x4, x5, lsl #3]
	b	LBB0_6
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w3, #8, lsl #12                 ; =32768
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w3, #32767
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	cmn	w3, #8, lsl #12                 ; =32768
	b.ge	LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w3, #32768
	b	LBB0_3
LBB0_14:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_mixbuffer,8,3                  ; @mixbuffer
	.comm	_SAMPLECOUNT,4,2                ; @SAMPLECOUNT
	.comm	_NUM_CHANNELS,4,2               ; @NUM_CHANNELS
	.comm	_channels,8,3                   ; @channels
	.comm	_channelleftvol_lookup,8,3      ; @channelleftvol_lookup
	.comm	_channelrightvol_lookup,8,3     ; @channelrightvol_lookup
	.comm	_channelstep,8,3                ; @channelstep
	.comm	_channelstepremainder,8,3       ; @channelstepremainder
	.comm	_channelsend,8,3                ; @channelsend
	.comm	_flag,8,3                       ; @flag
	.comm	_stderr,4,2                     ; @stderr
.subsections_via_symbols
