void spline(double *x, double *y, int n, double yp1, double ypn, double *y2,
            double *u) {
  int i, k;
  double p, qn, sig, un;
  if (yp1 > 0.99e30) {
    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 - 2; 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 (ypn > 0.99e30) {
    qn = 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];
  }
  return;
}


x86 assembly (clang, -O0):
<spline>:
push   %rbp
mov    %rsp,%rbp
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    %r8,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <spline+0x53>
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11b7 <spline+0xb7>
mov    -0x30(%rbp),%rax
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  0xe8c(%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    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1392 <spline+0x292>
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  0xdf2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xdcc(%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    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xd19(%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    -0x38(%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    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11be <spline+0xbe>
movsd  -0x28(%rbp),%xmm0
movsd  0xc61(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13be <spline+0x2be>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1459 <spline+0x359>
movsd  0xc52(%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  0xc11(%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    -0x38(%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  0xb69(%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     1533 <spline+0x433>
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    -0x38(%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    14da <spline+0x3da>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline>:
ucomisd 0xef8(%rip),%xmm0
jbe    1122 <spline+0x22>
movq   $0x0,(%r8)
movq   $0x0,(%rcx)
cmp    $0x3,%edx
jge    1167 <spline+0x67>
jmp    134a <spline+0x24a>
movabs $0xbfe0000000000000,%rax
mov    %rax,(%rcx)
movsd  0x8(%rdi),%xmm2
subsd  (%rdi),%xmm2
movsd  0xec8(%rip),%xmm3
divsd  %xmm2,%xmm3
movsd  0x8(%rsi),%xmm4
subsd  (%rsi),%xmm4
divsd  %xmm2,%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,(%r8)
cmp    $0x3,%edx
jl     134a <spline+0x24a>
lea    -0x1(%rdx),%r9d
lea    (%r8,%r9,8),%rax
cmp    %rcx,%rax
jbe    1265 <spline+0x165>
lea    (%rcx,%r9,8),%rax
cmp    %r8,%rax
jbe    1265 <spline+0x165>
add    $0xffffffffffffffff,%r9
xor    %eax,%eax
movsd  0xe7c(%rip),%xmm8
movsd  0xe7b(%rip),%xmm9
movsd  0xe7b(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rdi,%rax,8),%xmm5
movsd  0x8(%rdi,%rax,8),%xmm4
subsd  %xmm5,%xmm4
movsd  0x10(%rdi,%rax,8),%xmm6
subsd  %xmm5,%xmm6
divsd  %xmm6,%xmm4
movsd  (%rcx,%rax,8),%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm8,%xmm5
movapd %xmm4,%xmm6
addsd  %xmm9,%xmm6
divsd  %xmm5,%xmm6
movsd  %xmm6,0x8(%rcx,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm6
movsd  0x10(%rsi,%rax,8),%xmm7
subsd  %xmm6,%xmm7
movsd  0x8(%rdi,%rax,8),%xmm0
movsd  0x10(%rdi,%rax,8),%xmm2
subsd  %xmm0,%xmm2
subsd  (%rsi,%rax,8),%xmm6
subsd  (%rdi,%rax,8),%xmm0
divsd  %xmm2,%xmm7
divsd  %xmm0,%xmm6
subsd  %xmm6,%xmm7
movsd  %xmm7,0x8(%r8,%rax,8)
mulsd  %xmm3,%xmm7
movsd  0x10(%rdi,%rax,8),%xmm0
subsd  (%rdi,%rax,8),%xmm0
divsd  %xmm0,%xmm7
mulsd  (%r8,%rax,8),%xmm4
subsd  %xmm4,%xmm7
divsd  %xmm5,%xmm7
movsd  %xmm7,0x8(%r8,%rax,8)
add    $0x1,%rax
cmp    %rax,%r9
jne    11b0 <spline+0xb0>
jmp    134a <spline+0x24a>
movsd  (%rcx),%xmm0
movsd  (%r8),%xmm5
add    $0xffffffffffffffff,%r9
xor    %eax,%eax
movsd  0xd93(%rip),%xmm8
movsd  0xd92(%rip),%xmm9
movsd  0xd91(%rip),%xmm10
nop
movupd 0x8(%rdi,%rax,8),%xmm6
movsd  (%rdi,%rax,8),%xmm7
unpcklpd %xmm7,%xmm7
subpd  %xmm7,%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
divsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm6,%xmm7
addsd  %xmm9,%xmm7
divsd  %xmm0,%xmm7
movsd  %xmm7,0x8(%rcx,%rax,8)
movupd 0x8(%rsi,%rax,8),%xmm2
mulsd  %xmm5,%xmm6
movapd %xmm2,%xmm5
shufpd $0x1,%xmm2,%xmm5
movupd 0x8(%rdi,%rax,8),%xmm4
movapd %xmm4,%xmm3
shufpd $0x1,%xmm4,%xmm3
movhpd (%rsi,%rax,8),%xmm2
movhpd (%rdi,%rax,8),%xmm4
subpd  %xmm2,%xmm5
subpd  %xmm4,%xmm3
divpd  %xmm3,%xmm5
movapd %xmm5,%xmm2
unpckhpd %xmm5,%xmm2
subsd  %xmm2,%xmm5
movsd  %xmm5,0x8(%r8,%rax,8)
mulsd  %xmm10,%xmm5
movsd  0x10(%rdi,%rax,8),%xmm2
subsd  (%rdi,%rax,8),%xmm2
divsd  %xmm2,%xmm5
subsd  %xmm6,%xmm5
divsd  %xmm0,%xmm5
movsd  %xmm5,0x8(%r8,%rax,8)
add    $0x1,%rax
movapd %xmm7,%xmm0
cmp    %rax,%r9
jne    1290 <spline+0x190>
lea    -0x2(%rdx),%r9d
ucomisd 0xcaa(%rip),%xmm1
jbe    136b <spline+0x26b>
movslq %r9d,%r10
lea    -0x1(%rdx),%esi
movslq %esi,%rdi
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
jmp    13b9 <spline+0x2b9>
movslq %edx,%rax
movsd  -0x8(%rdi,%rax,8),%xmm0
movslq %r9d,%r10
subsd  (%rdi,%r10,8),%xmm0
lea    -0x1(%rax),%rdi
movsd  -0x8(%rsi,%rax,8),%xmm2
subsd  (%rsi,%r10,8),%xmm2
movapd 0xcab(%rip),%xmm3
unpcklpd %xmm2,%xmm3
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
subsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xc6f(%rip),%xmm0
movsd  (%r8,%r10,8),%xmm2
mulsd  %xmm0,%xmm2
mulsd  (%rcx,%r10,8),%xmm0
addsd  0xc5f(%rip),%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx,%rdi,8)
cmp    $0x2,%edx
jl     1443 <spline+0x343>
mov    %r9d,%eax
test   $0x1,%r9b
jne    1406 <spline+0x306>
movsd  (%rcx,%rax,8),%xmm0
mulsd  0x8(%rcx,%rax,8),%xmm0
addsd  (%r8,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
add    $0xffffffffffffffff,%rax
test   %r9d,%r9d
je     1443 <spline+0x343>
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm0
mulsd  0x8(%rcx,%rax,8),%xmm0
addsd  (%r8,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
mulsd  -0x8(%rcx,%rax,8),%xmm0
addsd  -0x8(%r8,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rax,8)
add    $0xfffffffffffffffe,%rax
cmp    $0xffffffffffffffff,%rax
jne    1410 <spline+0x310>
ret

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

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