	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_PaintChannelFromWavelet      ## -- Begin function S_PaintChannelFromWavelet
	.p2align	4, 0x90
_S_PaintChannelFromWavelet:             ## @S_PaintChannelFromWavelet
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%edx, %r13d
	movq	%rsi, %r11
	movq	_snd_vol@GOTPCREL(%rip), %rax
	movq	_paintbuffer@GOTPCREL(%rip), %r10
	movq	_SND_CHUNK_SIZE_FLOAT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	shll	$2, %esi
	movq	(%r11), %r14
	xorl	%r15d, %r15d
	cmpl	%ecx, %esi
	jg	LBB0_3
## %bb.1:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	subl	%esi, %ebx
	incl	%r15d
	movq	(%r14), %r14
	cmpl	%esi, %ebx
	jge	LBB0_2
LBB0_3:
	movl	(%rdi), %r9d
	movl	4(%rdi), %esi
	movl	(%rax), %edi
	movq	(%r10), %r12
	movq	_sfxScratchIndex@GOTPCREL(%rip), %rax
	movq	_sfxScratchPointer@GOTPCREL(%rip), %r10
	cmpl	(%rax), %r15d
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_5
## %bb.4:
	cmpq	%r11, (%r10)
	je	LBB0_6
LBB0_5:
	movq	_sfxScratchBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	movl	%r8d, -64(%rbp)                 ## 4-byte Spill
	movq	%r11, -72(%rbp)                 ## 8-byte Spill
	callq	_S_AdpcmGetSamples
	movl	-64(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	movq	_sfxScratchIndex@GOTPCREL(%rip), %rax
	movl	%r15d, (%rax)
	movq	_sfxScratchPointer@GOTPCREL(%rip), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
LBB0_6:
	testl	%r13d, %r13d
	jle	LBB0_11
## %bb.7:
	movslq	%r8d, %rax
	movq	_sfxScratchBuffer@GOTPCREL(%rip), %r8
	movq	(%r8), %r8
	movl	%r13d, %r13d
	leaq	(%r12,%rax,8), %rdx
	addq	$4, %rdx
	xorl	%r12d, %r12d
	movq	_SND_CHUNK_SIZE@GOTPCREL(%rip), %r15
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r12
	cmpq	%r12, %r13
	je	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%ebx, %rax
	movswl	(%r8,%rax,2), %eax
	imull	%edi, %eax
	movl	%eax, %ecx
	imull	%r9d, %ecx
	sarl	$8, %ecx
	addl	%ecx, -4(%rdx,%r12,8)
	imull	%esi, %eax
	sarl	$8, %eax
	addl	%eax, (%rdx,%r12,8)
	incl	%ebx
	movl	(%r15), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebx
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r14), %r14
	movq	_sfxScratchBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	movq	%r8, %rbx
	callq	_decodeWavelet
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rbx, %r8
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	movq	_sfxScratchIndex@GOTPCREL(%rip), %rax
	incl	(%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_snd_vol,4,2                    ## @snd_vol
	.comm	_paintbuffer,8,3                ## @paintbuffer
	.comm	_SND_CHUNK_SIZE_FLOAT,4,2       ## @SND_CHUNK_SIZE_FLOAT
	.comm	_sfxScratchIndex,4,2            ## @sfxScratchIndex
	.comm	_sfxScratchPointer,8,3          ## @sfxScratchPointer
	.comm	_sfxScratchBuffer,8,3           ## @sfxScratchBuffer
	.comm	_SND_CHUNK_SIZE,4,2             ## @SND_CHUNK_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_PaintChannelFromWavelet      ; -- Begin function S_PaintChannelFromWavelet
	.p2align	2
_S_PaintChannelFromWavelet:             ; @S_PaintChannelFromWavelet
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x21, x4
	mov	x20, x3
	mov	x23, x1
	ldr	x19, [x1]
Lloh0:
	adrp	x8, _snd_vol@GOTPAGE
Lloh1:
	ldr	x8, [x8, _snd_vol@GOTPAGEOFF]
Lloh2:
	adrp	x9, _paintbuffer@GOTPAGE
Lloh3:
	ldr	x9, [x9, _paintbuffer@GOTPAGEOFF]
Lloh4:
	adrp	x10, _SND_CHUNK_SIZE_FLOAT@GOTPAGE
Lloh5:
	ldr	x10, [x10, _SND_CHUNK_SIZE_FLOAT@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	lsl	w10, w10, #2
	cmp	w10, w3
	b.le	LBB0_2
; %bb.1:
	mov	w27, #0
	b	LBB0_4
LBB0_2:
	mov	w27, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w27, w27, #1
	ldr	x19, [x19]
	sub	w20, w20, w10
	cmp	w20, w10
	b.ge	LBB0_3
LBB0_4:
	ldr	x28, [x9]
	ldr	w24, [x8]
	ldr	d8, [x0]
Lloh7:
	adrp	x25, _sfxScratchIndex@GOTPAGE
Lloh8:
	ldr	x25, [x25, _sfxScratchIndex@GOTPAGEOFF]
Lloh9:
	adrp	x9, _sfxScratchPointer@GOTPAGE
Lloh10:
	ldr	x9, [x9, _sfxScratchPointer@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh11:
	ldr	x9, [x9]
	cmp	w27, w8
	ccmp	x9, x23, #0, eq
Lloh12:
	adrp	x26, _sfxScratchBuffer@GOTPAGE
Lloh13:
	ldr	x26, [x26, _sfxScratchBuffer@GOTPAGEOFF]
	b.eq	LBB0_6
; %bb.5:
	ldr	x1, [x26]
	mov	x0, x19
	mov	x22, x2
	bl	_S_AdpcmGetSamples
	mov	x2, x22
	str	w27, [x25]
Lloh14:
	adrp	x8, _sfxScratchPointer@GOTPAGE
Lloh15:
	ldr	x8, [x8, _sfxScratchPointer@GOTPAGEOFF]
Lloh16:
	str	x23, [x8]
LBB0_6:
	cmp	w2, #1
	b.lt	LBB0_11
; %bb.7:
	add	x22, x28, w21, sxtw #3
	ldr	x23, [x26]
Lloh17:
	adrp	x27, _SND_CHUNK_SIZE@GOTPAGE
Lloh18:
	ldr	x27, [x27, _SND_CHUNK_SIZE@GOTPAGEOFF]
	mov	w21, w2
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x22, x22, #8
	mov	x20, x8
	subs	x21, x21, #1
	b.eq	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w20, #1
	ldrsh	w9, [x23, w20, sxtw #1]
	mul	w9, w24, w9
	dup.2s	v0, w9
	mul.2s	v0, v0, v8
	ldr	d1, [x22]
	ssra.2s	v1, v0, #8
	str	d1, [x22]
	ldr	w9, [x27]
	cmp	w8, w9, lsl #1
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x19, [x19]
	ldr	x1, [x26]
	mov	x0, x19
	bl	_decodeWavelet
	mov	w8, #0
	ldr	w9, [x25]
	add	w9, w9, #1
	str	w9, [x25]
	b	LBB0_8
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_snd_vol,4,2                    ; @snd_vol
	.comm	_paintbuffer,8,3                ; @paintbuffer
	.comm	_SND_CHUNK_SIZE_FLOAT,4,2       ; @SND_CHUNK_SIZE_FLOAT
	.comm	_sfxScratchIndex,4,2            ; @sfxScratchIndex
	.comm	_sfxScratchPointer,8,3          ; @sfxScratchPointer
	.comm	_sfxScratchBuffer,8,3           ; @sfxScratchBuffer
	.comm	_SND_CHUNK_SIZE,4,2             ; @SND_CHUNK_SIZE
.subsections_via_symbols
