void rq_interpolate_spline(unsigned int natural, double x[], double y[], int n,
                           double yp1, double ypn, double y2[]) {
  int i, k;
  double p, qn, sig, un, u[(50 + 256) * 4];
  if (natural) {
    y2[1] = 0.0;
    u[1] = 0.0;
  } else {
    y2[1] = -0.5;
    u[1] = (3.0 / (x[2] - x[1])) * ((y[2] - y[1]) / (x[2] - x[1]) - yp1);
  }
  for (i = 2; 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 (natural) {
    qn = un = 0.0;
  } else {
    qn = 0.5;
    un = (3.0 / (x[n] - x[n - 1])) *
         (ypn - (y[n] - y[n - 1]) / (x[n] - x[n - 1]));
  }
  y2[n] = (un - qn * u[n - 1]) / (qn * y2[n - 1] + 1.0);
  for (k = n - 1; k >= 1; k--) {
    y2[k] = y2[k] * y2[k + 1] + u[k];
  }
}


x86 assembly (clang, -O0):
<rq_interpolate_spline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2620,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <rq_interpolate_spline+0x4d>
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x2698(%rbp)
ff
jmp    11b5 <rq_interpolate_spline+0xb5>
mov    -0x38(%rbp),%rax
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
movsd  0xe88(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm2
divsd  %xmm2,%xmm1
subsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x2698(%rbp)
ff
movl   $0x2,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     138f <rq_interpolate_spline+0x28f>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%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
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdec(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xdc6(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movslq -0x3c(%rbp),%rax
movsd  %xmm0,-0x26a0(%rbp,%rax,8)
ff ff
movslq -0x3c(%rbp),%rax
movsd  0xd17(%rip),%xmm1
mulsd  -0x26a0(%rbp,%rax,8),%xmm1
ff ff
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%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    -0x3c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x26a0(%rbp,%rax,8),%xmm2
ff ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x48(%rbp),%xmm0
movslq -0x3c(%rbp),%rax
movsd  %xmm0,-0x26a0(%rbp,%rax,8)
ff ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11bc <rq_interpolate_spline+0xbc>
cmpl   $0x0,-0x4(%rbp)
je     13ae <rq_interpolate_spline+0x2ae>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    143a <rq_interpolate_spline+0x33a>
movsd  0xc5a(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xc1e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%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    -0x1c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x26a0(%rbp,%rax,8),%xmm2
ff ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb81(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x1,-0x40(%rbp)
jl     150e <rq_interpolate_spline+0x40e>
mov    -0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x40(%rbp),%rax
movsd  -0x26a0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    14b5 <rq_interpolate_spline+0x3b5>
add    $0x2620,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_interpolate_spline>:
sub    $0x25c8,%rsp
test   %edi,%edi
je     111d <rq_interpolate_spline+0x1d>
movq   $0x0,0x8(%r8)
xorpd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
jmp    116b <rq_interpolate_spline+0x6b>
movabs $0xbfe0000000000000,%rax
mov    %rax,0x8(%r8)
movsd  0x10(%rsi),%xmm2
subsd  0x8(%rsi),%xmm2
movsd  0x10(%rdx),%xmm3
subsd  0x8(%rdx),%xmm3
movapd 0xeb9(%rip),%xmm4
unpcklpd %xmm3,%xmm4
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm4
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm2
movsd  0xea5(%rip),%xmm0
movsd  %xmm2,-0x78(%rsp)
cmp    $0x3,%ecx
jl     1269 <rq_interpolate_spline+0x169>
mov    %ecx,%r9d
movsd  0x8(%rsi),%xmm7
movsd  0x10(%rsi),%xmm5
shl    $0x3,%r9
mov    $0x10,%eax
movsd  0xe7f(%rip),%xmm8
movsd  0xe7e(%rip),%xmm9
movsd  0xe7d(%rip),%xmm10
nopl   0x0(%rax,%rax,1)
subsd  %xmm7,%xmm5
movsd  0x8(%rsi,%rax,1),%xmm4
subsd  %xmm7,%xmm4
divsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm5,%xmm11
addsd  %xmm9,%xmm11
divsd  %xmm0,%xmm11
movsd  %xmm11,(%r8,%rax,1)
movupd (%rdx,%rax,1),%xmm4
mulsd  %xmm2,%xmm5
movapd %xmm4,%xmm2
shufpd $0x1,%xmm4,%xmm2
movupd (%rsi,%rax,1),%xmm7
movapd %xmm7,%xmm3
shufpd $0x1,%xmm7,%xmm3
movhpd -0x8(%rdx,%rax,1),%xmm4
subpd  %xmm4,%xmm2
movsd  -0x8(%rsi,%rax,1),%xmm4
movapd %xmm7,%xmm6
unpcklpd %xmm4,%xmm6
subpd  %xmm6,%xmm3
divpd  %xmm3,%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm10,%xmm2
movapd %xmm7,%xmm3
unpckhpd %xmm7,%xmm3
movapd %xmm3,%xmm6
subsd  %xmm4,%xmm6
divsd  %xmm6,%xmm2
subsd  %xmm5,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,-0x80(%rsp,%rax,1)
add    $0x8,%rax
movapd %xmm11,%xmm0
movapd %xmm3,%xmm5
cmp    %rax,%r9
jne    11b0 <rq_interpolate_spline+0xb0>
lea    -0x1(%rcx),%r9d
test   %edi,%edi
je     1281 <rq_interpolate_spline+0x181>
movslq %r9d,%rax
movslq %ecx,%rdi
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
jmp    12c7 <rq_interpolate_spline+0x1c7>
movslq %ecx,%rdi
movsd  (%rsi,%rdi,8),%xmm0
movslq %r9d,%rax
subsd  (%rsi,%rax,8),%xmm0
movsd  (%rdx,%rdi,8),%xmm2
subsd  (%rdx,%rax,8),%xmm2
movapd 0xd5d(%rip),%xmm3
unpcklpd %xmm2,%xmm3
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
subsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xd69(%rip),%xmm0
movsd  -0x80(%rsp,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
mulsd  (%r8,%rax,8),%xmm0
addsd  0xd59(%rip),%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r8,%rdi,8)
cmp    $0x2,%ecx
jl     1327 <rq_interpolate_spline+0x227>
mov    %r9d,%eax
add    $0x1,%rax
nopl   0x0(%rax)
movsd  -0x8(%r8,%rax,8),%xmm0
mulsd  (%r8,%rax,8),%xmm0
addsd  -0x88(%rsp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x8(%r8,%rax,8)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1300 <rq_interpolate_spline+0x200>
add    $0x25c8,%rsp
ret

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

LLVM IR (-O2):
define void @rq_interpolate_spline(i32 %0, double* nocapture %1, double* nocapture %2, i32 %3, double %4, double %5, double* nocapture %6) {
%8 = alloca [1224 x double]
%9 = bitcast [1224 x double]* %8 to i8*
%10 = icmp eq i32 %0, 0
%11 = getelementptr inbounds double, double* %6, i64 1
br i1 %10, label %13, label %12
12: ; preds = %7
store double 0.000000e+00, double* %11
br label %32
13: ; preds = %7
store double -5.000000e-01, double* %11
%14 = getelementptr inbounds double, double* %1, i64 2
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 1
%17 = load double, double* %16
%18 = fsub double %15, %17
%19 = getelementptr inbounds double, double* %2, i64 2
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %2, i64 1
%22 = load double, double* %21
%23 = fsub double %20, %22
%24 = insertelement <2 x double> <double 3.000000e+00, double poison>, double %23, i64 1
%25 = insertelement <2 x double> poison, double %18, i64 0
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> zeroinitializer
%27 = fdiv <2 x double> %24, %26
%28 = extractelement <2 x double> %27, i64 1
%29 = fsub double %28, %4
%30 = extractelement <2 x double> %27, i64 0
%31 = fmul double %30, %29
br label %32
32: ; preds = %13, %12
%33 = phi double [ -5.000000e-01, %13 ], [ 0.000000e+00, %12 ]
%34 = phi double [ %31, %13 ], [ 0.000000e+00, %12 ]
%35 = getelementptr inbounds [1224 x double], [1224 x double]* %8, i64 0, i64 1
store double %34, double* %35
%36 = icmp sgt i32 %3, 2
br i1 %36, label %37, label %90
37: ; preds = %32
%38 = zext i32 %3 to i64
%39 = getelementptr inbounds double, double* %1, i64 2
%40 = load double, double* %39
%41 = getelementptr inbounds double, double* %1, i64 1
%42 = load double, double* %41
br label %43
43: ; preds = %37, %43
%44 = phi double [ %34, %37 ], [ %88, %43 ]
%45 = phi double [ %33, %37 ], [ %60, %43 ]
%46 = phi double [ %42, %37 ], [ %74, %43 ]
%47 = phi double [ %40, %37 ], [ %83, %43 ]
%48 = phi i64 [ 2, %37 ], [ %53, %43 ]
%49 = getelementptr inbounds double, double* %1, i64 %48
%50 = add nsw i64 %48, -1
%51 = getelementptr inbounds double, double* %1, i64 %50
%52 = fsub double %47, %46
%53 = add nuw nsw i64 %48, 1
%54 = getelementptr inbounds double, double* %1, i64 %53
%55 = load double, double* %54
%56 = fsub double %55, %46
%57 = fdiv double %52, %56
%58 = tail call double @llvm.fmuladd.f64(double %57, double %45, double 2.000000e+00)
%59 = fadd double %57, -1.000000e+00
%60 = fdiv double %59, %58
%61 = getelementptr inbounds double, double* %6, i64 %48
store double %60, double* %61
%62 = getelementptr inbounds double, double* %2, i64 %48
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = shufflevector <2 x double> %64, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%66 = bitcast double* %49 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%69 = getelementptr inbounds double, double* %2, i64 %50
%70 = load double, double* %69
%71 = insertelement <2 x double> %64, double %70, i64 1
%72 = fsub <2 x double> %65, %71
%73 = load double, double* %51
%74 = extractelement <2 x double> %67, i64 0
%75 = insertelement <2 x double> %67, double %73, i64 1
%76 = fsub <2 x double> %68, %75
%77 = fdiv <2 x double> %72, %76
%78 = shufflevector <2 x double> %77, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%79 = fsub <2 x double> %77, %78
%80 = extractelement <2 x double> %79, i64 0
%81 = getelementptr inbounds [1224 x double], [1224 x double]* %8, i64 0, i64 %48
%82 = fmul double %80, 6.000000e+00
%83 = extractelement <2 x double> %67, i64 1
%84 = fsub double %83, %73
%85 = fdiv double %82, %84
%86 = fneg double %57
%87 = tail call double @llvm.fmuladd.f64(double %86, double %44, double %85)
%88 = fdiv double %87, %58
store double %88, double* %81
%89 = icmp eq i64 %53, %38
br i1 %89, label %90, label %43
90: ; preds = %43, %32
%91 = add i32 %3, -1
br i1 %10, label %95, label %92
92: ; preds = %90
%93 = sext i32 %91 to i64
%94 = sext i32 %3 to i64
br label %116
95: ; preds = %90
%96 = sext i32 %3 to i64
%97 = getelementptr inbounds double, double* %1, i64 %96
%98 = load double, double* %97
%99 = sext i32 %91 to i64
%100 = getelementptr inbounds double, double* %1, i64 %99
%101 = load double, double* %100
%102 = fsub double %98, %101
%103 = getelementptr inbounds double, double* %2, i64 %96
%104 = load double, double* %103
%105 = getelementptr inbounds double, double* %2, i64 %99
%106 = load double, double* %105
%107 = fsub double %104, %106
%108 = insertelement <2 x double> <double 3.000000e+00, double poison>, double %107, i64 1
%109 = insertelement <2 x double> poison, double %102, i64 0
%110 = shufflevector <2 x double> %109, <2 x double> poison, <2 x i32> zeroinitializer
%111 = fdiv <2 x double> %108, %110
%112 = extractelement <2 x double> %111, i64 1
%113 = fsub double %5, %112
%114 = extractelement <2 x double> %111, i64 0
%115 = fmul double %114, %113
br label %116
116: ; preds = %92, %95
%117 = phi i64 [ %94, %92 ], [ %96, %95 ]
%118 = phi i64 [ %93, %92 ], [ %99, %95 ]
%119 = phi double [ 0.000000e+00, %92 ], [ 5.000000e-01, %95 ]
%120 = phi double [ 0.000000e+00, %92 ], [ %115, %95 ]
%121 = getelementptr inbounds [1224 x double], [1224 x double]* %8, i64 0, i64 %118
%122 = load double, double* %121
%123 = fneg double %119
%124 = tail call double @llvm.fmuladd.f64(double %123, double %122, double %120)
%125 = getelementptr inbounds double, double* %6, i64 %118
%126 = load double, double* %125
%127 = tail call double @llvm.fmuladd.f64(double %119, double %126, double 1.000000e+00)
%128 = fdiv double %124, %127
%129 = getelementptr inbounds double, double* %6, i64 %117
store double %128, double* %129
%130 = icmp sgt i32 %3, 1
br i1 %130, label %131, label %145
131: ; preds = %116
%132 = zext i32 %91 to i64
br label %133
133: ; preds = %131, %133
%134 = phi i64 [ %132, %131 ], [ %143, %133 ]
%135 = getelementptr inbounds double, double* %6, i64 %134
%136 = load double, double* %135
%137 = add nuw nsw i64 %134, 1
%138 = getelementptr inbounds double, double* %6, i64 %137
%139 = load double, double* %138
%140 = getelementptr inbounds [1224 x double], [1224 x double]* %8, i64 0, i64 %134
%141 = load double, double* %140
%142 = tail call double @llvm.fmuladd.f64(double %136, double %139, double %141)
store double %142, double* %135
%143 = add nsw i64 %134, -1
%144 = icmp ugt i64 %134, 1
br i1 %144, label %133, label %145
145: ; preds = %133, %116
ret void
}