double *SplineInterp(double *h16) {
  double *d;
  double *t1;
  int i, j, n;
  double u, u3, u2, s;
  int *t2;
  d = (double *)MemAlloc(sizeof(double) * 32768);
  for (i = 0; i < 32768; i++)
    d[i] = h16[i];
  t1 = (double *)MemAlloc(sizeof(double) * 32770);
  t2 = (int *)MemAlloc(sizeof(int) * 32770);
  t2[0] = 0;
  t1[0] = 0.0;
  n = 1;
  for (i = 0; i < 32768; i++)
    if (h16[i] != 0.0) {
      t1[n] = h16[i];
      t2[n] = i;
      ++n;
    }
  t1[n] = 0.0;
  t2[n] = 0;
  n++;
  s = 0.5;
  for (i = 1; i <= n - 3; i++) {
    for (j = t2[i] + 1; j < t2[i + 1]; j++) {
      u = ((double)(j - t2[i])) / ((double)(t2[i + 1] - t2[i]));
      u2 = u * u;
      u3 = u2 * u;
      d[j] = t1[i - 1] * (-s * u3 + 2 * s * u2 - s * u) +
             t1[i] * ((2 - s) * u3 + (s - 3) * u2 + 1) +
             t1[i + 1] * ((s - 2) * u3 + (3 - 2 * s) * u2 + s * u) +
             t1[i + 2] * (s * u3 - s * u2);
    }
  }
  MemFree(t1);
  MemFree(t2);
  return d;
}


x86 assembly (clang, -O0):
<SplineInterp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x40000,%edi
mov    $0x0,%al
call   1040 <MemAlloc@plt>
cltq
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8000,-0x1c(%rbp)
jge    117a <SplineInterp+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <SplineInterp+0x25>
mov    $0x40010,%edi
mov    $0x0,%al
call   1040 <MemAlloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x20008,%edi
mov    $0x0,%al
call   1040 <MemAlloc@plt>
cltq
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8000,-0x1c(%rbp)
jge    1237 <SplineInterp+0x117>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f3 <SplineInterp+0xd3>
jp     11f3 <SplineInterp+0xd3>
jmp    1224 <SplineInterp+0x104>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%edx
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1229 <SplineInterp+0x109>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c1 <SplineInterp+0xa1>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movsd  0xd99(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     14b0 <SplineInterp+0x390>
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x50(%rbp),%rcx
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    149d <SplineInterp+0x37d>
mov    -0x20(%rbp),%eax
mov    -0x50(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
mov    -0x50(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x50(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x38(%rbp),%xmm3
movsd  0xccf(%rip),%xmm2
mulsd  -0x48(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xc7f(%rip),%xmm3
subsd  -0x48(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm5
movsd  -0x48(%rbp),%xmm4
movsd  0xc60(%rip),%xmm6
subsd  %xmm6,%xmm4
mulsd  -0x40(%rbp),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movsd  0xc57(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm3
movsd  0xc20(%rip),%xmm2
subsd  %xmm2,%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
addsd  %xmm5,%xmm5
movsd  0xbfe(%rip),%xmm2
subsd  %xmm5,%xmm2
mulsd  -0x40(%rbp),%xmm2
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1295 <SplineInterp+0x175>
jmp    14a2 <SplineInterp+0x382>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1273 <SplineInterp+0x153>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <MemFree@plt>
mov    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1030 <MemFree@plt>
mov    -0x10(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SplineInterp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r12
mov    $0x40000,%edi
xor    %eax,%eax
call   1040 <MemAlloc@plt>
movslq %eax,%r14
lea    0x40000(%r12),%rax
cmp    %rax,%r14
jae    11a4 <SplineInterp+0x84>
lea    0x40000(%r14),%rax
cmp    %r12,%rax
jbe    11a4 <SplineInterp+0x84>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
movsd  0x8(%r12,%rax,8),%xmm0
movsd  %xmm0,0x8(%r14,%rax,8)
movsd  0x10(%r12,%rax,8),%xmm0
movsd  %xmm0,0x10(%r14,%rax,8)
movsd  0x18(%r12,%rax,8),%xmm0
movsd  %xmm0,0x18(%r14,%rax,8)
add    $0x4,%rax
cmp    $0x8000,%rax
jne    1160 <SplineInterp+0x40>
jmp    121e <SplineInterp+0xfe>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movups (%r12,%rax,8),%xmm0
movups 0x10(%r12,%rax,8),%xmm1
movups %xmm0,(%r14,%rax,8)
movups %xmm1,0x10(%r14,%rax,8)
movups 0x20(%r12,%rax,8),%xmm0
movups 0x30(%r12,%rax,8),%xmm1
movups %xmm0,0x20(%r14,%rax,8)
movups %xmm1,0x30(%r14,%rax,8)
movups 0x40(%r12,%rax,8),%xmm0
movups 0x50(%r12,%rax,8),%xmm1
movups %xmm0,0x40(%r14,%rax,8)
movups %xmm1,0x50(%r14,%rax,8)
movupd 0x60(%r12,%rax,8),%xmm0
movupd 0x70(%r12,%rax,8),%xmm1
movupd %xmm0,0x60(%r14,%rax,8)
movupd %xmm1,0x70(%r14,%rax,8)
add    $0x10,%rax
cmp    $0x8000,%rax
jne    11b0 <SplineInterp+0x90>
xor    %ebp,%ebp
mov    $0x40010,%edi
xor    %eax,%eax
call   1040 <MemAlloc@plt>
movslq %eax,%rbx
mov    $0x20008,%edi
xor    %eax,%eax
call   1040 <MemAlloc@plt>
movslq %eax,%r13
movl   $0x0,0x0(%r13)
movq   $0x0,(%rbx)
mov    $0x1,%r10d
xorpd  %xmm0,%xmm0
jmp    126d <SplineInterp+0x14d>
nopl   0x0(%rax)
add    $0x2,%rbp
cmp    $0x8000,%rbp
je     12b3 <SplineInterp+0x193>
movsd  (%r12,%rbp,8),%xmm1
ucomisd %xmm0,%xmm1
jne    127b <SplineInterp+0x15b>
jnp    128d <SplineInterp+0x16d>
movslq %r10d,%r10
movsd  %xmm1,(%rbx,%r10,8)
mov    %ebp,0x0(%r13,%r10,4)
add    $0x1,%r10d
movsd  0x8(%r12,%rbp,8),%xmm1
ucomisd %xmm0,%xmm1
jne    129c <SplineInterp+0x17c>
jnp    1260 <SplineInterp+0x140>
movslq %r10d,%r10
movsd  %xmm1,(%rbx,%r10,8)
lea    0x1(%rbp),%eax
mov    %eax,0x0(%r13,%r10,4)
add    $0x1,%r10d
jmp    1260 <SplineInterp+0x140>
movslq %r10d,%rax
movq   $0x0,(%rbx,%rax,8)
movl   $0x0,0x0(%r13,%rax,4)
cmp    $0x3,%eax
jge    12f2 <SplineInterp+0x1d2>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <MemFree@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <MemFree@plt>
mov    %r14,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0xffffffff,%r10d
mov    0x4(%r13),%r12d
lea    0x8(%r14),%rax
mov    %rax,0x20(%rsp)
mov    $0x1,%r11d
xor    %r9d,%r9d
movsd  0xd6b(%rip),%xmm8
movsd  0xd6a(%rip),%xmm10
movsd  0xd6a(%rip),%xmm0
movsd  0xd69(%rip),%xmm11
movsd  0xd68(%rip),%xmm12
movsd  0xd68(%rip),%xmm6
movapd 0xcc7(%rip),%xmm14
mov    %r13,0x8(%rsp)
jmp    135d <SplineInterp+0x23d>
add    $0x1,%r9
cmp    %r10,%r11
je     12cc <SplineInterp+0x1ac>
mov    %r11,%rdi
mov    %r12d,%edx
add    $0x1,%r11
mov    0x4(%r13,%rdi,4),%r12d
lea    0x1(%rdx),%r8d
cmp    %r12d,%r8d
jge    1350 <SplineInterp+0x230>
mov    %r12d,%r15d
sub    %edx,%r15d
xorps  %xmm9,%xmm9
cvtsi2sd %r15d,%xmm9
lea    0x2(%rdi),%eax
movslq %r8d,%rcx
add    $0xfffffffe,%r15d
je     1570 <SplineInterp+0x450>
lea    (%rbx,%r9,8),%rbp
add    $0x20,%rbp
lea    (%r14,%rcx,8),%r13
cmp    %rbp,%r13
jae    13da <SplineInterp+0x2ba>
lea    (%rbx,%r9,8),%rsi
mov    %rsi,0x10(%rsp)
mov    %r12d,%esi
sub    %edx,%esi
add    $0xfffffffe,%esi
add    %rcx,%rsi
mov    0x20(%rsp),%rbp
lea    0x0(,%rsi,8),%rsi
add    %rbp,%rsi
cmp    %rsi,0x10(%rsp)
jae    13da <SplineInterp+0x2ba>
mov    0x8(%rsp),%r13
jmp    1570 <SplineInterp+0x450>
add    $0x1,%r15
mov    %r15,%rbp
and    $0xfffffffffffffffe,%rbp
add    %rbp,%rcx
movd   %r8d,%xmm1
pshufd $0x50,%xmm1,%xmm1
paddd  0xc06(%rip),%xmm1
movd   %edx,%xmm2
pshufd $0x50,%xmm2,%xmm0
movdqa %xmm0,0x10(%rsp)
movapd %xmm9,%xmm6
unpcklpd %xmm9,%xmm6
movsd  -0x8(%rbx,%rdi,8),%xmm10
movsd  (%rbx,%rdi,8),%xmm11
unpcklpd %xmm10,%xmm10
unpcklpd %xmm11,%xmm11
movsd  (%rbx,%r11,8),%xmm12
unpcklpd %xmm12,%xmm12
movsd  (%rbx,%rax,8),%xmm13
unpcklpd %xmm13,%xmm13
xor    %r8d,%r8d
movapd 0xc15(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movdqa %xmm1,%xmm2
psubd  0x10(%rsp),%xmm2
cvtdq2pd %xmm2,%xmm15
divpd  %xmm6,%xmm15
movapd %xmm15,%xmm2
mulpd  %xmm15,%xmm2
movapd %xmm15,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm3,%xmm7
mulpd  %xmm14,%xmm7
movapd %xmm15,%xmm4
mulpd  %xmm14,%xmm4
addpd  %xmm2,%xmm7
addpd  %xmm7,%xmm4
movapd %xmm2,%xmm7
mulpd  0xb82(%rip),%xmm7
movapd %xmm14,%xmm5
movapd %xmm3,%xmm14
mulpd  0xb7f(%rip),%xmm14
mulpd  %xmm10,%xmm4
addpd  %xmm7,%xmm14
addpd  0xb7c(%rip),%xmm14
mulpd  %xmm11,%xmm14
movapd %xmm2,%xmm7
addpd  %xmm4,%xmm14
addpd  %xmm2,%xmm7
movapd %xmm3,%xmm4
mulpd  0xb6e(%rip),%xmm4
addpd  %xmm7,%xmm4
mulpd  %xmm0,%xmm15
addpd  %xmm4,%xmm15
mulpd  %xmm12,%xmm15
addpd  %xmm14,%xmm15
movapd %xmm5,%xmm14
mulpd  %xmm5,%xmm2
mulpd  %xmm0,%xmm3
addpd  %xmm2,%xmm3
mulpd  %xmm13,%xmm3
addpd  %xmm15,%xmm3
movupd %xmm3,0x0(%r13,%r8,8)
add    $0x2,%r8
paddd  0xb48(%rip),%xmm1
cmp    %r8,%rbp
jne    1450 <SplineInterp+0x330>
cmp    %rbp,%r15
mov    0x8(%rsp),%r13
movsd  0xb46(%rip),%xmm10
movsd  0xb46(%rip),%xmm0
movsd  0xb45(%rip),%xmm11
movsd  0xb44(%rip),%xmm12
movsd  0xb44(%rip),%xmm6
je     1350 <SplineInterp+0x230>
nopw   0x0(%rax,%rax,1)
neg    %edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdx,%rcx,1),%esi
xorps  %xmm2,%xmm2
cvtsi2sd %esi,%xmm2
divsd  %xmm9,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm8,%xmm1
addsd  %xmm3,%xmm1
movapd %xmm2,%xmm7
mulsd  %xmm8,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm3,%xmm5
mulsd  %xmm10,%xmm5
movapd %xmm4,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm5,%xmm1
addsd  %xmm11,%xmm1
mulsd  (%rbx,%rdi,8),%xmm1
mulsd  -0x8(%rbx,%rdi,8),%xmm7
addsd  %xmm1,%xmm7
movapd %xmm3,%xmm1
addsd  %xmm3,%xmm1
movapd %xmm4,%xmm5
mulsd  %xmm12,%xmm5
addsd  %xmm1,%xmm5
mulsd  %xmm6,%xmm2
addsd  %xmm5,%xmm2
mulsd  (%rbx,%r11,8),%xmm2
addsd  %xmm7,%xmm2
mulsd  %xmm8,%xmm3
mulsd  %xmm6,%xmm4
addsd  %xmm3,%xmm4
mulsd  (%rbx,%rax,8),%xmm4
addsd  %xmm2,%xmm4
movsd  %xmm4,(%r14,%rcx,8)
add    $0x1,%rcx
cmp    %ecx,%r12d
jne    1580 <SplineInterp+0x460>
jmp    1350 <SplineInterp+0x230>

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

LLVM IR (-O2):
define double* @SplineInterp(double* nocapture %0) {
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @MemAlloc to i32 (i64, ...)*)(i64 262144)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to double*
%5 = inttoptr i64 %3 to i8*
%6 = getelementptr double, double* %4, i64 32768
%7 = getelementptr double, double* %0, i64 32768
%8 = bitcast double* %7 to i8*
%9 = icmp ult i8* %5, %8
%10 = icmp ugt double* %6, %0
%11 = and i1 %9, %10
br i1 %11, label %59, label %12
12: ; preds = %1, %12
%13 = phi i64 [ %57, %12 ], [ 0, %1 ]
%14 = getelementptr inbounds double, double* %0, i64 %13
%15 = bitcast double* %14 to <2 x double>*
%16 = load <2 x double>, <2 x double>* %15
%17 = getelementptr inbounds double, double* %14, i64 2
%18 = bitcast double* %17 to <2 x double>*
%19 = load <2 x double>, <2 x double>* %18
%20 = getelementptr inbounds double, double* %4, i64 %13
%21 = bitcast double* %20 to <2 x double>*
store <2 x double> %16, <2 x double>* %21
%22 = getelementptr inbounds double, double* %20, i64 2
%23 = bitcast double* %22 to <2 x double>*
store <2 x double> %19, <2 x double>* %23
%24 = or i64 %13, 4
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = getelementptr inbounds double, double* %25, i64 2
%29 = bitcast double* %28 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = getelementptr inbounds double, double* %4, i64 %24
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %27, <2 x double>* %32
%33 = getelementptr inbounds double, double* %31, i64 2
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %30, <2 x double>* %34
%35 = or i64 %13, 8
%36 = getelementptr inbounds double, double* %0, i64 %35
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = getelementptr inbounds double, double* %36, i64 2
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = getelementptr inbounds double, double* %4, i64 %35
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %38, <2 x double>* %43
%44 = getelementptr inbounds double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %41, <2 x double>* %45
%46 = or i64 %13, 12
%47 = getelementptr inbounds double, double* %0, i64 %46
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %47, i64 2
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %4, i64 %46
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %49, <2 x double>* %54
%55 = getelementptr inbounds double, double* %53, i64 2
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %52, <2 x double>* %56
%57 = add nuw nsw i64 %13, 16
%58 = icmp eq i64 %57, 32768
br i1 %58, label %78, label %12
59: ; preds = %1, %59
%60 = phi i64 [ %76, %59 ], [ 0, %1 ]
%61 = getelementptr inbounds double, double* %0, i64 %60
%62 = load double, double* %61
%63 = getelementptr inbounds double, double* %4, i64 %60
store double %62, double* %63
%64 = or i64 %60, 1
%65 = getelementptr inbounds double, double* %0, i64 %64
%66 = load double, double* %65
%67 = getelementptr inbounds double, double* %4, i64 %64
store double %66, double* %67
%68 = or i64 %60, 2
%69 = getelementptr inbounds double, double* %0, i64 %68
%70 = load double, double* %69
%71 = getelementptr inbounds double, double* %4, i64 %68
store double %70, double* %71
%72 = or i64 %60, 3
%73 = getelementptr inbounds double, double* %0, i64 %72
%74 = load double, double* %73
%75 = getelementptr inbounds double, double* %4, i64 %72
store double %74, double* %75
%76 = add nuw nsw i64 %60, 4
%77 = icmp eq i64 %76, 32768
br i1 %77, label %78, label %59
78: ; preds = %12, %59
%79 = tail call i32 (i64, ...) bitcast (i32 (...)* @MemAlloc to i32 (i64, ...)*)(i64 262160)
%80 = sext i32 %79 to i64
%81 = inttoptr i64 %80 to double*
%82 = tail call i32 (i64, ...) bitcast (i32 (...)* @MemAlloc to i32 (i64, ...)*)(i64 131080)
%83 = sext i32 %82 to i64
%84 = inttoptr i64 %83 to i32*
store i32 0, i32* %84
store double 0.000000e+00, double* %81
br label %85
85: ; preds = %109, %78
%86 = phi i64 [ 0, %78 ], [ %111, %109 ]
%87 = phi i32 [ 1, %78 ], [ %110, %109 ]
%88 = getelementptr inbounds double, double* %0, i64 %86
%89 = load double, double* %88
%90 = fcmp une double %89, 0.000000e+00
br i1 %90, label %91, label %97
91: ; preds = %85
%92 = sext i32 %87 to i64
%93 = getelementptr inbounds double, double* %81, i64 %92
store double %89, double* %93
%94 = getelementptr inbounds i32, i32* %84, i64 %92
%95 = trunc i64 %86 to i32
store i32 %95, i32* %94
%96 = add nsw i32 %87, 1
br label %97
97: ; preds = %85, %91
%98 = phi i32 [ %96, %91 ], [ %87, %85 ]
%99 = or i64 %86, 1
%100 = getelementptr inbounds double, double* %0, i64 %99
%101 = load double, double* %100
%102 = fcmp une double %101, 0.000000e+00
br i1 %102, label %103, label %109
103: ; preds = %97
%104 = sext i32 %98 to i64
%105 = getelementptr inbounds double, double* %81, i64 %104
store double %101, double* %105
%106 = getelementptr inbounds i32, i32* %84, i64 %104
%107 = trunc i64 %99 to i32
store i32 %107, i32* %106
%108 = add nsw i32 %98, 1
br label %109
109: ; preds = %103, %97
%110 = phi i32 [ %108, %103 ], [ %98, %97 ]
%111 = add nuw nsw i64 %86, 2
%112 = icmp eq i64 %111, 32768
br i1 %112, label %113, label %85
113: ; preds = %109
%114 = sext i32 %110 to i64
%115 = getelementptr inbounds double, double* %81, i64 %114
store double 0.000000e+00, double* %115
%116 = getelementptr inbounds i32, i32* %84, i64 %114
store i32 0, i32* %116
%117 = icmp slt i32 %110, 3
br i1 %117, label %249, label %118
118: ; preds = %113
%119 = add nsw i32 %110, -1
%120 = zext i32 %119 to i64
%121 = getelementptr inbounds i32, i32* %84, i64 1
%122 = load i32, i32* %121
%123 = getelementptr double, double* %4, i64 1
br label %127
124: ; preds = %219, %215, %127
%125 = icmp eq i64 %134, %120
%126 = add i64 %128, 1
br i1 %125, label %249, label %127
127: ; preds = %118, %124
%128 = phi i64 [ 0, %118 ], [ %126, %124 ]
%129 = phi i32 [ %122, %118 ], [ %136, %124 ]
%130 = phi i64 [ 1, %118 ], [ %134, %124 ]
%131 = getelementptr double, double* %81, i64 %128
%132 = add i64 %128, 4
%133 = getelementptr double, double* %81, i64 %132
%134 = add nuw nsw i64 %130, 1
%135 = getelementptr inbounds i32, i32* %84, i64 %134
%136 = load i32, i32* %135
%137 = add i32 %129, 1
%138 = icmp slt i32 %137, %136
br i1 %138, label %139, label %124
139: ; preds = %127
%140 = sub nsw i32 %136, %129
%141 = sitofp i32 %140 to double
%142 = add nsw i64 %130, -1
%143 = getelementptr inbounds double, double* %81, i64 %142
%144 = getelementptr inbounds double, double* %81, i64 %130
%145 = getelementptr inbounds double, double* %81, i64 %134
%146 = add nuw i64 %130, 2
%147 = and i64 %146, 4294967295
%148 = getelementptr inbounds double, double* %81, i64 %147
%149 = sext i32 %137 to i64
%150 = add i32 %136, -2
%151 = sub i32 %150, %129
%152 = zext i32 %151 to i64
%153 = add nuw nsw i64 %152, 1
%154 = icmp eq i32 %151, 0
br i1 %154, label %217, label %155
155: ; preds = %139
%156 = getelementptr double, double* %4, i64 %149
%157 = add i32 %136, -2
%158 = sub i32 %157, %129
%159 = zext i32 %158 to i64
%160 = add nsw i64 %149, %159
%161 = getelementptr double, double* %123, i64 %160
%162 = icmp ult double* %156, %133
%163 = icmp ult double* %131, %161
%164 = and i1 %162, %163
br i1 %164, label %217, label %165
165: ; preds = %155
%166 = and i64 %153, 8589934590
%167 = add nsw i64 %166, %149
%168 = insertelement <2 x i32> poison, i32 %137, i64 0
%169 = shufflevector <2 x i32> %168, <2 x i32> poison, <2 x i32> zeroinitializer
%170 = add <2 x i32> %169, <i32 0, i32 1>
%171 = insertelement <2 x i32> poison, i32 %129, i64 0
%172 = shufflevector <2 x i32> %171, <2 x i32> poison, <2 x i32> zeroinitializer
%173 = insertelement <2 x double> poison, double %141, i64 0
%174 = shufflevector <2 x double> %173, <2 x double> poison, <2 x i32> zeroinitializer
%175 = load double, double* %143
%176 = insertelement <2 x double> poison, double %175, i64 0
%177 = shufflevector <2 x double> %176, <2 x double> poison, <2 x i32> zeroinitializer
%178 = load double, double* %144
%179 = insertelement <2 x double> poison, double %178, i64 0
%180 = shufflevector <2 x double> %179, <2 x double> poison, <2 x i32> zeroinitializer
%181 = load double, double* %145
%182 = insertelement <2 x double> poison, double %181, i64 0
%183 = shufflevector <2 x double> %182, <2 x double> poison, <2 x i32> zeroinitializer
%184 = load double, double* %148
%185 = insertelement <2 x double> poison, double %184, i64 0
%186 = shufflevector <2 x double> %185, <2 x double> poison, <2 x i32> zeroinitializer
br label %187
187: ; preds = %187, %165
%188 = phi i64 [ 0, %165 ], [ %212, %187 ]
%189 = phi <2 x i32> [ %170, %165 ], [ %213, %187 ]
%190 = add i64 %188, %149
%191 = sub <2 x i32> %189, %172
%192 = sitofp <2 x i32> %191 to <2 x double>
%193 = fdiv <2 x double> %192, %174
%194 = fmul <2 x double> %193, %193
%195 = fmul <2 x double> %193, %194
%196 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %195, <2 x double> <double -5.000000e-01, double -5.000000e-01>, <2 x double> %194)
%197 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %193, <2 x double> <double -5.000000e-01, double -5.000000e-01>, <2 x double> %196)
%198 = fmul <2 x double> %194, <double -2.500000e+00, double -2.500000e+00>
%199 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %195, <2 x double> <double 1.500000e+00, double 1.500000e+00>, <2 x double> %198)
%200 = fadd <2 x double> %199, <double 1.000000e+00, double 1.000000e+00>
%201 = fmul <2 x double> %200, %180
%202 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %177, <2 x double> %197, <2 x double> %201)
%203 = fmul <2 x double> %194, <double 2.000000e+00, double 2.000000e+00>
%204 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %195, <2 x double> <double -1.500000e+00, double -1.500000e+00>, <2 x double> %203)
%205 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %193, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %204)
%206 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %183, <2 x double> %205, <2 x double> %202)
%207 = fmul <2 x double> %194, <double -5.000000e-01, double -5.000000e-01>
%208 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %195, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %207)
%209 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %186, <2 x double> %208, <2 x double> %206)
%210 = getelementptr inbounds double, double* %4, i64 %190
%211 = bitcast double* %210 to <2 x double>*
store <2 x double> %209, <2 x double>* %211
%212 = add nuw i64 %188, 2
%213 = add <2 x i32> %189, <i32 2, i32 2>
%214 = icmp eq i64 %212, %166
br i1 %214, label %215, label %187
215: ; preds = %187
%216 = icmp eq i64 %153, %166
br i1 %216, label %124, label %217
217: ; preds = %155, %139, %215
%218 = phi i64 [ %149, %155 ], [ %149, %139 ], [ %167, %215 ]
br label %219
219: ; preds = %217, %219
%220 = phi i64 [ %246, %219 ], [ %218, %217 ]
%221 = trunc i64 %220 to i32
%222 = sub i32 %221, %129
%223 = sitofp i32 %222 to double
%224 = fdiv double %223, %141
%225 = fmul double %224, %224
%226 = fmul double %224, %225
%227 = load double, double* %143
%228 = tail call double @llvm.fmuladd.f64(double %226, double -5.000000e-01, double %225)
%229 = tail call double @llvm.fmuladd.f64(double %224, double -5.000000e-01, double %228)
%230 = load double, double* %144
%231 = fmul double %225, -2.500000e+00
%232 = tail call double @llvm.fmuladd.f64(double %226, double 1.500000e+00, double %231)
%233 = fadd double %232, 1.000000e+00
%234 = fmul double %233, %230
%235 = tail call double @llvm.fmuladd.f64(double %227, double %229, double %234)
%236 = load double, double* %145
%237 = fmul double %225, 2.000000e+00
%238 = tail call double @llvm.fmuladd.f64(double %226, double -1.500000e+00, double %237)
%239 = tail call double @llvm.fmuladd.f64(double %224, double 5.000000e-01, double %238)
%240 = tail call double @llvm.fmuladd.f64(double %236, double %239, double %235)
%241 = load double, double* %148
%242 = fmul double %225, -5.000000e-01
%243 = tail call double @llvm.fmuladd.f64(double %226, double 5.000000e-01, double %242)
%244 = tail call double @llvm.fmuladd.f64(double %241, double %243, double %240)
%245 = getelementptr inbounds double, double* %4, i64 %220
store double %244, double* %245
%246 = add nsw i64 %220, 1
%247 = trunc i64 %246 to i32
%248 = icmp eq i32 %136, %247
br i1 %248, label %124, label %219
249: ; preds = %124, %113
%250 = tail call i32 (double*, ...) bitcast (i32 (...)* @MemFree to i32 (double*, ...)*)(double* %81)
%251 = tail call i32 (i32*, ...) bitcast (i32 (...)* @MemFree to i32 (i32*, ...)*)(i32* %84)
ret double* %4
}