double interpolate(n, t, y, z, x, tension, periodic)
int n;
double *t, *y, *z, x;
double tension;
int periodic;
{
  double diff, updiff, reldiff, relupdiff, h;
  double value;
  int is_ascending = (t[n - 1] < t[n]);
  int i = 0, k;
  if (periodic && (x - t[0]) * (x - t[n]) > 0.0)
    x -= ((int)(floor((x - t[0]) / (t[n] - t[0]))) * (t[n] - t[0]));
  for (k = n - i; k > 1;) {
    if (is_ascending ? x >= t[i + (k >> 1)] : x <= t[i + (k >> 1)]) {
      i = i + (k >> 1);
      k = k - (k >> 1);
    } else
      k = k >> 1;
  }
  h = t[i + 1] - t[i];
  diff = x - t[i];
  updiff = t[i + 1] - x;
  reldiff = diff / h;
  relupdiff = updiff / h;
  if (tension == 0.0) {
    value = y[i] +
            diff * ((y[i + 1] - y[i]) / h - h * (z[i + 1] + z[i] * 2.0) / 6.0 +
                    diff * (0.5 * z[i] + diff * (z[i + 1] - z[i]) / (6.0 * h)));
  } else if (tension > 0.0) {
    if (fabs(tension * h) < 0.001)
      value =
          (y[i] * relupdiff + y[i + 1] * reldiff +
           ((z[i] * h * h / 6.0) * quotient_sinh_func(relupdiff, tension * h)) +
           ((z[i + 1] * h * h / 6.0) *
            quotient_sinh_func(reldiff, tension * h)));
    else
      value =
          (((z[i] * sinh(tension * updiff) + z[i + 1] * sinh(tension * diff)) /
            (tension * tension * sinh(tension * h))) +
           (y[i] - z[i] / (tension * tension)) * (updiff / h) +
           (y[i + 1] - z[i + 1] / (tension * tension)) * (diff / h));
  } else {
    if (fabs(tension * h) < 0.001)
      value =
          (y[i] * relupdiff + y[i + 1] * reldiff +
           ((z[i] * h * h / 6.0) * quotient_sin_func(relupdiff, tension * h)) +
           ((z[i + 1] * h * h / 6.0) *
            quotient_sin_func(reldiff, tension * h)));
    else
      value =
          (((z[i] * sin(tension * updiff) + z[i + 1] * sin(tension * diff)) /
            (tension * tension * sin(tension * h))) +
           (y[i] - z[i] / (tension * tension)) * (updiff / h) +
           (y[i + 1] - z[i + 1] / (tension * tension)) * (diff / h));
  }
  return value;
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1258 <interpolate+0x108>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1258 <interpolate+0x108>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
call   1070 <floor@plt>
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x1,-0x74(%rbp)
jle    12f1 <interpolate+0x1a1>
cmpl   $0x0,-0x6c(%rbp)
je     129c <interpolate+0x14c>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%edx
sar    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jae    12c2 <interpolate+0x172>
jmp    12e3 <interpolate+0x193>
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%edx
sar    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     12e3 <interpolate+0x193>
mov    -0x70(%rbp),%eax
mov    -0x74(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x70(%rbp)
mov    -0x74(%rbp),%eax
mov    -0x74(%rbp),%ecx
sar    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x74(%rbp)
jmp    12ec <interpolate+0x19c>
mov    -0x74(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1261 <interpolate+0x111>
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x70(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x70(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1469 <interpolate+0x319>
jp     1469 <interpolate+0x319>
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm3
divsd  -0x60(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
addsd  %xmm4,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
movsd  0xc1c(%rip),%xmm4
divsd  %xmm4,%xmm2
subsd  %xmm2,%xmm3
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
movsd  -0x40(%rbp),%xmm5
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xbd2(%rip),%xmm6
mulsd  -0x60(%rbp),%xmm6
divsd  %xmm6,%xmm5
movsd  0xbc9(%rip),%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    197c <interpolate+0x82c>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    16f6 <interpolate+0x5a6>
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movaps 0xb94(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb68(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    15a6 <interpolate+0x456>
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xb0e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    $0x2,%al
call   1060 <quotient_sinh_func@plt>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xaa7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    $0x2,%al
call   1060 <quotient_sinh_func@plt>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    16f1 <interpolate+0x5a1>
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm3
mulsd  -0x30(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x48(%rbp),%xmm2
divsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm3
mulsd  -0x30(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
divsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1977 <interpolate+0x827>
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movaps 0x919(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x8ed(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1827 <interpolate+0x6d7>
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0x893(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    $0x2,%al
call   1040 <quotient_sin_func@plt>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0xd8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0x829(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    $0x2,%al
call   1040 <quotient_sin_func@plt>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1972 <interpolate+0x822>
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x108(%rbp),%xmm1
ff
movsd  -0x100(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm3
mulsd  -0x30(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x48(%rbp),%xmm2
divsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm3
mulsd  -0x30(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
divsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1977 <interpolate+0x827>
jmp    197c <interpolate+0x82c>
movsd  -0x68(%rbp),%xmm0
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
movapd %xmm0,%xmm5
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
movslq %edi,%rax
movsd  -0x8(%rsi,%rax,8),%xmm6
movsd  (%rsi,%rax,8),%xmm7
test   %r8d,%r8d
je     11f7 <interpolate+0xa7>
movsd  (%rbx),%xmm4
movapd %xmm5,%xmm0
subsd  %xmm4,%xmm0
movapd %xmm5,%xmm2
subsd  %xmm7,%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jbe    11f7 <interpolate+0xa7>
movapd %xmm7,%xmm2
subsd  %xmm4,%xmm2
movsd  %xmm2,(%rsp)
divsd  %xmm2,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm6,0x40(%rsp)
movsd  %xmm7,0x8(%rsp)
call   1070 <floor@plt>
movsd  0x8(%rsp),%xmm7
movsd  0x40(%rsp),%xmm6
movsd  0x20(%rsp),%xmm5
movsd  0x10(%rsp),%xmm1
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
subsd  %xmm0,%xmm5
xor    %eax,%eax
cmp    $0x2,%ebp
jl     124a <interpolate+0xfa>
xor    %edx,%edx
jmp    121d <interpolate+0xcd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sub    %ecx,%ebp
mov    %ebp,%ecx
mov    %ecx,%ebp
mov    %eax,%edx
cmp    $0x1,%ecx
jle    124a <interpolate+0xfa>
mov    %ebp,%ecx
shr    %ecx
lea    (%rcx,%rdx,1),%eax
ucomisd %xmm6,%xmm7
movslq %eax,%rsi
movsd  (%rbx,%rsi,8),%xmm0
jbe    1240 <interpolate+0xf0>
ucomisd %xmm0,%xmm5
jae    1210 <interpolate+0xc0>
jmp    1246 <interpolate+0xf6>
nopw   0x0(%rax,%rax,1)
ucomisd %xmm5,%xmm0
jae    1210 <interpolate+0xc0>
mov    %edx,%eax
jmp    1214 <interpolate+0xc4>
movslq %eax,%rbp
lea    0x1(%rbp),%r12
movsd  (%rbx,%rbp,8),%xmm2
movsd  0x8(%rbx,%rbp,8),%xmm0
movapd %xmm0,%xmm7
subsd  %xmm2,%xmm7
movapd %xmm5,%xmm6
subsd  %xmm2,%xmm6
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1306 <interpolate+0x1b6>
jp     1306 <interpolate+0x1b6>
movsd  (%r15,%rbp,8),%xmm1
movsd  (%r15,%r12,8),%xmm2
movsd  (%r14,%r12,8),%xmm3
movsd  (%r14,%rbp,8),%xmm0
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
unpcklpd %xmm7,%xmm5
unpcklpd %xmm4,%xmm4
mulpd  %xmm5,%xmm4
subsd  %xmm1,%xmm2
shufpd $0x2,%xmm4,%xmm2
movapd 0xd4f(%rip),%xmm4
movsd  %xmm7,%xmm4
divpd  %xmm4,%xmm2
movapd %xmm2,%xmm4
unpckhpd %xmm2,%xmm4
subsd  %xmm4,%xmm2
subsd  %xmm0,%xmm3
mulsd  %xmm6,%xmm3
mulsd  0xd43(%rip),%xmm7
divsd  %xmm7,%xmm3
mulsd  0xd3f(%rip),%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm6,%xmm0
jmp    1601 <interpolate+0x4b1>
subsd  %xmm5,%xmm0
movapd %xmm6,%xmm8
divsd  %xmm7,%xmm8
movapd %xmm0,%xmm4
divsd  %xmm7,%xmm4
movapd %xmm7,%xmm5
mulsd  %xmm1,%xmm5
movapd 0xcd4(%rip),%xmm3
andpd  %xmm5,%xmm3
movsd  %xmm8,0x20(%rsp)
movapd %xmm5,0x40(%rsp)
movsd  0xcdb(%rip),%xmm2
jbe    13f6 <interpolate+0x2a6>
ucomisd %xmm3,%xmm2
jbe    14b4 <interpolate+0x364>
movsd  (%r15,%r12,8),%xmm0
mulsd  %xmm8,%xmm0
movsd  (%r15,%rbp,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%r14,%rbp,8),%xmm0
mulsd  %xmm7,%xmm0
mulsd  %xmm7,%xmm0
divsd  0xc9e(%rip),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm4,%xmm0
movapd %xmm5,%xmm1
mov    $0x2,%al
movapd %xmm7,0x10(%rsp)
call   1060 <quotient_sinh_func@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14,%r12,8),%xmm0
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xc50(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
movapd 0x40(%rsp),%xmm1
mov    $0x2,%al
call   1060 <quotient_sinh_func@plt>
jmp    149c <interpolate+0x34c>
ucomisd %xmm3,%xmm2
jbe    1534 <interpolate+0x3e4>
movsd  (%r15,%r12,8),%xmm0
mulsd  %xmm8,%xmm0
movsd  (%r15,%rbp,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%r14,%rbp,8),%xmm0
mulsd  %xmm7,%xmm0
mulsd  %xmm7,%xmm0
divsd  0xbf3(%rip),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm4,%xmm0
movapd %xmm5,%xmm1
mov    $0x2,%al
movapd %xmm7,0x10(%rsp)
call   1040 <quotient_sin_func@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14,%r12,8),%xmm0
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xba5(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
movapd 0x40(%rsp),%xmm1
mov    $0x2,%al
call   1040 <quotient_sin_func@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
jmp    1605 <interpolate+0x4b5>
movsd  (%r14,%rbp,8),%xmm2
movsd  %xmm2,0x38(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm6,(%rsp)
call   1030 <sinh@plt>
movsd  %xmm0,0x30(%rsp)
movsd  (%r14,%r12,8),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1030 <sinh@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
call   1030 <sinh@plt>
jmp    15b2 <interpolate+0x462>
movsd  (%r14,%rbp,8),%xmm2
movsd  %xmm2,0x38(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm6,(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x30(%rsp)
movsd  (%r14,%r12,8),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1050 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  (%rsp),%xmm4
divsd  %xmm0,%xmm4
movsd  (%r15,%rbp,8),%xmm1
movsd  (%r14,%rbp,8),%xmm0
divsd  %xmm2,%xmm0
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm4,%xmm1
movsd  (%r15,%r12,8),%xmm0
movsd  (%r14,%r12,8),%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @interpolate(i32 %0, double* %1, double* %2, double* %3, double %4, double %5, i32 %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32 %0, i32* %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double %4, double* %12
store double %5, double* %13
store i32 %6, i32* %14
%24 = load double*, double** %9
%25 = load i32, i32* %8
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %24, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %9
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = fcmp olt double %29, %34
%36 = zext i1 %35 to i32
store i32 %36, i32* %21
store i32 0, i32* %22
%37 = load i32, i32* %14
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %85
39: ; preds = %7
%40 = load double, double* %12
%41 = load double*, double** %9
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fsub double %40, %43
%45 = load double, double* %12
%46 = load double*, double** %9
%47 = load i32, i32* %8
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
%50 = load double, double* %49
%51 = fsub double %45, %50
%52 = fmul double %44, %51
%53 = fcmp ogt double %52, 0.000000e+00
br i1 %53, label %54, label %85
54: ; preds = %39
%55 = load double, double* %12
%56 = load double*, double** %9
%57 = getelementptr inbounds double, double* %56, i64 0
%58 = load double, double* %57
%59 = fsub double %55, %58
%60 = load double*, double** %9
%61 = load i32, i32* %8
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %9
%66 = getelementptr inbounds double, double* %65, i64 0
%67 = load double, double* %66
%68 = fsub double %64, %67
%69 = fdiv double %59, %68
%70 = call double @llvm.floor.f64(double %69)
%71 = fptosi double %70 to i32
%72 = sitofp i32 %71 to double
%73 = load double*, double** %9
%74 = load i32, i32* %8
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
%77 = load double, double* %76
%78 = load double*, double** %9
%79 = getelementptr inbounds double, double* %78, i64 0
%80 = load double, double* %79
%81 = fsub double %77, %80
%82 = load double, double* %12
%83 = fneg double %72
%84 = call double @llvm.fmuladd.f64(double %83, double %81, double %82)
store double %84, double* %12
br label %85
85: ; preds = %54, %39, %7
%86 = load i32, i32* %8
%87 = load i32, i32* %22
%88 = sub nsw i32 %86, %87
store i32 %88, i32* %23
br label %89
89: ; preds = %129, %85
%90 = load i32, i32* %23
%91 = icmp sgt i32 %90, 1
br i1 %91, label %92, label %130
92: ; preds = %89
%93 = load i32, i32* %21
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %106
95: ; preds = %92
%96 = load double, double* %12
%97 = load double*, double** %9
%98 = load i32, i32* %22
%99 = load i32, i32* %23
%100 = ashr i32 %99, 1
%101 = add nsw i32 %98, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %97, i64 %102
%104 = load double, double* %103
%105 = fcmp oge double %96, %104
br i1 %105, label %117, label %126
106: ; preds = %92
%107 = load double, double* %12
%108 = load double*, double** %9
%109 = load i32, i32* %22
%110 = load i32, i32* %23
%111 = ashr i32 %110, 1
%112 = add nsw i32 %109, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %108, i64 %113
%115 = load double, double* %114
%116 = fcmp ole double %107, %115
br i1 %116, label %117, label %126
117: ; preds = %106, %95
%118 = load i32, i32* %22
%119 = load i32, i32* %23
%120 = ashr i32 %119, 1
%121 = add nsw i32 %118, %120
store i32 %121, i32* %22
%122 = load i32, i32* %23
%123 = load i32, i32* %23
%124 = ashr i32 %123, 1
%125 = sub nsw i32 %122, %124
store i32 %125, i32* %23
br label %129
126: ; preds = %106, %95
%127 = load i32, i32* %23
%128 = ashr i32 %127, 1
store i32 %128, i32* %23
br label %129
129: ; preds = %126, %117
br label %89
130: ; preds = %89
%131 = load double*, double** %9
%132 = load i32, i32* %22
%133 = add nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %131, i64 %134
%136 = load double, double* %135
%137 = load double*, double** %9
%138 = load i32, i32* %22
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %137, i64 %139
%141 = load double, double* %140
%142 = fsub double %136, %141
store double %142, double* %19
%143 = load double, double* %12
%144 = load double*, double** %9
%145 = load i32, i32* %22
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = fsub double %143, %148
store double %149, double* %15
%150 = load double*, double** %9
%151 = load i32, i32* %22
%152 = add nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %150, i64 %153
%155 = load double, double* %154
%156 = load double, double* %12
%157 = fsub double %155, %156
store double %157, double* %16
%158 = load double, double* %15
%159 = load double, double* %19
%160 = fdiv double %158, %159
store double %160, double* %17
%161 = load double, double* %16
%162 = load double, double* %19
%163 = fdiv double %161, %162
store double %163, double* %18
%164 = load double, double* %13
%165 = fcmp oeq double %164, 0.000000e+00
br i1 %165, label %166, label %229
166: ; preds = %130
%167 = load double*, double** %10
%168 = load i32, i32* %22
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = load double, double* %15
%173 = load double*, double** %10
%174 = load i32, i32* %22
%175 = add nsw i32 %174, 1
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double, double* %173, i64 %176
%178 = load double, double* %177
%179 = load double*, double** %10
%180 = load i32, i32* %22
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %179, i64 %181
%183 = load double, double* %182
%184 = fsub double %178, %183
%185 = load double, double* %19
%186 = fdiv double %184, %185
%187 = load double, double* %19
%188 = load double*, double** %11
%189 = load i32, i32* %22
%190 = add nsw i32 %189, 1
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %188, i64 %191
%193 = load double, double* %192
%194 = load double*, double** %11
%195 = load i32, i32* %22
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %194, i64 %196
%198 = load double, double* %197
%199 = call double @llvm.fmuladd.f64(double %198, double 2.000000e+00, double %193)
%200 = fmul double %187, %199
%201 = fdiv double %200, 6.000000e+00
%202 = fsub double %186, %201
%203 = load double, double* %15
%204 = load double*, double** %11
%205 = load i32, i32* %22
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds double, double* %204, i64 %206
%208 = load double, double* %207
%209 = load double, double* %15
%210 = load double*, double** %11
%211 = load i32, i32* %22
%212 = add nsw i32 %211, 1
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds double, double* %210, i64 %213
%215 = load double, double* %214
%216 = load double*, double** %11
%217 = load i32, i32* %22
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds double, double* %216, i64 %218
%220 = load double, double* %219
%221 = fsub double %215, %220
%222 = fmul double %209, %221
%223 = load double, double* %19
%224 = fmul double 6.000000e+00, %223
%225 = fdiv double %222, %224
%226 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %208, double %225)
%227 = call double @llvm.fmuladd.f64(double %203, double %226, double %202)
%228 = call double @llvm.fmuladd.f64(double %172, double %227, double %171)
store double %228, double* %20
br label %491
229: ; preds = %130
%230 = load double, double* %13
%231 = fcmp ogt double %230, 0.000000e+00
br i1 %231, label %232, label %361
232: ; preds = %229
%233 = load double, double* %13
%234 = load double, double* %19
%235 = fmul double %233, %234
%236 = call double @llvm.fabs.f64(double %235)
%237 = fcmp olt double %236, 1.000000e-03
br i1 %237, label %238, label %289
238: ; preds = %232
%239 = load double*, double** %10
%240 = load i32, i32* %22
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds double, double* %239, i64 %241
%243 = load double, double* %242
%244 = load double, double* %18
%245 = load double*, double** %10
%246 = load i32, i32* %22
%247 = add nsw i32 %246, 1
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds double, double* %245, i64 %248
%250 = load double, double* %249
%251 = load double, double* %17
%252 = fmul double %250, %251
%253 = call double @llvm.fmuladd.f64(double %243, double %244, double %252)
%254 = load double*, double** %11
%255 = load i32, i32* %22
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds double, double* %254, i64 %256
%258 = load double, double* %257
%259 = load double, double* %19
%260 = fmul double %258, %259
%261 = load double, double* %19
%262 = fmul double %260, %261
%263 = fdiv double %262, 6.000000e+00
%264 = load double, double* %18
%265 = load double, double* %13
%266 = load double, double* %19
%267 = fmul double %265, %266
%268 = call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sinh_func to i32 (double, double, ...)*)(double %264, double %267)
%269 = sitofp i32 %268 to double
%270 = call double @llvm.fmuladd.f64(double %263, double %269, double %253)
%271 = load double*, double** %11
%272 = load i32, i32* %22
%273 = add nsw i32 %272, 1
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds double, double* %271, i64 %274
%276 = load double, double* %275
%277 = load double, double* %19
%278 = fmul double %276, %277
%279 = load double, double* %19
%280 = fmul double %278, %279
%281 = fdiv double %280, 6.000000e+00
%282 = load double, double* %17
%283 = load double, double* %13
%284 = load double, double* %19
%285 = fmul double %283, %284
%286 = call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sinh_func to i32 (double, double, ...)*)(double %282, double %285)
%287 = sitofp i32 %286 to double
%288 = call double @llvm.fmuladd.f64(double %281, double %287, double %270)
store double %288, double* %20
br label %360
289: ; preds = %232
%290 = load double*, double** %11
%291 = load i32, i32* %22
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds double, double* %290, i64 %292
%294 = load double, double* %293
%295 = load double, double* %13
%296 = load double, double* %16
%297 = fmul double %295, %296
%298 = call double @sinh(double %297)
%299 = load double*, double** %11
%300 = load i32, i32* %22
%301 = add nsw i32 %300, 1
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %299, i64 %302
%304 = load double, double* %303
%305 = load double, double* %13
%306 = load double, double* %15
%307 = fmul double %305, %306
%308 = call double @sinh(double %307)
%309 = fmul double %304, %308
%310 = call double @llvm.fmuladd.f64(double %294, double %298, double %309)
%311 = load double, double* %13
%312 = load double, double* %13
%313 = fmul double %311, %312
%314 = load double, double* %13
%315 = load double, double* %19
%316 = fmul double %314, %315
%317 = call double @sinh(double %316)
%318 = fmul double %313, %317
%319 = fdiv double %310, %318
%320 = load double*, double** %10
%321 = load i32, i32* %22
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double, double* %320, i64 %322
%324 = load double, double* %323
%325 = load double*, double** %11
%326 = load i32, i32* %22
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds double, double* %325, i64 %327
%329 = load double, double* %328
%330 = load double, double* %13
%331 = load double, double* %13
%332 = fmul double %330, %331
%333 = fdiv double %329, %332
%334 = fsub double %324, %333
%335 = load double, double* %16
%336 = load double, double* %19
%337 = fdiv double %335, %336
%338 = call double @llvm.fmuladd.f64(double %334, double %337, double %319)
%339 = load double*, double** %10
%340 = load i32, i32* %22
%341 = add nsw i32 %340, 1
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds double, double* %339, i64 %342
%344 = load double, double* %343
%345 = load double*, double** %11
%346 = load i32, i32* %22
%347 = add nsw i32 %346, 1
%348 = sext i32 %347 to i64
%349 = getelementptr inbounds double, double* %345, i64 %348
%350 = load double, double* %349
%351 = load double, double* %13
%352 = load double, double* %13
%353 = fmul double %351, %352
%354 = fdiv double %350, %353
%355 = fsub double %344, %354
%356 = load double, double* %15
%357 = load double, double* %19
%358 = fdiv double %356, %357
%359 = call double @llvm.fmuladd.f64(double %355, double %358, double %338)
store double %359, double* %20
br label %360
360: ; preds = %289, %238
br label %490
361: ; preds = %229
%362 = load double, double* %13
%363 = load double, double* %19
%364 = fmul double %362, %363
%365 = call double @llvm.fabs.f64(double %364)
%366 = fcmp olt double %365, 1.000000e-03
br i1 %366, label %367, label %418
367: ; preds = %361
%368 = load double*, double** %10
%369 = load i32, i32* %22
%370 = sext i32 %369 to i64
%371 = getelementptr inbounds double, double* %368, i64 %370
%372 = load double, double* %371
%373 = load double, double* %18
%374 = load double*, double** %10
%375 = load i32, i32* %22
%376 = add nsw i32 %375, 1
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double, double* %374, i64 %377
%379 = load double, double* %378
%380 = load double, double* %17
%381 = fmul double %379, %380
%382 = call double @llvm.fmuladd.f64(double %372, double %373, double %381)
%383 = load double*, double** %11
%384 = load i32, i32* %22
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds double, double* %383, i64 %385
%387 = load double, double* %386
%388 = load double, double* %19
%389 = fmul double %387, %388
%390 = load double, double* %19
%391 = fmul double %389, %390
%392 = fdiv double %391, 6.000000e+00
%393 = load double, double* %18
%394 = load double, double* %13
%395 = load double, double* %19
%396 = fmul double %394, %395
%397 = call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sin_func to i32 (double, double, ...)*)(double %393, double %396)
%398 = sitofp i32 %397 to double
%399 = call double @llvm.fmuladd.f64(double %392, double %398, double %382)
%400 = load double*, double** %11
%401 = load i32, i32* %22
%402 = add nsw i32 %401, 1
%403 = sext i32 %402 to i64
%404 = getelementptr inbounds double, double* %400, i64 %403
%405 = load double, double* %404
%406 = load double, double* %19
%407 = fmul double %405, %406
%408 = load double, double* %19
%409 = fmul double %407, %408
%410 = fdiv double %409, 6.000000e+00
%411 = load double, double* %17
%412 = load double, double* %13
%413 = load double, double* %19
%414 = fmul double %412, %413
%415 = call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sin_func to i32 (double, double, ...)*)(double %411, double %414)
%416 = sitofp i32 %415 to double
%417 = call double @llvm.fmuladd.f64(double %410, double %416, double %399)
store double %417, double* %20
br label %489
418: ; preds = %361
%419 = load double*, double** %11
%420 = load i32, i32* %22
%421 = sext i32 %420 to i64
%422 = getelementptr inbounds double, double* %419, i64 %421
%423 = load double, double* %422
%424 = load double, double* %13
%425 = load double, double* %16
%426 = fmul double %424, %425
%427 = call double @sin(double %426)
%428 = load double*, double** %11
%429 = load i32, i32* %22
%430 = add nsw i32 %429, 1
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds double, double* %428, i64 %431
%433 = load double, double* %432
%434 = load double, double* %13
%435 = load double, double* %15
%436 = fmul double %434, %435
%437 = call double @sin(double %436)
%438 = fmul double %433, %437
%439 = call double @llvm.fmuladd.f64(double %423, double %427, double %438)
%440 = load double, double* %13
%441 = load double, double* %13
%442 = fmul double %440, %441
%443 = load double, double* %13
%444 = load double, double* %19
%445 = fmul double %443, %444
%446 = call double @sin(double %445)
%447 = fmul double %442, %446
%448 = fdiv double %439, %447
%449 = load double*, double** %10
%450 = load i32, i32* %22
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds double, double* %449, i64 %451
%453 = load double, double* %452
%454 = load double*, double** %11
%455 = load i32, i32* %22
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds double, double* %454, i64 %456
%458 = load double, double* %457
%459 = load double, double* %13
%460 = load double, double* %13
%461 = fmul double %459, %460
%462 = fdiv double %458, %461
%463 = fsub double %453, %462
%464 = load double, double* %16
%465 = load double, double* %19
%466 = fdiv double %464, %465
%467 = call double @llvm.fmuladd.f64(double %463, double %466, double %448)
%468 = load double*, double** %10
%469 = load i32, i32* %22
%470 = add nsw i32 %469, 1
%471 = sext i32 %470 to i64
%472 = getelementptr inbounds double, double* %468, i64 %471
%473 = load double, double* %472
%474 = load double*, double** %11
%475 = load i32, i32* %22
%476 = add nsw i32 %475, 1
%477 = sext i32 %476 to i64
%478 = getelementptr inbounds double, double* %474, i64 %477
%479 = load double, double* %478
%480 = load double, double* %13
%481 = load double, double* %13
%482 = fmul double %480, %481
%483 = fdiv double %479, %482
%484 = fsub double %473, %483
%485 = load double, double* %15
%486 = load double, double* %19
%487 = fdiv double %485, %486
%488 = call double @llvm.fmuladd.f64(double %484, double %487, double %467)
store double %488, double* %20
br label %489
489: ; preds = %418, %367
br label %490
490: ; preds = %489, %360
br label %491
491: ; preds = %490, %166
%492 = load double, double* %20
ret double %492
}

LLVM IR (-O2):
define double @interpolate(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double %4, double %5, i32 %6) {
%8 = add nsw i32 %0, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %1, i64 %9
%11 = load double, double* %10
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = load double, double* %13
%15 = fcmp olt double %11, %14
%16 = icmp eq i32 %6, 0
br i1 %16, label %31, label %17
17: ; preds = %7
%18 = load double, double* %1
%19 = fsub double %4, %18
%20 = fsub double %4, %14
%21 = fmul double %20, %19
%22 = fcmp ogt double %21, 0.000000e+00
br i1 %22, label %23, label %31
23: ; preds = %17
%24 = fsub double %14, %18
%25 = fdiv double %19, %24
%26 = tail call double @llvm.floor.f64(double %25)
%27 = fptosi double %26 to i32
%28 = sitofp i32 %27 to double
%29 = fneg double %28
%30 = tail call double @llvm.fmuladd.f64(double %29, double %24, double %4)
br label %31
31: ; preds = %23, %17, %7
%32 = phi double [ %30, %23 ], [ %4, %17 ], [ %4, %7 ]
%33 = icmp sgt i32 %0, 1
br i1 %33, label %34, label %52
34: ; preds = %31, %48
%35 = phi i32 [ %50, %48 ], [ %0, %31 ]
%36 = phi i32 [ %49, %48 ], [ 0, %31 ]
%37 = lshr i32 %35, 1
%38 = add nsw i32 %37, %36
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %1, i64 %39
%41 = load double, double* %40
br i1 %15, label %42, label %44
42: ; preds = %34
%43 = fcmp ult double %32, %41
br i1 %43, label %48, label %46
44: ; preds = %34
%45 = fcmp ugt double %32, %41
br i1 %45, label %48, label %46
46: ; preds = %44, %42
%47 = sub nsw i32 %35, %37
br label %48
48: ; preds = %42, %44, %46
%49 = phi i32 [ %38, %46 ], [ %36, %44 ], [ %36, %42 ]
%50 = phi i32 [ %47, %46 ], [ %37, %44 ], [ %37, %42 ]
%51 = icmp sgt i32 %50, 1
br i1 %51, label %34, label %52
52: ; preds = %48, %31
%53 = phi i32 [ 0, %31 ], [ %49, %48 ]
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = load double, double* %56
%58 = sext i32 %53 to i64
%59 = getelementptr inbounds double, double* %1, i64 %58
%60 = load double, double* %59
%61 = fsub double %57, %60
%62 = fsub double %32, %60
%63 = fsub double %57, %32
%64 = fdiv double %62, %61
%65 = fdiv double %63, %61
%66 = fcmp oeq double %5, 0.000000e+00
br i1 %66, label %67, label %96
67: ; preds = %52
%68 = getelementptr inbounds double, double* %2, i64 %58
%69 = load double, double* %68
%70 = getelementptr inbounds double, double* %2, i64 %55
%71 = load double, double* %70
%72 = getelementptr inbounds double, double* %3, i64 %55
%73 = load double, double* %72
%74 = getelementptr inbounds double, double* %3, i64 %58
%75 = load double, double* %74
%76 = tail call double @llvm.fmuladd.f64(double %75, double 2.000000e+00, double %73)
%77 = insertelement <2 x double> poison, double %71, i64 0
%78 = insertelement <2 x double> %77, double %61, i64 1
%79 = insertelement <2 x double> poison, double %69, i64 0
%80 = insertelement <2 x double> %79, double %76, i64 1
%81 = fsub <2 x double> %78, %80
%82 = fmul <2 x double> %78, %80
%83 = shufflevector <2 x double> %81, <2 x double> %82, <2 x i32> <i32 0, i32 3>
%84 = insertelement <2 x double> <double poison, double 6.000000e+00>, double %61, i64 0
%85 = fdiv <2 x double> %83, %84
%86 = shufflevector <2 x double> %85, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%87 = fsub <2 x double> %85, %86
%88 = extractelement <2 x double> %87, i64 0
%89 = fsub double %73, %75
%90 = fmul double %62, %89
%91 = fmul double %61, 6.000000e+00
%92 = fdiv double %90, %91
%93 = tail call double @llvm.fmuladd.f64(double %75, double 5.000000e-01, double %92)
%94 = tail call double @llvm.fmuladd.f64(double %62, double %93, double %88)
%95 = tail call double @llvm.fmuladd.f64(double %62, double %94, double %69)
br label %203
96: ; preds = %52
%97 = fcmp ogt double %5, 0.000000e+00
%98 = fmul double %61, %5
%99 = tail call double @llvm.fabs.f64(double %98)
%100 = fcmp olt double %99, 1.000000e-03
br i1 %97, label %101, label %152
101: ; preds = %96
br i1 %100, label %102, label %125
102: ; preds = %101
%103 = getelementptr inbounds double, double* %2, i64 %58
%104 = load double, double* %103
%105 = getelementptr inbounds double, double* %2, i64 %55
%106 = load double, double* %105
%107 = fmul double %64, %106
%108 = tail call double @llvm.fmuladd.f64(double %104, double %65, double %107)
%109 = getelementptr inbounds double, double* %3, i64 %58
%110 = load double, double* %109
%111 = fmul double %61, %110
%112 = fmul double %61, %111
%113 = fdiv double %112, 6.000000e+00
%114 = tail call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sinh_func to i32 (double, double, ...)*)(double %65, double %98)
%115 = sitofp i32 %114 to double
%116 = tail call double @llvm.fmuladd.f64(double %113, double %115, double %108)
%117 = getelementptr inbounds double, double* %3, i64 %55
%118 = load double, double* %117
%119 = fmul double %61, %118
%120 = fmul double %61, %119
%121 = fdiv double %120, 6.000000e+00
%122 = tail call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sinh_func to i32 (double, double, ...)*)(double %64, double %98)
%123 = sitofp i32 %122 to double
%124 = tail call double @llvm.fmuladd.f64(double %121, double %123, double %116)
br label %203
125: ; preds = %101
%126 = getelementptr inbounds double, double* %3, i64 %58
%127 = load double, double* %126
%128 = fmul double %63, %5
%129 = tail call double @sinh(double %128)
%130 = getelementptr inbounds double, double* %3, i64 %55
%131 = load double, double* %130
%132 = fmul double %62, %5
%133 = tail call double @sinh(double %132)
%134 = fmul double %131, %133
%135 = tail call double @llvm.fmuladd.f64(double %127, double %129, double %134)
%136 = fmul double %5, %5
%137 = tail call double @sinh(double %98)
%138 = fmul double %136, %137
%139 = fdiv double %135, %138
%140 = getelementptr inbounds double, double* %2, i64 %58
%141 = load double, double* %140
%142 = load double, double* %126
%143 = fdiv double %142, %136
%144 = fsub double %141, %143
%145 = tail call double @llvm.fmuladd.f64(double %144, double %65, double %139)
%146 = getelementptr inbounds double, double* %2, i64 %55
%147 = load double, double* %146
%148 = load double, double* %130
%149 = fdiv double %148, %136
%150 = fsub double %147, %149
%151 = tail call double @llvm.fmuladd.f64(double %150, double %64, double %145)
br label %203
152: ; preds = %96
br i1 %100, label %153, label %176
153: ; preds = %152
%154 = getelementptr inbounds double, double* %2, i64 %58
%155 = load double, double* %154
%156 = getelementptr inbounds double, double* %2, i64 %55
%157 = load double, double* %156
%158 = fmul double %64, %157
%159 = tail call double @llvm.fmuladd.f64(double %155, double %65, double %158)
%160 = getelementptr inbounds double, double* %3, i64 %58
%161 = load double, double* %160
%162 = fmul double %61, %161
%163 = fmul double %61, %162
%164 = fdiv double %163, 6.000000e+00
%165 = tail call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sin_func to i32 (double, double, ...)*)(double %65, double %98)
%166 = sitofp i32 %165 to double
%167 = tail call double @llvm.fmuladd.f64(double %164, double %166, double %159)
%168 = getelementptr inbounds double, double* %3, i64 %55
%169 = load double, double* %168
%170 = fmul double %61, %169
%171 = fmul double %61, %170
%172 = fdiv double %171, 6.000000e+00
%173 = tail call i32 (double, double, ...) bitcast (i32 (...)* @quotient_sin_func to i32 (double, double, ...)*)(double %64, double %98)
%174 = sitofp i32 %173 to double
%175 = tail call double @llvm.fmuladd.f64(double %172, double %174, double %167)
br label %203
176: ; preds = %152
%177 = getelementptr inbounds double, double* %3, i64 %58
%178 = load double, double* %177
%179 = fmul double %63, %5
%180 = tail call double @sin(double %179)
%181 = getelementptr inbounds double, double* %3, i64 %55
%182 = load double, double* %181
%183 = fmul double %62, %5
%184 = tail call double @sin(double %183)
%185 = fmul double %182, %184
%186 = tail call double @llvm.fmuladd.f64(double %178, double %180, double %185)
%187 = fmul double %5, %5
%188 = tail call double @sin(double %98)
%189 = fmul double %187, %188
%190 = fdiv double %186, %189
%191 = getelementptr inbounds double, double* %2, i64 %58
%192 = load double, double* %191
%193 = load double, double* %177
%194 = fdiv double %193, %187
%195 = fsub double %192, %194
%196 = tail call double @llvm.fmuladd.f64(double %195, double %65, double %190)
%197 = getelementptr inbounds double, double* %2, i64 %55
%198 = load double, double* %197
%199 = load double, double* %181
%200 = fdiv double %199, %187
%201 = fsub double %198, %200
%202 = tail call double @llvm.fmuladd.f64(double %201, double %64, double %196)
br label %203
203: ; preds = %125, %102, %176, %153, %67
%204 = phi double [ %95, %67 ], [ %124, %102 ], [ %151, %125 ], [ %175, %153 ], [ %202, %176 ]
ret double %204
}