void spline(double x[], double y[], int n, double yp1, double yp2,
            double y2[]) {
  char *func = {"spline(): "};
  int i, k;
  double p, qn, sig, un, *u;
  u = (double *)mem_alloc((n) * sizeof(double), func, "u[]");
  if (yp1 > 1.0E15)
    y2[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] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) -
           (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
  }
  if (yp2 > 1.0E15)
    qn = un = 1.0E-10;
  else {
    qn = 0.5;
    un = (3.0 / (x[n - 1] - x[n - 2])) *
         (yp2 - (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];
  }
  free(u);
  ;
}


x86 assembly (clang, -O0):
<spline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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)
lea    0xef8(%rip),%rax
mov    %rax,-0x38(%rbp)
movslq -0x14(%rbp),%rdi
shl    $0x3,%rdi
mov    -0x38(%rbp),%rsi
lea    0xeec(%rip),%rdx
mov    $0x0,%al
call   1040 <mem_alloc@plt>
cltq
mov    %rax,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119e <spline+0x7e>
mov    -0x68(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1202 <spline+0xe2>
mov    -0x30(%rbp),%rax
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  0xe41(%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    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13dd <spline+0x2bd>
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdaf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xd89(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x68(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xcd6(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mov    -0x68(%rbp),%rax
mov    -0x3c(%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  -0x48(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1209 <spline+0xe9>
movsd  -0x28(%rbp),%xmm0
movsd  0xc16(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1413 <spline+0x2f3>
movsd  0xc24(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc17(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    14ae <spline+0x38e>
movsd  0xbfd(%rip),%xmm0
movsd  %xmm0,-0x50(%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  0xbbc(%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,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
mov    -0x68(%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  -0x50(%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  0xb1c(%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,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jl     1588 <spline+0x468>
mov    -0x30(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x68(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    152f <spline+0x40f>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r12
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
movslq %edx,%r13
lea    0x0(,%r13,8),%rdi
lea    0xefa(%rip),%rsi
lea    0xefe(%rip),%rdx
xor    %eax,%eax
call   1040 <mem_alloc@plt>
movsd  (%rsp),%xmm3
movslq %eax,%rdi
ucomisd 0xe8c(%rip),%xmm3
jbe    1187 <spline+0x67>
movq   $0x0,(%rdi)
movq   $0x0,(%r12)
jmp    11c5 <spline+0xa5>
movabs $0xbfe0000000000000,%rax
mov    %rax,(%r12)
movsd  0x8(%rbx),%xmm0
subsd  (%rbx),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%r15),%xmm2
subsd  (%r15),%xmm2
divsd  %xmm0,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rdi)
lea    -0x1(%r14),%eax
cmp    $0x3,%r14d
jl     13aa <spline+0x28a>
mov    %eax,%ecx
lea    (%rdi,%rcx,8),%rdx
cmp    %r12,%rdx
jbe    12c6 <spline+0x1a6>
lea    (%r12,%rcx,8),%rdx
cmp    %rdx,%rdi
jae    12c6 <spline+0x1a6>
add    $0xffffffffffffffff,%rcx
xor    %edx,%edx
movsd  0xe12(%rip),%xmm8
movsd  0xe12(%rip),%xmm1
movsd  0xe12(%rip),%xmm2
xchg   %ax,%ax
movsd  (%rbx,%rdx,8),%xmm4
movsd  0x8(%rbx,%rdx,8),%xmm3
subsd  %xmm4,%xmm3
movsd  0x10(%rbx,%rdx,8),%xmm5
subsd  %xmm4,%xmm5
divsd  %xmm5,%xmm3
movsd  (%r12,%rdx,8),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm8,%xmm4
movapd %xmm3,%xmm5
addsd  %xmm1,%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,0x8(%r12,%rdx,8)
movsd  0x8(%r15,%rdx,8),%xmm5
movsd  0x10(%r15,%rdx,8),%xmm6
subsd  %xmm5,%xmm6
movsd  0x8(%rbx,%rdx,8),%xmm7
movsd  0x10(%rbx,%rdx,8),%xmm0
subsd  %xmm7,%xmm0
subsd  (%r15,%rdx,8),%xmm5
subsd  (%rbx,%rdx,8),%xmm7
divsd  %xmm0,%xmm6
divsd  %xmm7,%xmm5
subsd  %xmm5,%xmm6
movsd  %xmm6,0x8(%rdi,%rdx,8)
mulsd  %xmm2,%xmm6
movsd  0x10(%rbx,%rdx,8),%xmm0
subsd  (%rbx,%rdx,8),%xmm0
divsd  %xmm0,%xmm6
mulsd  (%rdi,%rdx,8),%xmm3
subsd  %xmm3,%xmm6
divsd  %xmm4,%xmm6
movsd  %xmm6,0x8(%rdi,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1210 <spline+0xf0>
jmp    13aa <spline+0x28a>
movsd  (%r12),%xmm0
movsd  (%rdi),%xmm4
add    $0xffffffffffffffff,%rcx
xor    %edx,%edx
movsd  0xd31(%rip),%xmm8
movsd  0xd30(%rip),%xmm9
movsd  0xd30(%rip),%xmm3
movupd 0x8(%rbx,%rdx,8),%xmm5
movsd  (%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,0x8(%r12,%rdx,8)
movupd 0x8(%r15,%rdx,8),%xmm7
mulsd  %xmm4,%xmm5
movapd %xmm7,%xmm4
shufpd $0x1,%xmm7,%xmm4
movupd 0x8(%rbx,%rdx,8),%xmm2
movapd %xmm2,%xmm1
shufpd $0x1,%xmm2,%xmm1
movhpd (%r15,%rdx,8),%xmm7
movhpd (%rbx,%rdx,8),%xmm2
subpd  %xmm7,%xmm4
subpd  %xmm2,%xmm1
divpd  %xmm1,%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
subsd  %xmm1,%xmm4
movsd  %xmm4,0x8(%rdi,%rdx,8)
mulsd  %xmm3,%xmm4
movsd  0x10(%rbx,%rdx,8),%xmm1
subsd  (%rbx,%rdx,8),%xmm1
divsd  %xmm1,%xmm4
subsd  %xmm5,%xmm4
divsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%rdi,%rdx,8)
add    $0x1,%rdx
movapd %xmm6,%xmm0
cmp    %rdx,%rcx
jne    12f0 <spline+0x1d0>
movsd  0x8(%rsp),%xmm3
ucomisd 0xc48(%rip),%xmm3
jbe    13d1 <spline+0x2b1>
lea    -0x2(%r14),%ecx
movslq %ecx,%rdx
cltq
movsd  0xc65(%rip),%xmm0
movapd %xmm0,%xmm3
jmp    1420 <spline+0x300>
cltq
movsd  (%rbx,%rax,8),%xmm0
lea    -0x2(%r14),%ecx
subsd  -0x10(%rbx,%r13,8),%xmm0
lea    -0x2(%r13),%rdx
movsd  (%r15,%rax,8),%xmm1
subsd  -0x10(%r15,%r13,8),%xmm1
movapd 0xc44(%rip),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xc08(%rip),%xmm0
movsd  (%rdi,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%r12,%rdx,8),%xmm0
addsd  0xc01(%rip),%xmm0
subsd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,(%r12,%rax,8)
cmp    $0x2,%r14d
jl     14b6 <spline+0x396>
mov    %ecx,%eax
test   $0x1,%cl
jne    146e <spline+0x34e>
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     14b6 <spline+0x396>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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    1480 <spline+0x360>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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