// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/sonic.c
// Function: processStreamInput
static int processStreamInput(sonicStream stream) {
  int originalNumOutputSamples = stream->numOutputSamples;
  float rate = stream->rate * stream->pitch;
  float localSpeed;

  if (stream->numInputSamples == 0) {
    return 1;
  }
  localSpeed =
      stream->numInputSamples * stream->samplePeriod / stream->inputPlayTime;
  if (localSpeed > 1.00001 || localSpeed < 0.99999) {
    changeSpeed(stream, localSpeed);
  } else {
    if (!copyInputToOutput(stream, stream->numInputSamples)) {
      return 0;
    }
  }
  if (rate != 1.0f) {
    if (!adjustRate(stream, rate, originalNumOutputSamples)) {
      return 0;
    }
  }
  if (stream->volume != 1.0f) {
    /* Adjust output volume. */
    scaleSamples(
        stream->outputBuffer + originalNumOutputSamples * stream->numChannels,
        (stream->numOutputSamples - originalNumOutputSamples) *
            stream->numChannels,
        stream->volume);
  }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movslq 0x60(%rdi), %r13
pushq $0x1
popq %rax
testq %r13, %r13
je 0x20fe
movq %rdi, %r14
movss 0x34(%rdi), %xmm0
mulss 0x30(%rdi), %xmm0
movss %xmm0, 0x14(%rsp)
movl 0x64(%rdi), %ebx
cvtsi2ss %r13d, %xmm3
mulss 0x38(%rdi), %xmm3
divss 0x3c(%rdi), %xmm3
cvtss2sd %xmm3, %xmm2
ucomisd 0x1729(%rip), %xmm2     # 0x3068
movl %ebx, 0x34(%rsp)
ja 0x1997
movsd 0x1723(%rip), %xmm0     # 0x3070
ucomisd %xmm2, %xmm0
ja 0x1997
movq %r14, %rdi
movl %r13d, %esi
callq 0x23ab
testl %eax, %eax
je 0x20fc
movslq 0x64(%r14), %rdi
movslq 0x50(%r14), %rax
imulq %rax, %rdi
addq %rdi, %rdi
addq 0x8(%r14), %rdi
movq (%r14), %rsi
movq %r13, %rdx
imulq %rax, %rdx
addq %rdx, %rdx
callq 0x10f0
addl %r13d, 0x64(%r14)
movl %r13d, %r15d
jmp 0x1dbf
movl 0x74(%r14), %ecx
movq %rcx, 0x58(%rsp)
cmpl %ecx, %r13d
jl 0x1dca
movss 0x1667(%rip), %xmm0     # 0x3018
movaps %xmm3, %xmm1
cmpltps %xmm0, %xmm1
movss 0x165c(%rip), %xmm4     # 0x301c
movaps %xmm4, %xmm0
cmpltps %xmm3, %xmm0
andps %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x163c(%rip), %xmm0     # 0x3014
cmpltps %xmm3, %xmm0
movaps %xmm3, %xmm1
cmpltps %xmm4, %xmm1
andps %xmm0, %xmm1
movss %xmm1, 0x18(%rsp)
subss %xmm3, %xmm4
movaps %xmm4, 0x60(%rsp)
movss 0x1623(%rip), %xmm0     # 0x3020
addss %xmm3, %xmm0
movss %xmm0, 0x50(%rsp)
movsd 0x1669(%rip), %xmm0     # 0x3078
addsd %xmm2, %xmm0
movsd %xmm0, 0x38(%rsp)
xorl %ebx, %ebx
movaps %xmm3, 0x40(%rsp)
movsd %xmm2, 0x28(%rsp)
movq %r13, 0x8(%rsp)
movl 0x50(%r14), %ecx
movl %ecx, %eax
imull %ebx, %eax
movslq %eax, %r12
addq %r12, %r12
addq (%r14), %r12
testb $0x1, 0x1c(%rsp)
je 0x1a52
movss 0x40(%r14), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x1a70
testb $0x1, 0x18(%rsp)
je 0x1b23
movss 0x40(%r14), %xmm0
ucomiss 0x15be(%rip), %xmm0     # 0x3028
jbe 0x1b23
movl 0x60(%r14), %eax
mulss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm0
cvtss2sd 0x38(%r14), %xmm1
mulsd 0x38(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x15cc(%rip), %xmm1     # 0x3060
subsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
subl %ebx, %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
cvttss2si %xmm0, %r15d
cmoval %eax, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x23ab
testl %eax, %eax
je 0x1dca
movslq 0x64(%r14), %rdi
movslq 0x50(%r14), %rax
imulq %rax, %rdi
addq %rdi, %rdi
addq 0x8(%r14), %rdi
movslq %r15d, %rdx
imulq %rax, %rdx
addq %rdx, %rdx
movq %r12, %rsi
callq 0x10f0
movaps 0x40(%rsp), %xmm3
addl %r15d, 0x64(%r14)
cvtsi2ss %r15d, %xmm0
mulss 0x38(%r14), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x38(%rsp), %xmm0
divsd 0x28(%rsp), %xmm0
cvtss2sd 0x40(%r14), %xmm1
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x40(%r14)
jmp 0x1da8
movl %ebx, 0x20(%rsp)
movl 0x6c(%r14), %r15d
movl 0x70(%r14), %ebp
movl 0x7c(%r14), %eax
pushq $0x1
popq %rdx
movl %edx, %ebx
cmpl $0xfa1, %eax            # imm = 0xFA1
jl 0x1b53
cmpl $0x0, 0x4c(%r14)
movl %edx, %ebx
jne 0x1b53
xorl %edx, %edx
movl $0xfa0, %esi            # imm = 0xFA0
divl %esi
movl %eax, %ebx
xorl $0x1, %ecx
movl %ebx, %eax
xorl $0x1, %eax
orl %ecx, %eax
jne 0x1b69
movq %r12, %rdi
movl %r15d, %esi
movl %ebp, %edx
jmp 0x1be0
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x24d7
movq 0x18(%r14), %rdi
movl %r15d, %eax
cltd
idivl %ebx
movl %eax, %esi
movl %ebp, %eax
cltd
idivl %ebx
movl %eax, %edx
leaq 0x4(%rsp), %rcx
movq %rsp, %r8
callq 0x23e9
cmpl $0x1, %ebx
je 0x1bed
imull %ebx, %eax
leal (,%rbx,4), %ecx
movl %eax, %ebp
subl %ecx, %ebp
leal (%rax,%rbx,4), %eax
movl 0x6c(%r14), %ecx
cmpl %ecx, %ebp
cmovlel %ecx, %ebp
movl 0x70(%r14), %ebx
cmpl %ebx, %eax
cmovll %eax, %ebx
cmpl $0x1, 0x50(%r14)
jne 0x1bca
movq %r12, %rdi
jmp 0x1bdc
movq %r14, %rdi
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x24d7
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
leaq 0x4(%rsp), %rcx
movq %rsp, %r8
callq 0x23e9
movl 0x4(%rsp), %ecx
movl %eax, %r13d
testl %ecx, %ecx
je 0x1c24
movl 0x80(%r14), %edx
movl %eax, %r13d
testl %edx, %edx
je 0x1c24
leal (%rcx,%rcx,2), %esi
movl %eax, %r13d
cmpl (%rsp), %esi
jl 0x1c24
leal (%rcx,%rcx), %esi
imull $0x3, 0x84(%r14), %edi
cmpl %edi, %esi
cmovlel %eax, %edx
movl %edx, %r13d
movaps 0x40(%rsp), %xmm1
movss 0x13eb(%rip), %xmm0     # 0x301c
ucomiss %xmm0, %xmm1
movl %ecx, 0x84(%r14)
movl %eax, 0x80(%r14)
movslq 0x50(%r14), %rbx
cvtsi2ss %r13d, %xmm0
jbe 0x1ca5
ucomiss 0x13c4(%rip), %xmm1     # 0x3018
divss 0x50(%rsp), %xmm0
cvttss2si %xmm0, %rbp
cmovbl %r13d, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x23ab
testl %eax, %eax
je 0x1d29
movslq 0x64(%r14), %rdx
imulq %rbx, %rdx
addq %rdx, %rdx
addq 0x8(%r14), %rdx
movl %ebx, %eax
imull %r13d, %eax
cltq
leaq (%r12,%rax,2), %r8
movl %ebp, %edi
movl %ebx, %esi
movq %r12, %rcx
callq 0x252b
addl %ebp, 0x64(%r14)
jmp 0x1d2b
movss 0x1367(%rip), %xmm2     # 0x3014
ucomiss %xmm1, %xmm2
mulss %xmm1, %xmm0
divss 0x60(%rsp), %xmm0
cvttss2si %xmm0, %r15
cmovbl %r13d, %r15d
leal (%r15,%r13), %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x23ab
testl %eax, %eax
je 0x1d4b
movslq %r13d, %rdx
movslq 0x64(%r14), %rdi
imulq %rbx, %rdi
addq %rdi, %rdi
addq 0x8(%r14), %rdi
imulq %rbx, %rdx
addq %rdx, %rdx
movq %r12, %rsi
callq 0x10f0
movl 0x64(%r14), %eax
addl %r13d, %eax
imull %ebx, %eax
movslq %eax, %rdx
addq %rdx, %rdx
addq 0x8(%r14), %rdx
movl %ebx, %eax
imull %r13d, %eax
cltq
leaq (%r12,%rax,2), %rcx
movl %r15d, %edi
movl %ebx, %esi
movq %r12, %r8
callq 0x252b
addl %ebp, 0x64(%r14)
jmp 0x1d4e
xorl %ebp, %ebp
movl 0x20(%rsp), %ebx
addl %ebp, %r13d
movaps 0x40(%rsp), %xmm3
movss 0x12d9(%rip), %xmm0     # 0x3018
ucomiss %xmm3, %xmm0
movl %r13d, %r15d
movl %ebp, %eax
ja 0x1d69
jmp 0x1d9f
xorl %r15d, %r15d
movl 0x20(%rsp), %ebx
movaps 0x40(%rsp), %xmm3
ucomiss 0x12b6(%rip), %xmm3     # 0x3014
jbe 0x1d9c
addl %r15d, %r13d
movl %r13d, %ebp
movl %r15d, %eax
cvtsi2ss %ebp, %xmm0
cvtsi2ss %r15d, %xmm1
cvtsi2ssl 0x60(%r14), %xmm2
mulss 0x3c(%r14), %xmm1
divss %xmm2, %xmm1
mulss 0x38(%r14), %xmm0
subss %xmm1, %xmm0
addss 0x40(%r14), %xmm0
movss %xmm0, 0x40(%r14)
movl %eax, %ebp
jmp 0x1d9f
movl %r15d, %ebp
testl %ebp, %ebp
movq 0x8(%rsp), %r13
je 0x1dca
addl %ebx, %r15d
movq 0x58(%rsp), %rax
addl %r15d, %eax
movl %r15d, %ebx
cmpl %r13d, %eax
jle 0x1a2b
movq %r14, %rdi
movl %r15d, %esi
callq 0x2354
movss 0x14(%rsp), %xmm0
ucomiss 0x1245(%rip), %xmm0     # 0x301c
movq %r14, %r15
movl 0x34(%rsp), %ebp
jne 0x1de2
jnp 0x1e22
movl 0x7c(%r15), %esi
movaps %xmm0, %xmm1
cvtsi2ss %esi, %xmm0
divss %xmm1, %xmm0
cvttss2si %xmm0, %ebx
movslq 0x50(%r15), %r12
movl $0x4001, %eax           # imm = 0x4001
cmpl %eax, %ebx
setge %cl
cmpl %eax, %esi
setge %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x1e15
sarl %ebx
sarl %esi
jmp 0x1dfe
movl 0x64(%r15), %r14d
subl %ebp, %r14d
jne 0x1ea5
movss 0x2c(%r15), %xmm0
ucomiss 0x11ed(%rip), %xmm0     # 0x301c
jne 0x1e37
jnp 0x1ee2
movl 0x50(%r15), %ecx
movl 0x64(%r15), %r10d
subl %ebp, %r10d
imull %ecx, %r10d
imull %ebp, %ecx
movslq %ecx, %rcx
addq %rcx, %rcx
addq 0x8(%r15), %rcx
mulss 0x11c9(%rip), %xmm0     # 0x3024
cvttss2si %xmm0, %edx
xorl %esi, %esi
movl $0xffff8001, %edi       # imm = 0xFFFF8001
pushq $0x1
popq %rax
movl $0x7fff, %r9d           # imm = 0x7FFF
cmpl %esi, %r10d
je 0x20fe
movswl (%rcx,%rsi,2), %r8d
imull %edx, %r8d
sarl $0x8, %r8d
cmpl $0xffff8002, %r8d       # imm = 0xFFFF8002
cmovll %edi, %r8d
cmpl %r9d, %r8d
jl 0x1e9b
movl $0x7fff, %r8d           # imm = 0x7FFF
movw %r8w, (%rcx,%rsi,2)
incq %rsi
jmp 0x1e6f
movl 0x58(%r15), %eax
movl 0x68(%r15), %ecx
leal (%rcx,%r14), %edx
cmpl %eax, %edx
movl %esi, 0x28(%rsp)
jle 0x1eea
movl %eax, %ecx
sarl %ecx
addl %r14d, %eax
addl %ecx, %eax
movl %eax, 0x58(%r15)
movq 0x10(%r15), %rdi
imull %r12d, %eax
addl %eax, %eax
movslq %eax, %rsi
callq 0x1140
movq %rax, 0x10(%r15)
movl 0x68(%r15), %ecx
jmp 0x1eee
pushq $0x1
popq %rax
jmp 0x20fe
movq 0x10(%r15), %rax
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%rax,%rcx,2), %rdi
movl %r12d, %eax
imull %ebp, %eax
movslq %eax, %rsi
addq %rsi, %rsi
addq 0x8(%r15), %rsi
movslq %r14d, %r14
movq %r12, %rdx
imulq %r14, %rdx
addq %rdx, %rdx
callq 0x10f0
movl %ebp, 0x64(%r15)
addl 0x68(%r15), %r14d
movq %r15, 0x8(%rsp)
movl %r14d, 0x68(%r15)
xorl %r13d, %r13d
testl %r12d, %r12d
movl $0x0, %eax
movq %r12, 0x60(%rsp)
cmovgl %r12d, %eax
movl %eax, 0x1c(%rsp)
leaq 0x1135(%rip), %r12      # 0x3080
xorl %ecx, %ecx
leal -0xc(%r14), %eax
cltq
cmpq %rax, %rcx
jge 0x210d
movq %rcx, 0x70(%rsp)
imulq 0x60(%rsp), %rcx
movq 0x8(%rsp), %r14
movl 0x48(%r14), %edx
addq %rcx, %rcx
movq %rcx, 0x50(%rsp)
movl 0x44(%r14), %eax
incl %eax
movl %eax, %ecx
imull %ebx, %ecx
imull 0x28(%rsp), %edx
cmpl %edx, %ecx
jle 0x20dc
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x23ab
testl %eax, %eax
je 0x20fc
movl 0x48(%r14), %edx
movl 0x64(%r14), %eax
movl %eax, 0x14(%rsp)
imull 0x60(%rsp), %eax
cltq
addq %rax, %rax
addq 0x8(%r14), %rax
movq 0x10(%r14), %r9
addq 0x50(%rsp), %r9
movl %edx, %ecx
imull 0x28(%rsp), %ecx
notl %ecx
movl %ecx, 0x18(%rsp)
xorl %esi, %esi
movl %edx, 0x38(%rsp)
cmpl 0x1c(%rsp), %esi
je 0x20c7
movl %esi, 0x58(%rsp)
movq %rax, 0x40(%rsp)
movl 0x44(%r14), %eax
incl %eax
imull %ebx, %eax
addl 0x18(%rsp), %eax
imull $0x32, %eax, %eax
cltd
idivl %ebx
movl %edx, %ecx
movl %ebx, %r15d
subl %edx, %r15d
movslq 0x50(%r14), %rdi
movslq %eax, %rsi
addq %rdi, %rdi
leaq (%r12,%rsi,2), %r14
addq %rsi, %rsi
xorl %r8d, %r8d
pushq $0x2
popq %rbp
movq %r9, 0x20(%rsp)
xorl %r10d, %r10d
cmpq $0x4b2, %rbp            # imm = 0x4B2
je 0x207e
movswl -0x2(%r14,%rbp), %edx
imull %r15d, %edx
leaq (%rsi,%rbp), %rax
movswl (%r12,%rax), %eax
imull %ecx, %eax
addl %edx, %eax
addl %eax, %eax
cltd
idivl %ebx
movswl (%r9), %edx
imull %eax, %edx
leal (%rdx,%r8), %r11d
movl %r11d, %eax
xorl %r8d, %eax
jns 0x2072
movl %r8d, %eax
sarl $0x1f, %eax
orl $0x1, %eax
xorl %r8d, %edx
cmovsl %r13d, %eax
addl %eax, %r10d
addq %rdi, %r9
addq $0x64, %rbp
movl %r11d, %r8d
jmp 0x2026
movw $0x7fff, %ax            # imm = 0x7FFF
testl %r10d, %r10d
movq 0x8(%rsp), %r14
movl 0x38(%rsp), %edx
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %r9
movl 0x58(%rsp), %esi
jg 0x20b2
js 0x20a9
shrl $0x10, %r8d
movl %r8d, %eax
jmp 0x20ad
movw $0x8000, %ax            # imm = 0x8000
movq 0x40(%rsp), %rcx
movw %ax, (%rcx)
addq $0x2, %rcx
addq $0x2, %r9
incl %esi
movq %rcx, %rax
jmp 0x1fd9
incl %edx
movl %edx, 0x48(%r14)
movl 0x14(%rsp), %eax
incl %eax
movl %eax, 0x64(%r14)
jmp 0x1f78
movl %eax, 0x44(%r14)
cmpl 0x28(%rsp), %eax
jne 0x20eb
andq $0x0, 0x44(%r14)
movq 0x70(%rsp), %rcx
incq %rcx
movl 0x68(%r14), %r14d
jmp 0x1f4d
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rcx, %rcx
movq 0x8(%rsp), %r15
movl 0x34(%rsp), %ebp
je 0x1e22
movl %r14d, %eax
subl %ecx, %eax
je 0x2157
movq 0x8(%rsp), %rbx
movq %rcx, %r14
movslq 0x50(%rbx), %rcx
movq 0x10(%rbx), %rdi
movslq %r14d, %rdx
imulq %rcx, %rdx
leaq (%rdi,%rdx,2), %rsi
movslq %eax, %rdx
imulq %rcx, %rdx
addq %rdx, %rdx
callq 0x1150
movq %r14, %rcx
movl 0x68(%rbx), %r14d
subl %ecx, %r14d
movq 0x8(%rsp), %r15
movl %r14d, 0x68(%r15)
jmp 0x1e22