void Spline(x, y, n, yp1, ypn, y2) double x[], y[];
int n;
double yp1;
double ypn;
double y2[];
{
  int i, k;
  double sig, qn, un, p;
  double *u;
  u = alloc_Grid();
  if (yp1 > 0.99e30) {
    y2[0] = 0.0;
    u[0] = 0.0;
  } else {
    y2[0] = -0.5;
    u[0] = 3.0 / (x[1] - x[0]) * ((y[1] - y[0]) / (x[1] - x[0]) - yp1);
  }
  for (i = 1; i < (n - 1); ++i) {
    sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
    p = sig * y2[i - 1] + 2.0;
    y2[i] = (sig - 1.0) / p;
    u[i] = (6.0 *
                ((y[i + 1] - y[i]) / (x[i + 1] - x[i]) -
                 (y[i] - y[i - 1]) / (x[i] - x[i - 1])) /
                (x[i + 1] - x[i - 1]) -
            sig * u[i - 1]) /
           p;
  }
  if (ypn > 0.99e30) {
    qn = 0.0;
    un = 0.0;
  } else {
    qn = 0.5;
    un = 3.0 / (x[n - 1] - x[n - 2]) *
         (ypn - (y[n - 1] - y[n - 2]) / (x[n - 1] - x[n - 2]));
  }
  y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
  for (k = n - 2; k >= 0; --k)
    y2[k] = y2[k] * y2[k + 1] + u[k];
  dealloc_Grid(u);
}


x86 assembly (clang, -O0):
<Spline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0x0,%al
call   1040 <alloc_Grid@plt>
cltq
mov    %rax,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1180 <Spline+0x60>
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11e4 <Spline+0xc4>
mov    -0x30(%rbp),%rax
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  0xe5f(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm2
divsd  %xmm2,%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13a9 <Spline+0x289>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xd9f(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0xd01(%rip),%xmm1
mulsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x58(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11eb <Spline+0xcb>
movsd  -0x28(%rbp),%xmm0
movsd  0xc4a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13d5 <Spline+0x2b5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1470 <Spline+0x350>
movsd  0xc3b(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xbfa(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb52(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jl     154a <Spline+0x42a>
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    14f1 <Spline+0x3d1>
mov    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1030 <dealloc_Grid@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spline>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r12
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <alloc_Grid@plt>
movsd  0x8(%rsp),%xmm3
movslq %eax,%rdi
ucomisd 0xea5(%rip),%xmm3
jbe    116b <Spline+0x4b>
movq   $0x0,(%r12)
xorpd  %xmm0,%xmm0
jmp    11b1 <Spline+0x91>
movabs $0xbfe0000000000000,%rax
mov    %rax,(%r12)
movsd  0x8(%rbx),%xmm0
subsd  (%rbx),%xmm0
movsd  0x8(%r15),%xmm1
subsd  (%r15),%xmm1
movapd 0xe9b(%rip),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
lea    -0x1(%r14),%eax
cmp    $0x3,%r14d
jl     139b <Spline+0x27b>
mov    %eax,%ecx
lea    (%rdi,%rcx,8),%rdx
cmp    %r12,%rdx
jbe    12b6 <Spline+0x196>
lea    (%r12,%rcx,8),%rdx
cmp    %rdx,%rdi
jae    12b6 <Spline+0x196>
mov    $0x1,%edx
movsd  0xe1b(%rip),%xmm8
movsd  0xe1a(%rip),%xmm9
movsd  0xe19(%rip),%xmm10
nop
movsd  -0x8(%rbx,%rdx,8),%xmm4
movsd  (%rbx,%rdx,8),%xmm3
subsd  %xmm4,%xmm3
movsd  0x8(%rbx,%rdx,8),%xmm5
subsd  %xmm4,%xmm5
divsd  %xmm5,%xmm3
movsd  -0x8(%r12,%rdx,8),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm8,%xmm4
movapd %xmm3,%xmm5
addsd  %xmm9,%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,(%r12,%rdx,8)
movsd  (%r15,%rdx,8),%xmm5
movsd  0x8(%r15,%rdx,8),%xmm6
subsd  %xmm5,%xmm6
movsd  0x8(%rbx,%rdx,8),%xmm2
movsd  -0x8(%rbx,%rdx,8),%xmm0
movsd  (%rbx,%rdx,8),%xmm1
movapd %xmm2,%xmm7
subsd  %xmm1,%xmm7
divsd  %xmm7,%xmm6
subsd  -0x8(%r15,%rdx,8),%xmm5
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm5
subsd  %xmm5,%xmm6
mulsd  %xmm10,%xmm6
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm6
mulsd  -0x8(%rdi,%rdx,8),%xmm3
subsd  %xmm3,%xmm6
divsd  %xmm4,%xmm6
movsd  %xmm6,(%rdi,%rdx,8)
lea    0x1(%rdx),%rsi
mov    %rsi,%rdx
cmp    %rsi,%rcx
jne    1200 <Spline+0xe0>
jmp    139b <Spline+0x27b>
movsd  (%r12),%xmm0
movsd  (%rdi),%xmm4
mov    $0x1,%edx
movsd  0xd3a(%rip),%xmm8
movsd  0xd39(%rip),%xmm9
movsd  0xd38(%rip),%xmm10
movupd (%rbx,%rdx,8),%xmm5
movsd  -0x8(%rbx,%rdx,8),%xmm6
unpcklpd %xmm6,%xmm6
subpd  %xmm6,%xmm5
movapd %xmm5,%xmm6
unpckhpd %xmm5,%xmm6
divsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm5,%xmm6
addsd  %xmm9,%xmm6
divsd  %xmm0,%xmm6
movsd  %xmm6,(%r12,%rdx,8)
movupd (%r15,%rdx,8),%xmm7
mulsd  %xmm4,%xmm5
movapd %xmm7,%xmm4
shufpd $0x1,%xmm7,%xmm4
movupd (%rbx,%rdx,8),%xmm2
movapd %xmm2,%xmm3
shufpd $0x1,%xmm2,%xmm3
movhpd -0x8(%r15,%rdx,8),%xmm7
subpd  %xmm7,%xmm4
movsd  -0x8(%rbx,%rdx,8),%xmm7
movapd %xmm2,%xmm1
unpcklpd %xmm7,%xmm1
subpd  %xmm1,%xmm3
divpd  %xmm3,%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
subsd  %xmm1,%xmm4
mulsd  %xmm10,%xmm4
unpckhpd %xmm2,%xmm2
subsd  %xmm7,%xmm2
divsd  %xmm2,%xmm4
subsd  %xmm5,%xmm4
divsd  %xmm0,%xmm4
movsd  %xmm4,(%rdi,%rdx,8)
lea    0x1(%rdx),%rsi
movapd %xmm6,%xmm0
mov    %rsi,%rdx
cmp    %rsi,%rcx
jne    12e0 <Spline+0x1c0>
movsd  0x10(%rsp),%xmm3
ucomisd 0xc57(%rip),%xmm3
jbe    13be <Spline+0x29e>
lea    -0x2(%r14),%ecx
movslq %ecx,%rdx
cltq
xorpd  %xmm0,%xmm0
xorpd  %xmm3,%xmm3
jmp    140f <Spline+0x2ef>
cltq
movsd  (%rbx,%rax,8),%xmm0
lea    -0x2(%r14),%ecx
movslq %r14d,%rsi
subsd  -0x10(%rbx,%rsi,8),%xmm0
lea    -0x2(%rsi),%rdx
movsd  (%r15,%rax,8),%xmm1
subsd  -0x10(%r15,%rsi,8),%xmm1
movapd 0xc45(%rip),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xc11(%rip),%xmm0
movsd  (%rdi,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%r12,%rdx,8),%xmm0
addsd  0xc02(%rip),%xmm0
subsd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,(%r12,%rax,8)
cmp    $0x2,%r14d
jl     14a6 <Spline+0x386>
mov    %ecx,%eax
test   $0x1,%cl
jne    145d <Spline+0x33d>
movsd  (%r12,%rax,8),%xmm0
mulsd  0x8(%r12,%rax,8),%xmm0
addsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%r12,%rax,8)
add    $0xffffffffffffffff,%rax
test   %ecx,%ecx
je     14a6 <Spline+0x386>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm0
mulsd  0x8(%r12,%rax,8),%xmm0
addsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%r12,%rax,8)
mulsd  -0x8(%r12,%rax,8),%xmm0
addsd  -0x8(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x8(%r12,%rax,8)
add    $0xfffffffffffffffe,%rax
cmp    $0xffffffffffffffff,%rax
jne    1470 <Spline+0x350>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <dealloc_Grid@plt>

LLVM IR (-O0):
define void @Spline(double* %0, double* %1, i32 %2, double %3, double %4, double* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double*
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double* %5, double** %12
%20 = call i32 (...) @alloc_Grid()
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to double*
store double* %22, double** %19
%23 = load double, double* %10
%24 = fcmp ogt double %23, 9.900000e+29
br i1 %24, label %25, label %30
25: ; preds = %6
%26 = load double*, double** %12
%27 = getelementptr inbounds double, double* %26, i64 0
store double 0.000000e+00, double* %27
%28 = load double*, double** %19
%29 = getelementptr inbounds double, double* %28, i64 0
store double 0.000000e+00, double* %29
br label %61
30: ; preds = %6
%31 = load double*, double** %12
%32 = getelementptr inbounds double, double* %31, i64 0
store double -5.000000e-01, double* %32
%33 = load double*, double** %7
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = load double*, double** %7
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = fsub double %35, %38
%40 = fdiv double 3.000000e+00, %39
%41 = load double*, double** %8
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %8
%45 = getelementptr inbounds double, double* %44, i64 0
%46 = load double, double* %45
%47 = fsub double %43, %46
%48 = load double*, double** %7
%49 = getelementptr inbounds double, double* %48, i64 1
%50 = load double, double* %49
%51 = load double*, double** %7
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = fsub double %50, %53
%55 = fdiv double %47, %54
%56 = load double, double* %10
%57 = fsub double %55, %56
%58 = fmul double %40, %57
%59 = load double*, double** %19
%60 = getelementptr inbounds double, double* %59, i64 0
store double %58, double* %60
br label %61
61: ; preds = %30, %25
store i32 1, i32* %13
br label %62
62: ; preds = %191, %61
%63 = load i32, i32* %13
%64 = load i32, i32* %9
%65 = sub nsw i32 %64, 1
%66 = icmp slt i32 %63, %65
br i1 %66, label %67, label %194
67: ; preds = %62
%68 = load double*, double** %7
%69 = load i32, i32* %13
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = load double*, double** %7
%74 = load i32, i32* %13
%75 = sub nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %73, i64 %76
%78 = load double, double* %77
%79 = fsub double %72, %78
%80 = load double*, double** %7
%81 = load i32, i32* %13
%82 = add nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %80, i64 %83
%85 = load double, double* %84
%86 = load double*, double** %7
%87 = load i32, i32* %13
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %86, i64 %89
%91 = load double, double* %90
%92 = fsub double %85, %91
%93 = fdiv double %79, %92
store double %93, double* %15
%94 = load double, double* %15
%95 = load double*, double** %12
%96 = load i32, i32* %13
%97 = sub nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %95, i64 %98
%100 = load double, double* %99
%101 = call double @llvm.fmuladd.f64(double %94, double %100, double 2.000000e+00)
store double %101, double* %18
%102 = load double, double* %15
%103 = fsub double %102, 1.000000e+00
%104 = load double, double* %18
%105 = fdiv double %103, %104
%106 = load double*, double** %12
%107 = load i32, i32* %13
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
store double %105, double* %109
%110 = load double*, double** %8
%111 = load i32, i32* %13
%112 = add nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %110, i64 %113
%115 = load double, double* %114
%116 = load double*, double** %8
%117 = load i32, i32* %13
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %116, i64 %118
%120 = load double, double* %119
%121 = fsub double %115, %120
%122 = load double*, double** %7
%123 = load i32, i32* %13
%124 = add nsw i32 %123, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %122, i64 %125
%127 = load double, double* %126
%128 = load double*, double** %7
%129 = load i32, i32* %13
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
%133 = fsub double %127, %132
%134 = fdiv double %121, %133
%135 = load double*, double** %8
%136 = load i32, i32* %13
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
%139 = load double, double* %138
%140 = load double*, double** %8
%141 = load i32, i32* %13
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %140, i64 %143
%145 = load double, double* %144
%146 = fsub double %139, %145
%147 = load double*, double** %7
%148 = load i32, i32* %13
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds double, double* %147, i64 %149
%151 = load double, double* %150
%152 = load double*, double** %7
%153 = load i32, i32* %13
%154 = sub nsw i32 %153, 1
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %152, i64 %155
%157 = load double, double* %156
%158 = fsub double %151, %157
%159 = fdiv double %146, %158
%160 = fsub double %134, %159
%161 = fmul double 6.000000e+00, %160
%162 = load double*, double** %7
%163 = load i32, i32* %13
%164 = add nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %162, i64 %165
%167 = load double, double* %166
%168 = load double*, double** %7
%169 = load i32, i32* %13
%170 = sub nsw i32 %169, 1
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %168, i64 %171
%173 = load double, double* %172
%174 = fsub double %167, %173
%175 = fdiv double %161, %174
%176 = load double, double* %15
%177 = load double*, double** %19
%178 = load i32, i32* %13
%179 = sub nsw i32 %178, 1
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %177, i64 %180
%182 = load double, double* %181
%183 = fneg double %176
%184 = call double @llvm.fmuladd.f64(double %183, double %182, double %175)
%185 = load double, double* %18
%186 = fdiv double %184, %185
%187 = load double*, double** %19
%188 = load i32, i32* %13
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
store double %186, double* %190
br label %191
191: ; preds = %67
%192 = load i32, i32* %13
%193 = add nsw i32 %192, 1
store i32 %193, i32* %13
br label %62
194: ; preds = %62
%195 = load double, double* %11
%196 = fcmp ogt double %195, 9.900000e+29
br i1 %196, label %197, label %198
197: ; preds = %194
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
br label %243
198: ; preds = %194
store double 5.000000e-01, double* %16
%199 = load double*, double** %7
%200 = load i32, i32* %9
%201 = sub nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds double, double* %199, i64 %202
%204 = load double, double* %203
%205 = load double*, double** %7
%206 = load i32, i32* %9
%207 = sub nsw i32 %206, 2
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %205, i64 %208
%210 = load double, double* %209
%211 = fsub double %204, %210
%212 = fdiv double 3.000000e+00, %211
%213 = load double, double* %11
%214 = load double*, double** %8
%215 = load i32, i32* %9
%216 = sub nsw i32 %215, 1
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %214, i64 %217
%219 = load double, double* %218
%220 = load double*, double** %8
%221 = load i32, i32* %9
%222 = sub nsw i32 %221, 2
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds double, double* %220, i64 %223
%225 = load double, double* %224
%226 = fsub double %219, %225
%227 = load double*, double** %7
%228 = load i32, i32* %9
%229 = sub nsw i32 %228, 1
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %227, i64 %230
%232 = load double, double* %231
%233 = load double*, double** %7
%234 = load i32, i32* %9
%235 = sub nsw i32 %234, 2
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds double, double* %233, i64 %236
%238 = load double, double* %237
%239 = fsub double %232, %238
%240 = fdiv double %226, %239
%241 = fsub double %213, %240
%242 = fmul double %212, %241
store double %242, double* %17
br label %243
243: ; preds = %198, %197
%244 = load double, double* %17
%245 = load double, double* %16
%246 = load double*, double** %19
%247 = load i32, i32* %9
%248 = sub nsw i32 %247, 2
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double, double* %246, i64 %249
%251 = load double, double* %250
%252 = fneg double %245
%253 = call double @llvm.fmuladd.f64(double %252, double %251, double %244)
%254 = load double, double* %16
%255 = load double*, double** %12
%256 = load i32, i32* %9
%257 = sub nsw i32 %256, 2
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds double, double* %255, i64 %258
%260 = load double, double* %259
%261 = call double @llvm.fmuladd.f64(double %254, double %260, double 1.000000e+00)
%262 = fdiv double %253, %261
%263 = load double*, double** %12
%264 = load i32, i32* %9
%265 = sub nsw i32 %264, 1
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %263, i64 %266
store double %262, double* %267
%268 = load i32, i32* %9
%269 = sub nsw i32 %268, 2
store i32 %269, i32* %14
br label %270
270: ; preds = %295, %243
%271 = load i32, i32* %14
%272 = icmp sge i32 %271, 0
br i1 %272, label %273, label %298
273: ; preds = %270
%274 = load double*, double** %12
%275 = load i32, i32* %14
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds double, double* %274, i64 %276
%278 = load double, double* %277
%279 = load double*, double** %12
%280 = load i32, i32* %14
%281 = add nsw i32 %280, 1
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %279, i64 %282
%284 = load double, double* %283
%285 = load double*, double** %19
%286 = load i32, i32* %14
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %285, i64 %287
%289 = load double, double* %288
%290 = call double @llvm.fmuladd.f64(double %278, double %284, double %289)
%291 = load double*, double** %12
%292 = load i32, i32* %14
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds double, double* %291, i64 %293
store double %290, double* %294
br label %295
295: ; preds = %273
%296 = load i32, i32* %14
%297 = add nsw i32 %296, -1
store i32 %297, i32* %14
br label %270
298: ; preds = %270
%299 = load double*, double** %19
%300 = call i32 (double*, ...) bitcast (i32 (...)* @dealloc_Grid to i32 (double*, ...)*)(double* %299)
ret void
}

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