#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ free_vector(double *, int, int);
double *vector(int, int);
void spline(double x[], double y[], int n, double yp1, double ypn,
            double y2[]) {
  int i, k;
  double p, qn, sig, un, *u;
  u = vector(1, n - 1);
  if (yp1 > 0.99e30)
    y2[1] = 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 (ypn > 0.99e30)
    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];
  free_vector(u, 1, n - 1);
}


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    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    $0x1,%edi
call   1040 <vector@plt>
mov    %rax,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1189 <spline+0x69>
mov    -0x60(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    11f2 <spline+0xd2>
mov    -0x30(%rbp),%rax
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm1
movsd  0xe54(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm2
divsd  %xmm2,%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     13cd <spline+0x2ad>
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,-0x50(%rbp)
movsd  -0x50(%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  0xdb7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xd91(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x40(%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
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xcde(%rip),%xmm1
mulsd  (%rax,%rcx,8),%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  -0x50(%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  -0x40(%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    11f9 <spline+0xd9>
movsd  -0x28(%rbp),%xmm0
movsd  0xc26(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13f9 <spline+0x2d9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1485 <spline+0x365>
movsd  0xc17(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xbdb(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x14(%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
movsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb3d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
jl     155a <spline+0x43a>
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    1501 <spline+0x3e1>
mov    -0x60(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
mov    $0x1,%esi
call   1030 <free_vector@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbp
lea    -0x1(%r15),%r14d
mov    $0x1,%edi
mov    %r14d,%esi
call   1040 <vector@plt>
movsd  (%rsp),%xmm3
ucomisd 0xe9f(%rip),%xmm3
jbe    1174 <spline+0x54>
movq   $0x0,0x8(%rax)
xorpd  %xmm0,%xmm0
mov    %rbx,%rcx
jmp    11c1 <spline+0xa1>
movabs $0xbfe0000000000000,%rcx
mov    %rcx,0x8(%rbx)
movsd  0x10(%rbp),%xmm0
subsd  0x8(%rbp),%xmm0
movsd  0x10(%r12),%xmm1
subsd  0x8(%r12),%xmm1
movapd 0xe8e(%rip),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
mov    %rax,%rcx
movsd  %xmm0,0x8(%rcx)
cmp    $0x3,%r15d
jl     13bd <spline+0x29d>
mov    %r15d,%ecx
lea    0x8(%rbx),%rdx
lea    (%rax,%rcx,8),%rsi
cmp    %rsi,%rdx
jae    12d6 <spline+0x1b6>
lea    (%rbx,%rcx,8),%rdx
mov    %rax,%rsi
add    $0x8,%rsi
cmp    %rdx,%rsi
jae    12d6 <spline+0x1b6>
shl    $0x3,%rcx
mov    $0x10,%edx
movsd  0xdfe(%rip),%xmm8
movsd  0xdfe(%rip),%xmm1
movsd  0xdfe(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rbp,%rdx,1),%xmm4
movsd  0x0(%rbp,%rdx,1),%xmm3
subsd  %xmm4,%xmm3
movsd  0x8(%rbp,%rdx,1),%xmm5
subsd  %xmm4,%xmm5
divsd  %xmm5,%xmm3
movsd  -0x8(%rbx,%rdx,1),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm8,%xmm4
movapd %xmm3,%xmm5
addsd  %xmm1,%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,(%rbx,%rdx,1)
movsd  (%r12,%rdx,1),%xmm5
movsd  0x8(%r12,%rdx,1),%xmm6
subsd  %xmm5,%xmm6
movsd  0x0(%rbp,%rdx,1),%xmm7
movsd  0x8(%rbp,%rdx,1),%xmm0
subsd  %xmm7,%xmm0
subsd  -0x8(%r12,%rdx,1),%xmm5
subsd  -0x8(%rbp,%rdx,1),%xmm7
divsd  %xmm0,%xmm6
divsd  %xmm7,%xmm5
subsd  %xmm5,%xmm6
movsd  %xmm6,(%rax,%rdx,1)
mulsd  %xmm2,%xmm6
movsd  0x8(%rbp,%rdx,1),%xmm0
subsd  -0x8(%rbp,%rdx,1),%xmm0
divsd  %xmm0,%xmm6
mulsd  -0x8(%rax,%rdx,1),%xmm3
subsd  %xmm3,%xmm6
divsd  %xmm4,%xmm6
movsd  %xmm6,(%rax,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%rcx
jne    1220 <spline+0x100>
jmp    13bd <spline+0x29d>
movsd  0x8(%rbx),%xmm0
movsd  0x8(%rax),%xmm4
add    $0xfffffffffffffffe,%rcx
xor    %edx,%edx
movsd  0xd19(%rip),%xmm8
movsd  0xd18(%rip),%xmm9
movsd  0xd18(%rip),%xmm3
movupd 0x10(%rbp,%rdx,8),%xmm5
movsd  0x8(%rbp,%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,0x10(%rbx,%rdx,8)
movupd 0x10(%r12,%rdx,8),%xmm7
mulsd  %xmm4,%xmm5
movapd %xmm7,%xmm4
shufpd $0x1,%xmm7,%xmm4
movupd 0x10(%rbp,%rdx,8),%xmm2
movapd %xmm2,%xmm1
shufpd $0x1,%xmm2,%xmm1
movhpd 0x8(%r12,%rdx,8),%xmm7
movhpd 0x8(%rbp,%rdx,8),%xmm2
subpd  %xmm7,%xmm4
subpd  %xmm2,%xmm1
divpd  %xmm1,%xmm4
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
subsd  %xmm1,%xmm4
movsd  %xmm4,0x10(%rax,%rdx,8)
mulsd  %xmm3,%xmm4
movsd  0x18(%rbp,%rdx,8),%xmm1
subsd  0x8(%rbp,%rdx,8),%xmm1
divsd  %xmm1,%xmm4
subsd  %xmm5,%xmm4
divsd  %xmm0,%xmm4
movsd  %xmm4,0x10(%rax,%rdx,8)
add    $0x1,%rdx
movapd %xmm6,%xmm0
cmp    %rdx,%rcx
jne    1300 <spline+0x1e0>
movsd  0x8(%rsp),%xmm3
ucomisd 0xc35(%rip),%xmm3
jbe    13dd <spline+0x2bd>
movslq %r14d,%rdx
movslq %r15d,%rcx
xorpd  %xmm0,%xmm0
xorpd  %xmm3,%xmm3
jmp    1427 <spline+0x307>
movslq %r15d,%rcx
movsd  0x0(%rbp,%rcx,8),%xmm0
movslq %r14d,%rdx
subsd  0x0(%rbp,%rdx,8),%xmm0
movsd  (%r12,%rcx,8),%xmm1
subsd  (%r12,%rdx,8),%xmm1
movapd 0xc2d(%rip),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xbf9(%rip),%xmm0
movsd  (%rax,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rbx,%rdx,8),%xmm0
addsd  0xbeb(%rip),%xmm0
subsd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,(%rbx,%rcx,8)
cmp    $0x2,%r15d
jl     1481 <spline+0x361>
mov    %r14d,%ecx
add    $0x1,%rcx
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rbx,%rcx,8),%xmm0
mulsd  (%rbx,%rcx,8),%xmm0
addsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbx,%rcx,8)
add    $0xffffffffffffffff,%rcx
cmp    $0x1,%rcx
ja     1460 <spline+0x340>
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free_vector@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 = load i32, i32* %9
%21 = sub nsw i32 %20, 1
%22 = call double* @vector(i32 1, i32 %21)
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** %19
%27 = getelementptr inbounds double, double* %26, i64 1
store double 0.000000e+00, double* %27
%28 = load double*, double** %12
%29 = getelementptr inbounds double, double* %28, i64 1
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 1
store double -5.000000e-01, double* %32
%33 = load double*, double** %7
%34 = getelementptr inbounds double, double* %33, i64 2
%35 = load double, double* %34
%36 = load double*, double** %7
%37 = getelementptr inbounds double, double* %36, i64 1
%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 2
%43 = load double, double* %42
%44 = load double*, double** %8
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = fsub double %43, %46
%48 = load double*, double** %7
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = load double*, double** %7
%52 = getelementptr inbounds double, double* %51, i64 1
%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 1
store double %58, double* %60
br label %61
61: ; preds = %30, %25
store i32 2, i32* %13
br label %62
62: ; preds = %200, %61
%63 = load i32, i32* %13
%64 = load i32, i32* %9
%65 = sub nsw i32 %64, 1
%66 = icmp sle i32 %63, %65
br i1 %66, label %67, label %203
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* %17
%94 = load double, double* %17
%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* %15
%102 = load double, double* %17
%103 = fsub double %102, 1.000000e+00
%104 = load double, double* %15
%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 = load double*, double** %19
%162 = load i32, i32* %13
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
store double %160, double* %164
%165 = load double*, double** %19
%166 = load i32, i32* %13
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
%169 = load double, double* %168
%170 = fmul double 6.000000e+00, %169
%171 = load double*, double** %7
%172 = load i32, i32* %13
%173 = add nsw i32 %172, 1
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double, double* %171, i64 %174
%176 = load double, double* %175
%177 = load double*, double** %7
%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 = fsub double %176, %182
%184 = fdiv double %170, %183
%185 = load double, double* %17
%186 = load double*, double** %19
%187 = load i32, i32* %13
%188 = sub nsw i32 %187, 1
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %186, i64 %189
%191 = load double, double* %190
%192 = fneg double %185
%193 = call double @llvm.fmuladd.f64(double %192, double %191, double %184)
%194 = load double, double* %15
%195 = fdiv double %193, %194
%196 = load double*, double** %19
%197 = load i32, i32* %13
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
store double %195, double* %199
br label %200
200: ; preds = %67
%201 = load i32, i32* %13
%202 = add nsw i32 %201, 1
store i32 %202, i32* %13
br label %62
203: ; preds = %62
%204 = load double, double* %11
%205 = fcmp ogt double %204, 9.900000e+29
br i1 %205, label %206, label %207
206: ; preds = %203
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %16
br label %249
207: ; preds = %203
store double 5.000000e-01, double* %16
%208 = load double*, double** %7
%209 = load i32, i32* %9
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds double, double* %208, i64 %210
%212 = load double, double* %211
%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 = fsub double %212, %218
%220 = fdiv double 3.000000e+00, %219
%221 = load double, double* %11
%222 = load double*, double** %8
%223 = load i32, i32* %9
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = load double*, double** %8
%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 = fsub double %226, %232
%234 = load double*, double** %7
%235 = load i32, i32* %9
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds double, double* %234, i64 %236
%238 = load double, double* %237
%239 = load double*, double** %7
%240 = load i32, i32* %9
%241 = sub nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %239, i64 %242
%244 = load double, double* %243
%245 = fsub double %238, %244
%246 = fdiv double %233, %245
%247 = fsub double %221, %246
%248 = fmul double %220, %247
store double %248, double* %18
br label %249
249: ; preds = %207, %206
%250 = load double, double* %18
%251 = load double, double* %16
%252 = load double*, double** %19
%253 = load i32, i32* %9
%254 = sub nsw i32 %253, 1
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds double, double* %252, i64 %255
%257 = load double, double* %256
%258 = fneg double %251
%259 = call double @llvm.fmuladd.f64(double %258, double %257, double %250)
%260 = load double, double* %16
%261 = load double*, double** %12
%262 = load i32, i32* %9
%263 = sub nsw i32 %262, 1
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %261, i64 %264
%266 = load double, double* %265
%267 = call double @llvm.fmuladd.f64(double %260, double %266, double 1.000000e+00)
%268 = fdiv double %259, %267
%269 = load double*, double** %12
%270 = load i32, i32* %9
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %269, i64 %271
store double %268, double* %272
%273 = load i32, i32* %9
%274 = sub nsw i32 %273, 1
store i32 %274, i32* %14
br label %275
275: ; preds = %300, %249
%276 = load i32, i32* %14
%277 = icmp sge i32 %276, 1
br i1 %277, label %278, label %303
278: ; preds = %275
%279 = load double*, double** %12
%280 = load i32, i32* %14
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds double, double* %279, i64 %281
%283 = load double, double* %282
%284 = load double*, double** %12
%285 = load i32, i32* %14
%286 = add nsw i32 %285, 1
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %284, i64 %287
%289 = load double, double* %288
%290 = load double*, double** %19
%291 = load i32, i32* %14
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds double, double* %290, i64 %292
%294 = load double, double* %293
%295 = call double @llvm.fmuladd.f64(double %283, double %289, double %294)
%296 = load double*, double** %12
%297 = load i32, i32* %14
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %296, i64 %298
store double %295, double* %299
br label %300
300: ; preds = %278
%301 = load i32, i32* %14
%302 = add nsw i32 %301, -1
store i32 %302, i32* %14
br label %275
303: ; preds = %275
%304 = load double*, double** %19
%305 = load i32, i32* %9
%306 = sub nsw i32 %305, 1
%307 = call i32 @free_vector(double* %304, i32 1, i32 %306)
ret void
}

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