// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/chorus/chorus.c
// Function: interp
static double
interp(int *data,int length,double t)
    {
    int lo = (int) t;
    int hi = lo + 1;
    int lolo = lo;
    int hihi = hi;
    double mid;
    double fraction;
    double result;

    assert (t >= 0);

    if (lo >= length-1) return data[length-1];

    if (lo > 0) --lolo;
    if (hi < length-1) ++hihi;

    fraction = t - lo;
    mid = (3.0 * data[lo] - data[lolo] + 3.0 * data[hi] - data[hihi]) / 4.0;

    if (fraction < 0.5)
        result = data[lo] + (mid - data[lo]) * 2 * fraction;
    else
        result = mid + (data[hi] - mid) * 2 * (fraction - 0.5);

    return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
cvttsd2si -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1cb1
jmp 0x1cd0
leaq 0x3491(%rip), %rdi      # 0x5149
leaq 0x3491(%rip), %rsi      # 0x5150
movl $0xa9, %edx
leaq 0x348e(%rip), %rcx      # 0x5159
callq 0x10b0
movl -0x24(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x1cf9
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x1e4e
cmpl $0x0, -0x24(%rbp)
jle 0x1d08
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1d1e
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x337e(%rip), %xmm2     # 0x50e8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd 0x3361(%rip), %xmm2     # 0x50e8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
subsd %xmm1, %xmm0
movsd 0x3338(%rip), %xmm1     # 0x50e0
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x3317(%rip), %xmm0     # 0x50d0
ucomisd -0x40(%rbp), %xmm0
jbe 0x1e03
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movsd -0x38(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm2
subsd %xmm2, %xmm0
movsd 0x3305(%rip), %xmm2     # 0x50f0
mulsd %xmm2, %xmm0
movsd -0x40(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x1e44
movsd -0x38(%rbp), %xmm1
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
subsd -0x38(%rbp), %xmm0
movsd 0x32ce(%rip), %xmm2     # 0x50f0
mulsd %xmm2, %xmm0
movsd -0x40(%rbp), %xmm2
movsd 0x329d(%rip), %xmm3     # 0x50d0
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)