#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 */
scalar_t__ abs(double);
int /*<<< orphan*/ error_handler(char *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int nearest_index(double const, double const *, int);
void cubic_spline_sp(int size1, int size2, const double *grid1,
                     const double *grid2, const double *data1, double *data2) {
  double *delta = NULL, *d = NULL, *dh = NULL, *b = NULL, *c = NULL;
  double h, h2, s, w1, w2, p;
  int i, k, n, klo, khi, kmax;
  for (i = 1; i < size1; i++) {
    if (grid1[i] <= grid1[i - 1])
      error_handler("cubic_spline_sp: grid1 is not monotonic increasing");
  }
  for (i = 0; i < size2; i++) {
    if (grid2[i] < grid1[0] || grid2[i] > grid1[size1 - 1])
      error_handler("cubic_spline_sp: grid2 lies outside grid1");
  }
  if (size1 < 2)
    error_handler(
        "cubic_spline_sp: the size of input grid should be at least 2");
  if (size1 == 2) {
    p = (data1[1] - data1[0]) / (grid1[1] - grid1[0]);
    for (i = 0; i < size2; i++)
      data2[i] = p * (grid2[i] - grid1[0]) + data1[0];
    return;
  }
  delta = (double *)malloc((size1 - 1) * sizeof(double));
  dh = (double *)malloc((size1 - 1) * sizeof(double));
  d = (double *)malloc(size1 * sizeof(double));
  for (k = 0; k < size1 - 1; k++) {
    dh[k] = grid1[k + 1] - grid1[k];
    delta[k] = (data1[k + 1] - data1[k]) / (dh[k]);
  }
  for (k = 1; k < size1 - 1; k++) {
    if (delta[k] * delta[k - 1] > 0.0) {
      w1 = 2.0 * dh[k] + dh[k - 1];
      w2 = dh[k] + 2.0 * dh[k - 1];
      d[k] = (w1 + w2) / (w1 / delta[k - 1] + w2 / delta[k]);
    } else {
      d[k] = 0.0;
    }
  }
  kmax = size1 - 1;
  d[0] =
      ((2.0 * dh[0] + dh[1]) * delta[0] - dh[0] * delta[1]) / (dh[0] + dh[1]);
  if (d[0] * delta[0] < 0.0) {
    d[0] = 0.0;
  } else {
    if (delta[0] * delta[1] < 0.0 && abs(d[0]) > abs(3.0 * delta[0])) {
      d[0] = 3.0 * delta[0];
    }
  }
  d[kmax] = ((2.0 * dh[kmax - 1] + dh[kmax - 2]) * delta[kmax - 1] -
             dh[kmax - 1] * delta[kmax - 2]) /
            (dh[kmax - 1] + dh[kmax - 2]);
  if (d[kmax] * delta[kmax - 1] < 0.0) {
    d[kmax] = 0.0;
  } else {
    if (delta[kmax - 1] * delta[kmax - 2] < 0.0 &&
        abs(d[kmax]) > abs(3.0 * delta[kmax - 1])) {
      d[kmax] = 3.0 * delta[kmax - 1];
    }
  }
  b = (double *)malloc((size1 - 1) * sizeof(double));
  c = (double *)malloc((size1 - 1) * sizeof(double));
  for (k = 0; k < size1 - 1; k++) {
    h = dh[k];
    h2 = h * h;
    c[k] = (3.0 * delta[k] - 2.0 * d[k] - d[k + 1]) / dh[k];
    b[k] = (d[k] - 2.0 * delta[k] + d[k + 1]) / (dh[k] * dh[k]);
  }
  for (k = 0; k < size2; k++) {
    n = nearest_index(grid2[k], grid1, size1);
    if (grid1[n] < grid2[k]) {
      klo = n;
    } else {
      if (n == 0) {
        klo = n;
      } else {
        klo = n - 1;
      }
    }
    khi = klo + 1;
    s = grid2[k] - grid1[klo];
    data2[k] = data1[klo] + s * (d[klo] + s * (c[klo] + s * b[klo]));
  }
  free(c);
  free(b);
  free(d);
  free(dh);
  free(delta);
}


x86 assembly (clang, -O0):
<cubic_spline_sp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1206 <cubic_spline_sp+0xb6>
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x84(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     11ed <cubic_spline_sp+0x9d>
lea    0xe28(%rip),%rdi
call   1050 <error_handler@plt>
jmp    11f2 <cubic_spline_sp+0xa2>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11a3 <cubic_spline_sp+0x53>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128e <cubic_spline_sp+0x13e>
mov    -0x18(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
ja     1269 <cubic_spline_sp+0x119>
mov    -0x18(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1275 <cubic_spline_sp+0x125>
lea    0xdd3(%rip),%rdi
call   1050 <error_handler@plt>
jmp    127a <cubic_spline_sp+0x12a>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1210 <cubic_spline_sp+0xc0>
cmpl   $0x2,-0x4(%rbp)
jge    12a4 <cubic_spline_sp+0x154>
lea    0xdce(%rip),%rdi
call   1050 <error_handler@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1348 <cubic_spline_sp+0x1f8>
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1343 <cubic_spline_sp+0x1f3>
movsd  -0x80(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    12e3 <cubic_spline_sp+0x193>
jmp    1b68 <cubic_spline_sp+0xa18>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1435 <cubic_spline_sp+0x2e5>
mov    -0x10(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x88(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x88(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1393 <cubic_spline_sp+0x243>
movl   $0x1,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    156b <cubic_spline_sp+0x41b>
mov    -0x30(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x88(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    153f <cubic_spline_sp+0x3ef>
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x88(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x40(%rbp),%rax
mov    -0x88(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x88(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm1
movsd  -0x78(%rbp),%xmm2
mov    -0x30(%rbp),%rax
movslq -0x88(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1552 <cubic_spline_sp+0x402>
mov    -0x38(%rbp),%rax
movslq -0x88(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1557 <cubic_spline_sp+0x407>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    143f <cubic_spline_sp+0x2ef>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x40(%rbp),%rax
addsd  0x8(%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1612 <cubic_spline_sp+0x4c2>
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1689 <cubic_spline_sp+0x539>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
mulsd  0x8(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1684 <cubic_spline_sp+0x534>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <abs@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x30(%rbp),%rax
movsd  0x9b0(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <abs@plt>
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
cmp    %rcx,%rax
jle    1684 <cubic_spline_sp+0x534>
mov    -0x30(%rbp),%rax
movsd  0x988(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1689 <cubic_spline_sp+0x539>
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x98(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x98(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    17a1 <cubic_spline_sp+0x651>
mov    -0x38(%rbp),%rax
movslq -0x98(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    185b <cubic_spline_sp+0x70b>
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1856 <cubic_spline_sp+0x706>
mov    -0x38(%rbp),%rax
movslq -0x98(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <abs@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x7f4(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
call   1040 <abs@plt>
mov    %rax,%rcx
mov    -0xa8(%rbp),%rax
cmp    %rcx,%rax
jle    1856 <cubic_spline_sp+0x706>
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x7bf(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x98(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    185b <cubic_spline_sp+0x70b>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    19d4 <cubic_spline_sp+0x884>
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  0x71a(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0x6ee(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x40(%rbp),%rax
movslq -0x88(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1893 <cubic_spline_sp+0x743>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1b3b <cubic_spline_sp+0x9eb>
mov    -0x18(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1070 <nearest_index@plt>
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1a4a <cubic_spline_sp+0x8fa>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    1a7c <cubic_spline_sp+0x92c>
cmpl   $0x0,-0x8c(%rbp)
jne    1a68 <cubic_spline_sp+0x918>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    1a77 <cubic_spline_sp+0x927>
mov    -0x8c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1a7c <cubic_spline_sp+0x92c>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x90(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x68(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x68(%rbp),%xmm2
mov    -0x50(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm5
movsd  -0x68(%rbp),%xmm4
mov    -0x48(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    19de <cubic_spline_sp+0x88e>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_spline_sp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r13
mov    %r8,0x58(%rsp)
mov    %rcx,0x40(%rsp)
mov    %rdx,%r15
mov    %esi,0x34(%rsp)
mov    %edi,%r12d
cmp    $0x2,%edi
jl     11b2 <cubic_spline_sp+0x62>
mov    %r12d,%ebx
mov    $0x1,%ebp
lea    0xe97(%rip),%r14
jmp    1199 <cubic_spline_sp+0x49>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     11b2 <cubic_spline_sp+0x62>
movsd  -0x8(%r15,%rbp,8),%xmm0
ucomisd (%r15,%rbp,8),%xmm0
jb     1190 <cubic_spline_sp+0x40>
mov    %r14,%rdi
call   1050 <error_handler@plt>
jmp    1190 <cubic_spline_sp+0x40>
mov    %r12,0x28(%rsp)
cmpl   $0x0,0x34(%rsp)
mov    0x40(%rsp),%rcx
jle    1210 <cubic_spline_sp+0xc0>
mov    0x28(%rsp),%rax
add    $0xffffffff,%eax
movslq %eax,%r12
mov    0x34(%rsp),%ebx
xor    %ebp,%ebp
lea    0xe78(%rip),%r14
jmp    11f6 <cubic_spline_sp+0xa6>
nopl   (%rax)
mov    %r14,%rdi
call   1050 <error_handler@plt>
mov    0x40(%rsp),%rcx
add    $0x1,%rbp
cmp    %rbp,%rbx
je     1210 <cubic_spline_sp+0xc0>
movsd  (%rcx,%rbp,8),%xmm0
movsd  (%r15),%xmm1
ucomisd %xmm0,%xmm1
ja     11e0 <cubic_spline_sp+0x90>
ucomisd (%r15,%r12,8),%xmm0
ja     11e0 <cubic_spline_sp+0x90>
jmp    11ed <cubic_spline_sp+0x9d>
mov    0x28(%rsp),%r12
cmp    $0x1,%r12d
jg     1231 <cubic_spline_sp+0xe1>
lea    0xe5b(%rip),%rdi
call   1050 <error_handler@plt>
mov    0x58(%rsp),%rbx
jmp    1321 <cubic_spline_sp+0x1d1>
cmp    $0x2,%r12d
mov    0x58(%rsp),%rbx
jne    1321 <cubic_spline_sp+0x1d1>
mov    0x34(%rsp),%eax
test   %eax,%eax
mov    0x40(%rsp),%rdx
jle    1934 <cubic_spline_sp+0x7e4>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm0
subsd  %xmm1,%xmm0
movsd  (%r15),%xmm2
movsd  0x8(%r15),%xmm3
subsd  %xmm2,%xmm3
divsd  %xmm3,%xmm0
movsd  (%rdx),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x0(%r13)
cmp    $0x1,%eax
je     1934 <cubic_spline_sp+0x7e4>
mov    %eax,%eax
lea    -0x1(%rax),%r8
mov    $0x1,%ecx
cmp    $0x4,%r8
jae    1865 <cubic_spline_sp+0x715>
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
jne    12d1 <cubic_spline_sp+0x181>
mov    0x40(%rsp),%rsi
movsd  (%rsi,%rcx,8),%xmm1
subsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx),%xmm1
movsd  %xmm1,0x0(%r13,%rcx,8)
add    $0x1,%rcx
add    %rax,%rdx
mov    0x40(%rsp),%rdx
je     1934 <cubic_spline_sp+0x7e4>
nop
movsd  (%rdx,%rcx,8),%xmm1
subsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx),%xmm1
movsd  %xmm1,0x0(%r13,%rcx,8)
movsd  0x8(%rdx,%rcx,8),%xmm1
subsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx),%xmm1
movsd  %xmm1,0x8(%r13,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    12e0 <cubic_spline_sp+0x190>
jmp    1934 <cubic_spline_sp+0x7e4>
mov    %r15,0x38(%rsp)
lea    -0x1(%r12),%r15d
lea    -0x8(,%r12,8),%r14d
ff
mov    %r14d,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %r14d,0x18(%rsp)
mov    %r14d,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0x0(,%r12,8),%edi
call   1060 <malloc@plt>
mov    %rax,%rsi
cmp    $0x2,%r12d
mov    %rbp,0x20(%rsp)
mov    %r14,0x60(%rsp)
mov    %rax,0x10(%rsp)
jl     1434 <cubic_spline_sp+0x2e4>
mov    %r15d,%eax
cmp    $0x2,%r15d
jae    15bc <cubic_spline_sp+0x46c>
xor    %ecx,%ecx
mov    0x38(%rsp),%rdi
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rdi,%rcx,8),%xmm0
subsd  (%rdi,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm1
subsd  (%rbx,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp,%rcx,8)
lea    0x1(%rcx),%rdx
mov    %rdx,%rcx
cmp    %rdx,%rax
jne    1390 <cubic_spline_sp+0x240>
cmp    $0x3,%r12d
jl     1434 <cubic_spline_sp+0x2e4>
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
jmp    13df <cubic_spline_sp+0x28f>
movsd  %xmm1,0x8(%rsi,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
je     1434 <cubic_spline_sp+0x2e4>
movupd 0x0(%rbp,%rcx,8),%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jbe    13d0 <cubic_spline_sp+0x280>
movupd (%r14,%rcx,8),%xmm1
movapd %xmm1,%xmm2
addpd  %xmm1,%xmm2
shufpd $0x1,%xmm2,%xmm2
addpd  %xmm1,%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
jmp    13d0 <cubic_spline_sp+0x280>
movslq %r15d,%rbx
movsd  (%r14),%xmm1
movsd  0x8(%r14),%xmm2
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  0x8(%rbp),%xmm3
mulsd  %xmm1,%xmm3
mulsd  0x0(%rbp),%xmm0
subsd  %xmm3,%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
movsd  0x0(%rbp),%xmm1
movapd %xmm1,%xmm3
mulsd  %xmm0,%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm3,%xmm2
ja     14c3 <cubic_spline_sp+0x373>
mulsd  0x8(%rbp),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jbe    14c7 <cubic_spline_sp+0x377>
call   1040 <abs@plt>
mov    %rax,%r14
movsd  0x0(%rbp),%xmm0
mulsd  0xb59(%rip),%xmm0
call   1040 <abs@plt>
mov    0x10(%rsp),%rsi
cmp    %rax,%r14
jle    14c7 <cubic_spline_sp+0x377>
movsd  0x0(%rbp),%xmm2
mulsd  0xb3d(%rip),%xmm2
movsd  %xmm2,(%rsi)
movslq %r12d,%r14
mov    0x60(%rsp),%rax
movsd  -0x18(%rax,%r14,8),%xmm1
movsd  -0x10(%rax,%r14,8),%xmm2
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp,%r14,8),%xmm3
mulsd  %xmm2,%xmm3
mulsd  -0x10(%rbp,%r14,8),%xmm0
subsd  %xmm3,%xmm0
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rsi,%rbx,8)
movsd  -0x10(%rbp,%r14,8),%xmm1
movapd %xmm1,%xmm3
mulsd  %xmm0,%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm3,%xmm2
ja     1576 <cubic_spline_sp+0x426>
lea    -0x3(%r14),%rax
mulsd  0x0(%rbp,%rax,8),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jbe    157b <cubic_spline_sp+0x42b>
add    $0xfffffffffffffffe,%r14
call   1040 <abs@plt>
mov    %rax,0x50(%rsp)
movsd  0x0(%rbp,%r14,8),%xmm0
mulsd  0xaaa(%rip),%xmm0
call   1040 <abs@plt>
cmp    %rax,0x50(%rsp)
jle    157b <cubic_spline_sp+0x42b>
movsd  0x0(%rbp,%r14,8),%xmm2
mulsd  0xa8f(%rip),%xmm2
mov    0x10(%rsp),%rsi
movsd  %xmm2,(%rsi,%rbx,8)
mov    0x18(%rsp),%ebx
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,%rsi
cmp    $0x2,%r12d
mov    0x60(%rsp),%r11
mov    %rax,0x18(%rsp)
jl     1a1b <cubic_spline_sp+0x8cb>
mov    %r15d,%r9d
cmp    $0x2,%r15d
jae    16d5 <cubic_spline_sp+0x585>
xor    %r8d,%r8d
jmp    198e <cubic_spline_sp+0x83e>
mov    %r15d,0x50(%rsp)
mov    %r13,0x48(%rsp)
lea    (%r14,%rax,8),%rcx
lea    0x0(,%rax,8),%r13
add    %rbp,%r13
mov    0x38(%rsp),%r15
lea    (%r15,%rax,8),%rsi
add    $0x8,%rsi
lea    (%rbx,%rax,8),%rdi
add    $0x8,%rdi
cmp    %r13,%r14
mov    %r14,%rdx
setb   %r14b
cmp    %rcx,%rbp
setb   %r12b
cmp    %rsi,%rdx
setb   %r10b
cmp    %r15,%rcx
seta   %r8b
cmp    %rdi,%rdx
setb   %r11b
cmp    %rbx,%rcx
seta   %r9b
cmp    %rsi,%rbp
setb   %sil
cmp    %r15,%r13
seta   %dl
cmp    %rdi,%rbp
setb   %dil
cmp    %rbx,%r13
seta   %bpl
xor    %ecx,%ecx
test   %r12b,%r14b
jne    1943 <cubic_spline_sp+0x7f3>
and    %r8b,%r10b
mov    0x58(%rsp),%rbx
mov    0x28(%rsp),%r12
mov    0x48(%rsp),%r13
mov    0x60(%rsp),%r14
mov    0x50(%rsp),%r15d
jne    1856 <cubic_spline_sp+0x706>
and    %r9b,%r11b
jne    1856 <cubic_spline_sp+0x706>
and    %dl,%sil
jne    1856 <cubic_spline_sp+0x706>
and    %bpl,%dil
mov    0x20(%rsp),%rbp
mov    0x10(%rsp),%rsi
mov    0x38(%rsp),%rdi
jne    1390 <cubic_spline_sp+0x240>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
xor    %edx,%edx
movupd (%rdi,%rdx,8),%xmm0
movupd 0x8(%rdi,%rdx,8),%xmm1
subpd  %xmm0,%xmm1
movupd %xmm1,(%r14,%rdx,8)
movupd (%rbx,%rdx,8),%xmm0
movupd 0x8(%rbx,%rdx,8),%xmm2
subpd  %xmm0,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,0x0(%rbp,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rcx
jne    1690 <cubic_spline_sp+0x540>
cmp    %rax,%rcx
jne    1390 <cubic_spline_sp+0x240>
jmp    13c2 <cubic_spline_sp+0x272>
mov    %r13,0x48(%rsp)
lea    (%rsi,%r9,8),%rbx
lea    (%r14,%r9,8),%rbp
lea    (%r11,%r9,8),%rdi
mov    0x20(%rsp),%rdx
lea    (%rdx,%r9,8),%r10
mov    0x10(%rsp),%rcx
lea    (%rcx,%r9,8),%r8
add    $0x8,%r8
cmp    %rbp,%rsi
setb   0xf(%rsp)
cmp    %rbx,%r14
setb   %r15b
cmp    %rdi,%rsi
mov    %r14,%rax
setb   %r14b
cmp    %rbx,%r11
setb   0xe(%rsp)
cmp    %r10,%rsi
setb   %r13b
cmp    %rbx,%rdx
setb   0xd(%rsp)
cmp    %r8,%rsi
setb   %r12b
cmp    %rbx,%rcx
setb   %bl
cmp    %rdi,%rax
setb   %sil
cmp    %rbp,%r11
setb   0xc(%rsp)
cmp    %r10,%rax
setb   %dil
cmp    %rbp,%rdx
setb   0xb(%rsp)
mov    %rax,%rdx
cmp    %r8,%rax
setb   %r10b
cmp    %rbp,%rcx
setb   %al
xor    %r8d,%r8d
test   %r15b,0xf(%rsp)
jne    1970 <cubic_spline_sp+0x820>
and    0xe(%rsp),%r14b
jne    1970 <cubic_spline_sp+0x820>
and    0xd(%rsp),%r13b
mov    %rdx,%r14
jne    197f <cubic_spline_sp+0x82f>
and    %bl,%r12b
mov    0x48(%rsp),%r13
jne    1984 <cubic_spline_sp+0x834>
and    0xc(%rsp),%sil
mov    0x28(%rsp),%r12
jne    1989 <cubic_spline_sp+0x839>
and    0xb(%rsp),%dil
jne    1989 <cubic_spline_sp+0x839>
and    %al,%r10b
mov    0x18(%rsp),%rsi
jne    198e <cubic_spline_sp+0x83e>
mov    %r9d,%r8d
and    $0xfffffffe,%r8d
xor    %ecx,%ecx
movapd 0x83a(%rip),%xmm0
mov    0x20(%rsp),%rax
mov    0x10(%rsp),%rdx
movupd (%r11,%rcx,8),%xmm1
movupd (%rax,%rcx,8),%xmm2
movupd (%rdx,%rcx,8),%xmm3
movupd 0x8(%rdx,%rcx,8),%xmm4
addpd  %xmm3,%xmm3
mulpd  %xmm0,%xmm2
subpd  %xmm3,%xmm2
subpd  %xmm4,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rsi,%rcx,8)
movupd (%rax,%rcx,8),%xmm1
addpd  %xmm1,%xmm1
movupd (%rdx,%rcx,8),%xmm2
subpd  %xmm1,%xmm2
movupd 0x8(%rdx,%rcx,8),%xmm1
addpd  %xmm2,%xmm1
movupd (%r11,%rcx,8),%xmm2
mulpd  %xmm2,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%r14,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%r8
jne    17e0 <cubic_spline_sp+0x690>
cmp    %r9,%r8
jne    198e <cubic_spline_sp+0x83e>
jmp    1a1b <cubic_spline_sp+0x8cb>
mov    0x20(%rsp),%rbp
mov    0x10(%rsp),%rsi
jmp    1386 <cubic_spline_sp+0x236>
lea    0x8(%r13),%r9
lea    0x0(,%rax,8),%rdi
add    %r13,%rdi
lea    0x8(%rdx),%r14
lea    (%rdx,%rax,8),%rbp
cmp    %r15,%r13
setb   %r10b
cmp    %r15,%rdi
seta   %r11b
cmp    %rbx,%r13
setb   %dl
cmp    %rbx,%rdi
seta   %sil
cmp    %rbp,%r9
setb   %r9b
cmp    %rdi,%r14
setb   %dil
test   %r11b,%r10b
jne    12a5 <cubic_spline_sp+0x155>
and    %sil,%dl
jne    12a5 <cubic_spline_sp+0x155>
and    %dil,%r9b
mov    0x40(%rsp),%rdx
jne    12a5 <cubic_spline_sp+0x155>
mov    %r8,%rsi
and    $0xfffffffffffffffc,%rsi
lea    0x1(%rsi),%rcx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
movsd  (%r15),%xmm2
unpcklpd %xmm2,%xmm2
movsd  (%rbx),%xmm3
unpcklpd %xmm3,%xmm3
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd 0x8(%rdx,%rdi,8),%xmm4
movupd 0x18(%rdx,%rdi,8),%xmm5
subpd  %xmm2,%xmm4
subpd  %xmm2,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm3,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,0x8(%r13,%rdi,8)
movupd %xmm5,0x18(%r13,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rsi
jne    18f0 <cubic_spline_sp+0x7a0>
cmp    %rsi,%r8
jne    12a5 <cubic_spline_sp+0x155>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x58(%rsp),%rbx
mov    0x28(%rsp),%r12
mov    0x20(%rsp),%rbp
mov    0x48(%rsp),%r13
mov    0x60(%rsp),%r14
mov    0x10(%rsp),%rsi
mov    0x38(%rsp),%rdi
mov    0x50(%rsp),%r15d
jmp    1390 <cubic_spline_sp+0x240>
mov    0x48(%rsp),%r13
mov    0x28(%rsp),%r12
mov    %rdx,%r14
jmp    1989 <cubic_spline_sp+0x839>
mov    0x48(%rsp),%r13
mov    0x28(%rsp),%r12
mov    0x18(%rsp),%rsi
lea    (%r14,%r8,8),%rdx
lea    (%rsi,%r8,8),%rbx
mov    0x10(%rsp),%rax
lea    (%rax,%r8,8),%rdi
add    $0x8,%rdi
mov    0x20(%rsp),%rax
lea    (%rax,%r8,8),%rbp
lea    (%r11,%r8,8),%rcx
sub    %r8,%r9
xor    %eax,%eax
movsd  0x643(%rip),%xmm0
nopl   (%rax)
movsd  -0x8(%rdi,%rax,8),%xmm1
addsd  %xmm1,%xmm1
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
subsd  (%rdi,%rax,8),%xmm2
divsd  (%rcx,%rax,8),%xmm2
movsd  %xmm2,(%rbx,%rax,8)
movsd  -0x8(%rdi,%rax,8),%xmm1
movsd  0x0(%rbp,%rax,8),%xmm2
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
addsd  (%rdi,%rax,8),%xmm1
movsd  (%rcx,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rdx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r9
jne    19c0 <cubic_spline_sp+0x870>
mov    %r14,0x50(%rsp)
mov    0x34(%rsp),%eax
test   %eax,%eax
mov    0x58(%rsp),%rbx
mov    0x40(%rsp),%rdx
mov    0x38(%rsp),%r15
jle    1acc <cubic_spline_sp+0x97c>
mov    %r12,%r14
mov    %eax,%ebp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rdx,%r12,8),%xmm0
mov    %r15,%rdi
mov    %r14d,%esi
call   1070 <nearest_index@plt>
mov    0x18(%rsp),%rsi
mov    0x40(%rsp),%rdx
cltq
mov    %eax,%ecx
sub    $0x1,%ecx
mov    $0x0,%edi
cmovb  %edi,%ecx
movsd  (%rdx,%r12,8),%xmm0
ucomisd (%r15,%rax,8),%xmm0
cmova  %eax,%ecx
movslq %ecx,%rax
subsd  (%r15,%rax,8),%xmm0
mov    0x50(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
mov    0x10(%rsp),%rcx
addsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rax,8),%xmm1
movsd  %xmm1,0x0(%r13,%r12,8)
add    $0x1,%r12
cmp    %r12,%rbp
jne    1a50 <cubic_spline_sp+0x900>
mov    %rsi,%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"cubic_spline_sp: grid1 is not monotonic increasing\00"
@.str.1 = [42 x i8] c"cubic_spline_sp: grid2 lies outside grid1\00"
@.str.2 = [61 x i8] c"cubic_spline_sp: the size of input grid should be at least 2\00"
define void @cubic_spline_sp(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store double* null, double** %13
store double* null, double** %14
store double* null, double** %15
store double* null, double** %16
store double* null, double** %17
store i32 1, i32* %24
br label %30
30: ; preds = %50, %6
%31 = load i32, i32* %24
%32 = load i32, i32* %7
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %53
34: ; preds = %30
%35 = load double*, double** %9
%36 = load i32, i32* %24
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = load double*, double** %9
%41 = load i32, i32* %24
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %40, i64 %43
%45 = load double, double* %44
%46 = fcmp ole double %39, %45
br i1 %46, label %47, label %49
47: ; preds = %34
%48 = call i32 @error_handler(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %49
49: ; preds = %47, %34
br label %50
50: ; preds = %49
%51 = load i32, i32* %24
%52 = add nsw i32 %51, 1
store i32 %52, i32* %24
br label %30
53: ; preds = %30
store i32 0, i32* %24
br label %54
54: ; preds = %84, %53
%55 = load i32, i32* %24
%56 = load i32, i32* %8
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %87
58: ; preds = %54
%59 = load double*, double** %10
%60 = load i32, i32* %24
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %9
%65 = getelementptr inbounds double, double* %64, i64 0
%66 = load double, double* %65
%67 = fcmp olt double %63, %66
br i1 %67, label %81, label %68
68: ; preds = %58
%69 = load double*, double** %10
%70 = load i32, i32* %24
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = load double*, double** %9
%75 = load i32, i32* %7
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
%79 = load double, double* %78
%80 = fcmp ogt double %73, %79
br i1 %80, label %81, label %83
81: ; preds = %68, %58
%82 = call i32 @error_handler(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %83
83: ; preds = %81, %68
br label %84
84: ; preds = %83
%85 = load i32, i32* %24
%86 = add nsw i32 %85, 1
store i32 %86, i32* %24
br label %54
87: ; preds = %54
%88 = load i32, i32* %7
%89 = icmp slt i32 %88, 2
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 @error_handler(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
br label %92
92: ; preds = %90, %87
%93 = load i32, i32* %7
%94 = icmp eq i32 %93, 2
br i1 %94, label %95, label %138
95: ; preds = %92
%96 = load double*, double** %11
%97 = getelementptr inbounds double, double* %96, i64 1
%98 = load double, double* %97
%99 = load double*, double** %11
%100 = getelementptr inbounds double, double* %99, i64 0
%101 = load double, double* %100
%102 = fsub double %98, %101
%103 = load double*, double** %9
%104 = getelementptr inbounds double, double* %103, i64 1
%105 = load double, double* %104
%106 = load double*, double** %9
%107 = getelementptr inbounds double, double* %106, i64 0
%108 = load double, double* %107
%109 = fsub double %105, %108
%110 = fdiv double %102, %109
store double %110, double* %23
store i32 0, i32* %24
br label %111
111: ; preds = %134, %95
%112 = load i32, i32* %24
%113 = load i32, i32* %8
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %137
115: ; preds = %111
%116 = load double, double* %23
%117 = load double*, double** %10
%118 = load i32, i32* %24
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
%121 = load double, double* %120
%122 = load double*, double** %9
%123 = getelementptr inbounds double, double* %122, i64 0
%124 = load double, double* %123
%125 = fsub double %121, %124
%126 = load double*, double** %11
%127 = getelementptr inbounds double, double* %126, i64 0
%128 = load double, double* %127
%129 = call double @llvm.fmuladd.f64(double %116, double %125, double %128)
%130 = load double*, double** %12
%131 = load i32, i32* %24
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %130, i64 %132
store double %129, double* %133
br label %134
134: ; preds = %115
%135 = load i32, i32* %24
%136 = add nsw i32 %135, 1
store i32 %136, i32* %24
br label %111
137: ; preds = %111
br label %660
138: ; preds = %92
%139 = load i32, i32* %7
%140 = sub nsw i32 %139, 1
%141 = sext i32 %140 to i64
%142 = mul i64 %141, 8
%143 = trunc i64 %142 to i32
%144 = call i64 @malloc(i32 %143)
%145 = inttoptr i64 %144 to double*
store double* %145, double** %13
%146 = load i32, i32* %7
%147 = sub nsw i32 %146, 1
%148 = sext i32 %147 to i64
%149 = mul i64 %148, 8
%150 = trunc i64 %149 to i32
%151 = call i64 @malloc(i32 %150)
%152 = inttoptr i64 %151 to double*
store double* %152, double** %15
%153 = load i32, i32* %7
%154 = sext i32 %153 to i64
%155 = mul i64 %154, 8
%156 = trunc i64 %155 to i32
%157 = call i64 @malloc(i32 %156)
%158 = inttoptr i64 %157 to double*
store double* %158, double** %14
store i32 0, i32* %25
br label %159
159: ; preds = %203, %138
%160 = load i32, i32* %25
%161 = load i32, i32* %7
%162 = sub nsw i32 %161, 1
%163 = icmp slt i32 %160, %162
br i1 %163, label %164, label %206
164: ; preds = %159
%165 = load double*, double** %9
%166 = load i32, i32* %25
%167 = add nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %165, i64 %168
%170 = load double, double* %169
%171 = load double*, double** %9
%172 = load i32, i32* %25
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
%175 = load double, double* %174
%176 = fsub double %170, %175
%177 = load double*, double** %15
%178 = load i32, i32* %25
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
store double %176, double* %180
%181 = load double*, double** %11
%182 = load i32, i32* %25
%183 = add nsw i32 %182, 1
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %181, i64 %184
%186 = load double, double* %185
%187 = load double*, double** %11
%188 = load i32, i32* %25
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
%191 = load double, double* %190
%192 = fsub double %186, %191
%193 = load double*, double** %15
%194 = load i32, i32* %25
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %193, i64 %195
%197 = load double, double* %196
%198 = fdiv double %192, %197
%199 = load double*, double** %13
%200 = load i32, i32* %25
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
store double %198, double* %202
br label %203
203: ; preds = %164
%204 = load i32, i32* %25
%205 = add nsw i32 %204, 1
store i32 %205, i32* %25
br label %159
206: ; preds = %159
store i32 1, i32* %25
br label %207
207: ; preds = %281, %206
%208 = load i32, i32* %25
%209 = load i32, i32* %7
%210 = sub nsw i32 %209, 1
%211 = icmp slt i32 %208, %210
br i1 %211, label %212, label %284
212: ; preds = %207
%213 = load double*, double** %13
%214 = load i32, i32* %25
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %213, i64 %215
%217 = load double, double* %216
%218 = load double*, double** %13
%219 = load i32, i32* %25
%220 = sub nsw i32 %219, 1
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %218, i64 %221
%223 = load double, double* %222
%224 = fmul double %217, %223
%225 = fcmp ogt double %224, 0.000000e+00
br i1 %225, label %226, label %275
226: ; preds = %212
%227 = load double*, double** %15
%228 = load i32, i32* %25
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds double, double* %227, i64 %229
%231 = load double, double* %230
%232 = load double*, double** %15
%233 = load i32, i32* %25
%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 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %231, double %237)
store double %238, double* %21
%239 = load double*, double** %15
%240 = load i32, i32* %25
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds double, double* %239, i64 %241
%243 = load double, double* %242
%244 = load double*, double** %15
%245 = load i32, i32* %25
%246 = sub nsw i32 %245, 1
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double, double* %244, i64 %247
%249 = load double, double* %248
%250 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %249, double %243)
store double %250, double* %22
%251 = load double, double* %21
%252 = load double, double* %22
%253 = fadd double %251, %252
%254 = load double, double* %21
%255 = load double*, double** %13
%256 = load i32, i32* %25
%257 = sub nsw i32 %256, 1
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds double, double* %255, i64 %258
%260 = load double, double* %259
%261 = fdiv double %254, %260
%262 = load double, double* %22
%263 = load double*, double** %13
%264 = load i32, i32* %25
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %263, i64 %265
%267 = load double, double* %266
%268 = fdiv double %262, %267
%269 = fadd double %261, %268
%270 = fdiv double %253, %269
%271 = load double*, double** %14
%272 = load i32, i32* %25
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds double, double* %271, i64 %273
store double %270, double* %274
br label %280
275: ; preds = %212
%276 = load double*, double** %14
%277 = load i32, i32* %25
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds double, double* %276, i64 %278
store double 0.000000e+00, double* %279
br label %280
280: ; preds = %275, %226
br label %281
281: ; preds = %280
%282 = load i32, i32* %25
%283 = add nsw i32 %282, 1
store i32 %283, i32* %25
br label %207
284: ; preds = %207
%285 = load i32, i32* %7
%286 = sub nsw i32 %285, 1
store i32 %286, i32* %29
%287 = load double*, double** %15
%288 = getelementptr inbounds double, double* %287, i64 0
%289 = load double, double* %288
%290 = load double*, double** %15
%291 = getelementptr inbounds double, double* %290, i64 1
%292 = load double, double* %291
%293 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %289, double %292)
%294 = load double*, double** %13
%295 = getelementptr inbounds double, double* %294, i64 0
%296 = load double, double* %295
%297 = load double*, double** %15
%298 = getelementptr inbounds double, double* %297, i64 0
%299 = load double, double* %298
%300 = load double*, double** %13
%301 = getelementptr inbounds double, double* %300, i64 1
%302 = load double, double* %301
%303 = fmul double %299, %302
%304 = fneg double %303
%305 = call double @llvm.fmuladd.f64(double %293, double %296, double %304)
%306 = load double*, double** %15
%307 = getelementptr inbounds double, double* %306, i64 0
%308 = load double, double* %307
%309 = load double*, double** %15
%310 = getelementptr inbounds double, double* %309, i64 1
%311 = load double, double* %310
%312 = fadd double %308, %311
%313 = fdiv double %305, %312
%314 = load double*, double** %14
%315 = getelementptr inbounds double, double* %314, i64 0
store double %313, double* %315
%316 = load double*, double** %14
%317 = getelementptr inbounds double, double* %316, i64 0
%318 = load double, double* %317
%319 = load double*, double** %13
%320 = getelementptr inbounds double, double* %319, i64 0
%321 = load double, double* %320
%322 = fmul double %318, %321
%323 = fcmp olt double %322, 0.000000e+00
br i1 %323, label %324, label %327
324: ; preds = %284
%325 = load double*, double** %14
%326 = getelementptr inbounds double, double* %325, i64 0
store double 0.000000e+00, double* %326
br label %355
327: ; preds = %284
%328 = load double*, double** %13
%329 = getelementptr inbounds double, double* %328, i64 0
%330 = load double, double* %329
%331 = load double*, double** %13
%332 = getelementptr inbounds double, double* %331, i64 1
%333 = load double, double* %332
%334 = fmul double %330, %333
%335 = fcmp olt double %334, 0.000000e+00
br i1 %335, label %336, label %354
336: ; preds = %327
%337 = load double*, double** %14
%338 = getelementptr inbounds double, double* %337, i64 0
%339 = load double, double* %338
%340 = call i64 @abs(double %339)
%341 = load double*, double** %13
%342 = getelementptr inbounds double, double* %341, i64 0
%343 = load double, double* %342
%344 = fmul double 3.000000e+00, %343
%345 = call i64 @abs(double %344)
%346 = icmp sgt i64 %340, %345
br i1 %346, label %347, label %354
347: ; preds = %336
%348 = load double*, double** %13
%349 = getelementptr inbounds double, double* %348, i64 0
%350 = load double, double* %349
%351 = fmul double 3.000000e+00, %350
%352 = load double*, double** %14
%353 = getelementptr inbounds double, double* %352, i64 0
store double %351, double* %353
br label %354
354: ; preds = %347, %336, %327
br label %355
355: ; preds = %354, %324
%356 = load double*, double** %15
%357 = load i32, i32* %29
%358 = sub nsw i32 %357, 1
%359 = sext i32 %358 to i64
%360 = getelementptr inbounds double, double* %356, i64 %359
%361 = load double, double* %360
%362 = load double*, double** %15
%363 = load i32, i32* %29
%364 = sub nsw i32 %363, 2
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds double, double* %362, i64 %365
%367 = load double, double* %366
%368 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %361, double %367)
%369 = load double*, double** %13
%370 = load i32, i32* %29
%371 = sub nsw i32 %370, 1
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds double, double* %369, i64 %372
%374 = load double, double* %373
%375 = load double*, double** %15
%376 = load i32, i32* %29
%377 = sub nsw i32 %376, 1
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds double, double* %375, i64 %378
%380 = load double, double* %379
%381 = load double*, double** %13
%382 = load i32, i32* %29
%383 = sub nsw i32 %382, 2
%384 = sext i32 %383 to i64
%385 = getelementptr inbounds double, double* %381, i64 %384
%386 = load double, double* %385
%387 = fmul double %380, %386
%388 = fneg double %387
%389 = call double @llvm.fmuladd.f64(double %368, double %374, double %388)
%390 = load double*, double** %15
%391 = load i32, i32* %29
%392 = sub nsw i32 %391, 1
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds double, double* %390, i64 %393
%395 = load double, double* %394
%396 = load double*, double** %15
%397 = load i32, i32* %29
%398 = sub nsw i32 %397, 2
%399 = sext i32 %398 to i64
%400 = getelementptr inbounds double, double* %396, i64 %399
%401 = load double, double* %400
%402 = fadd double %395, %401
%403 = fdiv double %389, %402
%404 = load double*, double** %14
%405 = load i32, i32* %29
%406 = sext i32 %405 to i64
%407 = getelementptr inbounds double, double* %404, i64 %406
store double %403, double* %407
%408 = load double*, double** %14
%409 = load i32, i32* %29
%410 = sext i32 %409 to i64
%411 = getelementptr inbounds double, double* %408, i64 %410
%412 = load double, double* %411
%413 = load double*, double** %13
%414 = load i32, i32* %29
%415 = sub nsw i32 %414, 1
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %413, i64 %416
%418 = load double, double* %417
%419 = fmul double %412, %418
%420 = fcmp olt double %419, 0.000000e+00
br i1 %420, label %421, label %426
421: ; preds = %355
%422 = load double*, double** %14
%423 = load i32, i32* %29
%424 = sext i32 %423 to i64
%425 = getelementptr inbounds double, double* %422, i64 %424
store double 0.000000e+00, double* %425
br label %470
426: ; preds = %355
%427 = load double*, double** %13
%428 = load i32, i32* %29
%429 = sub nsw i32 %428, 1
%430 = sext i32 %429 to i64
%431 = getelementptr inbounds double, double* %427, i64 %430
%432 = load double, double* %431
%433 = load double*, double** %13
%434 = load i32, i32* %29
%435 = sub nsw i32 %434, 2
%436 = sext i32 %435 to i64
%437 = getelementptr inbounds double, double* %433, i64 %436
%438 = load double, double* %437
%439 = fmul double %432, %438
%440 = fcmp olt double %439, 0.000000e+00
br i1 %440, label %441, label %469
441: ; preds = %426
%442 = load double*, double** %14
%443 = load i32, i32* %29
%444 = sext i32 %443 to i64
%445 = getelementptr inbounds double, double* %442, i64 %444
%446 = load double, double* %445
%447 = call i64 @abs(double %446)
%448 = load double*, double** %13
%449 = load i32, i32* %29
%450 = sub nsw i32 %449, 1
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds double, double* %448, i64 %451
%453 = load double, double* %452
%454 = fmul double 3.000000e+00, %453
%455 = call i64 @abs(double %454)
%456 = icmp sgt i64 %447, %455
br i1 %456, label %457, label %469
457: ; preds = %441
%458 = load double*, double** %13
%459 = load i32, i32* %29
%460 = sub nsw i32 %459, 1
%461 = sext i32 %460 to i64
%462 = getelementptr inbounds double, double* %458, i64 %461
%463 = load double, double* %462
%464 = fmul double 3.000000e+00, %463
%465 = load double*, double** %14
%466 = load i32, i32* %29
%467 = sext i32 %466 to i64
%468 = getelementptr inbounds double, double* %465, i64 %467
store double %464, double* %468
br label %469
469: ; preds = %457, %441, %426
br label %470
470: ; preds = %469, %421
%471 = load i32, i32* %7
%472 = sub nsw i32 %471, 1
%473 = sext i32 %472 to i64
%474 = mul i64 %473, 8
%475 = trunc i64 %474 to i32
%476 = call i64 @malloc(i32 %475)
%477 = inttoptr i64 %476 to double*
store double* %477, double** %16
%478 = load i32, i32* %7
%479 = sub nsw i32 %478, 1
%480 = sext i32 %479 to i64
%481 = mul i64 %480, 8
%482 = trunc i64 %481 to i32
%483 = call i64 @malloc(i32 %482)
%484 = inttoptr i64 %483 to double*
store double* %484, double** %17
store i32 0, i32* %25
br label %485
485: ; preds = %563, %470
%486 = load i32, i32* %25
%487 = load i32, i32* %7
%488 = sub nsw i32 %487, 1
%489 = icmp slt i32 %486, %488
br i1 %489, label %490, label %566
490: ; preds = %485
%491 = load double*, double** %15
%492 = load i32, i32* %25
%493 = sext i32 %492 to i64
%494 = getelementptr inbounds double, double* %491, i64 %493
%495 = load double, double* %494
store double %495, double* %18
%496 = load double, double* %18
%497 = load double, double* %18
%498 = fmul double %496, %497
store double %498, double* %19
%499 = load double*, double** %13
%500 = load i32, i32* %25
%501 = sext i32 %500 to i64
%502 = getelementptr inbounds double, double* %499, i64 %501
%503 = load double, double* %502
%504 = load double*, double** %14
%505 = load i32, i32* %25
%506 = sext i32 %505 to i64
%507 = getelementptr inbounds double, double* %504, i64 %506
%508 = load double, double* %507
%509 = fmul double 2.000000e+00, %508
%510 = fneg double %509
%511 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %503, double %510)
%512 = load double*, double** %14
%513 = load i32, i32* %25
%514 = add nsw i32 %513, 1
%515 = sext i32 %514 to i64
%516 = getelementptr inbounds double, double* %512, i64 %515
%517 = load double, double* %516
%518 = fsub double %511, %517
%519 = load double*, double** %15
%520 = load i32, i32* %25
%521 = sext i32 %520 to i64
%522 = getelementptr inbounds double, double* %519, i64 %521
%523 = load double, double* %522
%524 = fdiv double %518, %523
%525 = load double*, double** %17
%526 = load i32, i32* %25
%527 = sext i32 %526 to i64
%528 = getelementptr inbounds double, double* %525, i64 %527
store double %524, double* %528
%529 = load double*, double** %14
%530 = load i32, i32* %25
%531 = sext i32 %530 to i64
%532 = getelementptr inbounds double, double* %529, i64 %531
%533 = load double, double* %532
%534 = load double*, double** %13
%535 = load i32, i32* %25
%536 = sext i32 %535 to i64
%537 = getelementptr inbounds double, double* %534, i64 %536
%538 = load double, double* %537
%539 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %538, double %533)
%540 = load double*, double** %14
%541 = load i32, i32* %25
%542 = add nsw i32 %541, 1
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds double, double* %540, i64 %543
%545 = load double, double* %544
%546 = fadd double %539, %545
%547 = load double*, double** %15
%548 = load i32, i32* %25
%549 = sext i32 %548 to i64
%550 = getelementptr inbounds double, double* %547, i64 %549
%551 = load double, double* %550
%552 = load double*, double** %15
%553 = load i32, i32* %25
%554 = sext i32 %553 to i64
%555 = getelementptr inbounds double, double* %552, i64 %554
%556 = load double, double* %555
%557 = fmul double %551, %556
%558 = fdiv double %546, %557
%559 = load double*, double** %16
%560 = load i32, i32* %25
%561 = sext i32 %560 to i64
%562 = getelementptr inbounds double, double* %559, i64 %561
store double %558, double* %562
br label %563
563: ; preds = %490
%564 = load i32, i32* %25
%565 = add nsw i32 %564, 1
store i32 %565, i32* %25
br label %485
566: ; preds = %485
store i32 0, i32* %25
br label %567
567: ; preds = %646, %566
%568 = load i32, i32* %25
%569 = load i32, i32* %8
%570 = icmp slt i32 %568, %569
br i1 %570, label %571, label %649
571: ; preds = %567
%572 = load double*, double** %10
%573 = load i32, i32* %25
%574 = sext i32 %573 to i64
%575 = getelementptr inbounds double, double* %572, i64 %574
%576 = load double, double* %575
%577 = load double*, double** %9
%578 = load i32, i32* %7
%579 = call i32 @nearest_index(double %576, double* %577, i32 %578)
store i32 %579, i32* %26
%580 = load double*, double** %9
%581 = load i32, i32* %26
%582 = sext i32 %581 to i64
%583 = getelementptr inbounds double, double* %580, i64 %582
%584 = load double, double* %583
%585 = load double*, double** %10
%586 = load i32, i32* %25
%587 = sext i32 %586 to i64
%588 = getelementptr inbounds double, double* %585, i64 %587
%589 = load double, double* %588
%590 = fcmp olt double %584, %589
br i1 %590, label %591, label %593
591: ; preds = %571
%592 = load i32, i32* %26
store i32 %592, i32* %27
br label %602
593: ; preds = %571
%594 = load i32, i32* %26
%595 = icmp eq i32 %594, 0
br i1 %595, label %596, label %598
596: ; preds = %593
%597 = load i32, i32* %26
store i32 %597, i32* %27
br label %601
598: ; preds = %593
%599 = load i32, i32* %26
%600 = sub nsw i32 %599, 1
store i32 %600, i32* %27
br label %601
601: ; preds = %598, %596
br label %602
602: ; preds = %601, %591
%603 = load i32, i32* %27
%604 = add nsw i32 %603, 1
store i32 %604, i32* %28
%605 = load double*, double** %10
%606 = load i32, i32* %25
%607 = sext i32 %606 to i64
%608 = getelementptr inbounds double, double* %605, i64 %607
%609 = load double, double* %608
%610 = load double*, double** %9
%611 = load i32, i32* %27
%612 = sext i32 %611 to i64
%613 = getelementptr inbounds double, double* %610, i64 %612
%614 = load double, double* %613
%615 = fsub double %609, %614
store double %615, double* %20
%616 = load double*, double** %11
%617 = load i32, i32* %27
%618 = sext i32 %617 to i64
%619 = getelementptr inbounds double, double* %616, i64 %618
%620 = load double, double* %619
%621 = load double, double* %20
%622 = load double*, double** %14
%623 = load i32, i32* %27
%624 = sext i32 %623 to i64
%625 = getelementptr inbounds double, double* %622, i64 %624
%626 = load double, double* %625
%627 = load double, double* %20
%628 = load double*, double** %17
%629 = load i32, i32* %27
%630 = sext i32 %629 to i64
%631 = getelementptr inbounds double, double* %628, i64 %630
%632 = load double, double* %631
%633 = load double, double* %20
%634 = load double*, double** %16
%635 = load i32, i32* %27
%636 = sext i32 %635 to i64
%637 = getelementptr inbounds double, double* %634, i64 %636
%638 = load double, double* %637
%639 = call double @llvm.fmuladd.f64(double %633, double %638, double %632)
%640 = call double @llvm.fmuladd.f64(double %627, double %639, double %626)
%641 = call double @llvm.fmuladd.f64(double %621, double %640, double %620)
%642 = load double*, double** %12
%643 = load i32, i32* %25
%644 = sext i32 %643 to i64
%645 = getelementptr inbounds double, double* %642, i64 %644
store double %641, double* %645
br label %646
646: ; preds = %602
%647 = load i32, i32* %25
%648 = add nsw i32 %647, 1
store i32 %648, i32* %25
br label %567
649: ; preds = %567
%650 = load double*, double** %17
%651 = call i32 @free(double* %650)
%652 = load double*, double** %16
%653 = call i32 @free(double* %652)
%654 = load double*, double** %14
%655 = call i32 @free(double* %654)
%656 = load double*, double** %15
%657 = call i32 @free(double* %656)
%658 = load double*, double** %13
%659 = call i32 @free(double* %658)
br label %660
660: ; preds = %649, %137
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"cubic_spline_sp: grid1 is not monotonic increasing\00"
@.str.1 = [42 x i8] c"cubic_spline_sp: grid2 lies outside grid1\00"
@.str.2 = [61 x i8] c"cubic_spline_sp: the size of input grid should be at least 2\00"
define void @cubic_spline_sp(i32 %0, i32 %1, double* %2, double* nocapture %3, double* nocapture %4, double* nocapture writeonly %5) {
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = zext i32 %0 to i64
br label %17
10: ; preds = %27, %6
%11 = icmp sgt i32 %1, 0
br i1 %11, label %12, label %44
12: ; preds = %10
%13 = add nsw i32 %0, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %2, i64 %14
%16 = zext i32 %1 to i64
br label %30
17: ; preds = %8, %27
%18 = phi i64 [ 1, %8 ], [ %28, %27 ]
%19 = getelementptr inbounds double, double* %2, i64 %18
%20 = load double, double* %19
%21 = add nsw i64 %18, -1
%22 = getelementptr inbounds double, double* %2, i64 %21
%23 = load double, double* %22
%24 = fcmp ugt double %20, %23
br i1 %24, label %27, label %25
25: ; preds = %17
%26 = tail call i32 @error_handler(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %17, %25
%28 = add nuw nsw i64 %18, 1
%29 = icmp eq i64 %28, %9
br i1 %29, label %10, label %17
30: ; preds = %12, %41
%31 = phi i64 [ 0, %12 ], [ %42, %41 ]
%32 = getelementptr inbounds double, double* %3, i64 %31
%33 = load double, double* %32
%34 = load double, double* %2
%35 = fcmp olt double %33, %34
br i1 %35, label %39, label %36
36: ; preds = %30
%37 = load double, double* %15
%38 = fcmp ogt double %33, %37
br i1 %38, label %39, label %41
39: ; preds = %36, %30
%40 = tail call i32 @error_handler(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %41
41: ; preds = %36, %39
%42 = add nuw nsw i64 %31, 1
%43 = icmp eq i64 %42, %16
br i1 %43, label %44, label %30
44: ; preds = %41, %10
%45 = icmp slt i32 %0, 2
br i1 %45, label %46, label %48
46: ; preds = %44
%47 = tail call i32 @error_handler(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
br label %160
48: ; preds = %44
%49 = icmp eq i32 %0, 2
br i1 %49, label %50, label %160
50: ; preds = %48
%51 = getelementptr inbounds double, double* %4, i64 1
%52 = load double, double* %51
%53 = load double, double* %4
%54 = fsub double %52, %53
%55 = getelementptr inbounds double, double* %2, i64 1
%56 = load double, double* %55
%57 = load double, double* %2
%58 = fsub double %56, %57
%59 = fdiv double %54, %58
br i1 %11, label %60, label %514
60: ; preds = %50
%61 = zext i32 %1 to i64
%62 = load double, double* %3
%63 = fsub double %62, %57
%64 = tail call double @llvm.fmuladd.f64(double %59, double %63, double %53)
store double %64, double* %5
%65 = icmp eq i32 %1, 1
br i1 %65, label %514, label %66
66: ; preds = %60
%67 = add nsw i64 %61, -1
%68 = icmp ult i64 %67, 4
br i1 %68, label %123, label %69
69: ; preds = %66
%70 = getelementptr double, double* %5, i64 1
%71 = getelementptr double, double* %5, i64 %61
%72 = getelementptr double, double* %3, i64 1
%73 = getelementptr double, double* %3, i64 %61
%74 = icmp ult double* %5, %2
%75 = icmp ugt double* %71, %2
%76 = and i1 %74, %75
%77 = icmp ult double* %5, %4
%78 = icmp ugt double* %71, %4
%79 = and i1 %77, %78
%80 = or i1 %76, %79
%81 = icmp ult double* %70, %73
%82 = icmp ult double* %72, %71
%83 = and i1 %81, %82
%84 = or i1 %80, %83
br i1 %84, label %123, label %85
85: ; preds = %69
%86 = and i64 %67, -4
%87 = or i64 %86, 1
%88 = insertelement <2 x double> poison, double %59, i64 0
%89 = shufflevector <2 x double> %88, <2 x double> poison, <2 x i32> zeroinitializer
%90 = insertelement <2 x double> poison, double %59, i64 0
%91 = shufflevector <2 x double> %90, <2 x double> poison, <2 x i32> zeroinitializer
%92 = load double, double* %2
%93 = insertelement <2 x double> poison, double %92, i64 0
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
%95 = insertelement <2 x double> poison, double %92, i64 0
%96 = shufflevector <2 x double> %95, <2 x double> poison, <2 x i32> zeroinitializer
%97 = load double, double* %4
%98 = insertelement <2 x double> poison, double %97, i64 0
%99 = shufflevector <2 x double> %98, <2 x double> poison, <2 x i32> zeroinitializer
%100 = insertelement <2 x double> poison, double %97, i64 0
%101 = shufflevector <2 x double> %100, <2 x double> poison, <2 x i32> zeroinitializer
br label %102
102: ; preds = %102, %85
%103 = phi i64 [ 0, %85 ], [ %119, %102 ]
%104 = or i64 %103, 1
%105 = getelementptr inbounds double, double* %3, i64 %104
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = getelementptr inbounds double, double* %105, i64 2
%109 = bitcast double* %108 to <2 x double>*
%110 = load <2 x double>, <2 x double>* %109
%111 = fsub <2 x double> %107, %94
%112 = fsub <2 x double> %110, %96
%113 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %89, <2 x double> %111, <2 x double> %99)
%114 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %91, <2 x double> %112, <2 x double> %101)
%115 = getelementptr inbounds double, double* %5, i64 %104
%116 = bitcast double* %115 to <2 x double>*
store <2 x double> %113, <2 x double>* %116
%117 = getelementptr inbounds double, double* %115, i64 2
%118 = bitcast double* %117 to <2 x double>*
store <2 x double> %114, <2 x double>* %118
%119 = add nuw i64 %103, 4
%120 = icmp eq i64 %119, %86
br i1 %120, label %121, label %102
121: ; preds = %102
%122 = icmp eq i64 %67, %86
br i1 %122, label %514, label %123
123: ; preds = %69, %66, %121
%124 = phi i64 [ 1, %69 ], [ 1, %66 ], [ %87, %121 ]
%125 = xor i64 %124, -1
%126 = and i64 %61, 1
%127 = icmp eq i64 %126, 0
br i1 %127, label %128, label %137
128: ; preds = %123
%129 = load double, double* %2
%130 = load double, double* %4
%131 = getelementptr inbounds double, double* %3, i64 %124
%132 = load double, double* %131
%133 = fsub double %132, %129
%134 = tail call double @llvm.fmuladd.f64(double %59, double %133, double %130)
%135 = getelementptr inbounds double, double* %5, i64 %124
store double %134, double* %135
%136 = add nuw nsw i64 %124, 1
br label %137
137: ; preds = %128, %123
%138 = phi i64 [ %124, %123 ], [ %136, %128 ]
%139 = sub nsw i64 0, %61
%140 = icmp eq i64 %125, %139
br i1 %140, label %514, label %141
141: ; preds = %137, %141
%142 = phi i64 [ %158, %141 ], [ %138, %137 ]
%143 = load double, double* %2
%144 = load double, double* %4
%145 = getelementptr inbounds double, double* %3, i64 %142
%146 = load double, double* %145
%147 = fsub double %146, %143
%148 = tail call double @llvm.fmuladd.f64(double %59, double %147, double %144)
%149 = getelementptr inbounds double, double* %5, i64 %142
store double %148, double* %149
%150 = add nuw nsw i64 %142, 1
%151 = load double, double* %2
%152 = load double, double* %4
%153 = getelementptr inbounds double, double* %3, i64 %150
%154 = load double, double* %153
%155 = fsub double %154, %151
%156 = tail call double @llvm.fmuladd.f64(double %59, double %155, double %152)
%157 = getelementptr inbounds double, double* %5, i64 %150
store double %156, double* %157
%158 = add nuw nsw i64 %142, 2
%159 = icmp eq i64 %158, %61
br i1 %159, label %514, label %141
160: ; preds = %46, %48
%161 = add nsw i32 %0, -1
%162 = sext i32 %161 to i64
%163 = shl i32 %161, 3
%164 = tail call i64 @malloc(i32 %163)
%165 = inttoptr i64 %164 to double*
%166 = inttoptr i64 %164 to i8*
%167 = tail call i64 @malloc(i32 %163)
%168 = inttoptr i64 %167 to double*
%169 = inttoptr i64 %167 to i8*
%170 = shl i32 %0, 3
%171 = tail call i64 @malloc(i32 %170)
%172 = inttoptr i64 %171 to double*
%173 = inttoptr i64 %171 to i8*
br i1 %7, label %174, label %286
174: ; preds = %160
%175 = zext i32 %161 to i64
%176 = icmp ult i32 %161, 2
br i1 %176, label %234, label %177
177: ; preds = %174
%178 = getelementptr double, double* %168, i64 %175
%179 = bitcast double* %178 to i8*
%180 = getelementptr double, double* %165, i64 %175
%181 = bitcast double* %180 to i8*
%182 = add nuw nsw i64 %175, 1
%183 = getelementptr double, double* %2, i64 %182
%184 = bitcast double* %183 to i8*
%185 = getelementptr double, double* %4, i64 %182
%186 = bitcast double* %185 to i8*
%187 = icmp ult i8* %169, %181
%188 = icmp ult i8* %166, %179
%189 = and i1 %187, %188
%190 = icmp ult i8* %169, %184
%191 = icmp ugt double* %178, %2
%192 = and i1 %190, %191
%193 = or i1 %189, %192
%194 = icmp ult i8* %169, %186
%195 = icmp ugt double* %178, %4
%196 = and i1 %194, %195
%197 = or i1 %193, %196
%198 = icmp ult i8* %166, %184
%199 = icmp ugt double* %180, %2
%200 = and i1 %198, %199
%201 = or i1 %197, %200
%202 = icmp ult i8* %166, %186
%203 = icmp ugt double* %180, %4
%204 = and i1 %202, %203
%205 = or i1 %201, %204
br i1 %205, label %234, label %206
206: ; preds = %177
%207 = and i64 %175, 4294967294
br label %208
208: ; preds = %208, %206
%209 = phi i64 [ 0, %206 ], [ %230, %208 ]
%210 = or i64 %209, 1
%211 = getelementptr inbounds double, double* %2, i64 %210
%212 = bitcast double* %211 to <2 x double>*
%213 = load <2 x double>, <2 x double>* %212
%214 = getelementptr inbounds double, double* %2, i64 %209
%215 = bitcast double* %214 to <2 x double>*
%216 = load <2 x double>, <2 x double>* %215
%217 = fsub <2 x double> %213, %216
%218 = getelementptr inbounds double, double* %168, i64 %209
%219 = bitcast double* %218 to <2 x double>*
store <2 x double> %217, <2 x double>* %219
%220 = getelementptr inbounds double, double* %4, i64 %210
%221 = bitcast double* %220 to <2 x double>*
%222 = load <2 x double>, <2 x double>* %221
%223 = getelementptr inbounds double, double* %4, i64 %209
%224 = bitcast double* %223 to <2 x double>*
%225 = load <2 x double>, <2 x double>* %224
%226 = fsub <2 x double> %222, %225
%227 = fdiv <2 x double> %226, %217
%228 = getelementptr inbounds double, double* %165, i64 %209
%229 = bitcast double* %228 to <2 x double>*
store <2 x double> %227, <2 x double>* %229
%230 = add nuw i64 %209, 2
%231 = icmp eq i64 %230, %207
br i1 %231, label %232, label %208
232: ; preds = %208
%233 = icmp eq i64 %207, %175
br i1 %233, label %236, label %234
234: ; preds = %177, %174, %232
%235 = phi i64 [ 0, %177 ], [ 0, %174 ], [ %207, %232 ]
br label %240
236: ; preds = %240, %232
%237 = icmp sgt i32 %0, 2
br i1 %237, label %238, label %286
238: ; preds = %236
%239 = zext i32 %161 to i64
br label %257
240: ; preds = %234, %240
%241 = phi i64 [ %242, %240 ], [ %235, %234 ]
%242 = add nuw nsw i64 %241, 1
%243 = getelementptr inbounds double, double* %2, i64 %242
%244 = load double, double* %243
%245 = getelementptr inbounds double, double* %2, i64 %241
%246 = load double, double* %245
%247 = fsub double %244, %246
%248 = getelementptr inbounds double, double* %168, i64 %241
store double %247, double* %248
%249 = getelementptr inbounds double, double* %4, i64 %242
%250 = load double, double* %249
%251 = getelementptr inbounds double, double* %4, i64 %241
%252 = load double, double* %251
%253 = fsub double %250, %252
%254 = fdiv double %253, %247
%255 = getelementptr inbounds double, double* %165, i64 %241
store double %254, double* %255
%256 = icmp eq i64 %242, %175
br i1 %256, label %236, label %240
257: ; preds = %238, %281
%258 = phi i64 [ 1, %238 ], [ %284, %281 ]
%259 = add nsw i64 %258, -1
%260 = getelementptr inbounds double, double* %165, i64 %259
%261 = bitcast double* %260 to <2 x double>*
%262 = load <2 x double>, <2 x double>* %261
%263 = shufflevector <2 x double> %262, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%264 = fmul <2 x double> %263, %262
%265 = extractelement <2 x double> %264, i64 0
%266 = fcmp ogt double %265, 0.000000e+00
br i1 %266, label %267, label %281
267: ; preds = %257
%268 = getelementptr inbounds double, double* %168, i64 %259
%269 = bitcast double* %268 to <2 x double>*
%270 = load <2 x double>, <2 x double>* %269
%271 = shufflevector <2 x double> %270, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%272 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %271, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %270)
%273 = shufflevector <2 x double> %272, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%274 = fadd <2 x double> %272, %273
%275 = extractelement <2 x double> %274, i64 0
%276 = fdiv <2 x double> %272, %262
%277 = shufflevector <2 x double> %276, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%278 = fadd <2 x double> %276, %277
%279 = extractelement <2 x double> %278, i64 0
%280 = fdiv double %275, %279
br label %281
281: ; preds = %257, %267
%282 = phi double [ %280, %267 ], [ 0.000000e+00, %257 ]
%283 = getelementptr inbounds double, double* %172, i64 %258
store double %282, double* %283
%284 = add nuw nsw i64 %258, 1
%285 = icmp eq i64 %284, %239
br i1 %285, label %286, label %257
286: ; preds = %281, %160, %236
%287 = load double, double* %168
%288 = getelementptr inbounds double, double* %168, i64 1
%289 = load double, double* %288
%290 = tail call double @llvm.fmuladd.f64(double %287, double 2.000000e+00, double %289)
%291 = load double, double* %165
%292 = getelementptr inbounds double, double* %165, i64 1
%293 = load double, double* %292
%294 = fneg double %287
%295 = fmul double %293, %294
%296 = tail call double @llvm.fmuladd.f64(double %290, double %291, double %295)
%297 = fadd double %287, %289
%298 = fdiv double %296, %297
store double %298, double* %172
%299 = load double, double* %165
%300 = fmul double %299, %298
%301 = fcmp olt double %300, 0.000000e+00
br i1 %301, label %315, label %302
302: ; preds = %286
%303 = load double, double* %292
%304 = fmul double %299, %303
%305 = fcmp olt double %304, 0.000000e+00
br i1 %305, label %306, label %317
306: ; preds = %302
%307 = tail call i64 @abs(double %298)
%308 = load double, double* %165
%309 = fmul double %308, 3.000000e+00
%310 = tail call i64 @abs(double %309)
%311 = icmp sgt i64 %307, %310
br i1 %311, label %312, label %317
312: ; preds = %306
%313 = load double, double* %165
%314 = fmul double %313, 3.000000e+00
br label %315
315: ; preds = %286, %312
%316 = phi double [ %314, %312 ], [ 0.000000e+00, %286 ]
store double %316, double* %172
br label %317
317: ; preds = %315, %302, %306
%318 = add nsw i32 %0, -2
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds double, double* %168, i64 %319
%321 = load double, double* %320
%322 = add nsw i32 %0, -3
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds double, double* %168, i64 %323
%325 = load double, double* %324
%326 = tail call double @llvm.fmuladd.f64(double %321, double 2.000000e+00, double %325)
%327 = getelementptr inbounds double, double* %165, i64 %319
%328 = load double, double* %327
%329 = getelementptr inbounds double, double* %165, i64 %323
%330 = load double, double* %329
%331 = fneg double %321
%332 = fmul double %330, %331
%333 = tail call double @llvm.fmuladd.f64(double %326, double %328, double %332)
%334 = fadd double %321, %325
%335 = fdiv double %333, %334
%336 = getelementptr inbounds double, double* %172, i64 %162
store double %335, double* %336
%337 = load double, double* %327
%338 = fmul double %337, %335
%339 = fcmp olt double %338, 0.000000e+00
br i1 %339, label %353, label %340
340: ; preds = %317
%341 = load double, double* %329
%342 = fmul double %337, %341
%343 = fcmp olt double %342, 0.000000e+00
br i1 %343, label %344, label %355
344: ; preds = %340
%345 = tail call i64 @abs(double %335)
%346 = load double, double* %327
%347 = fmul double %346, 3.000000e+00
%348 = tail call i64 @abs(double %347)
%349 = icmp sgt i64 %345, %348
br i1 %349, label %350, label %355
350: ; preds = %344
%351 = load double, double* %327
%352 = fmul double %351, 3.000000e+00
br label %353
353: ; preds = %317, %350
%354 = phi double [ %352, %350 ], [ 0.000000e+00, %317 ]
store double %354, double* %336
br label %355
355: ; preds = %353, %340, %344
%356 = tail call i64 @malloc(i32 %163)
%357 = inttoptr i64 %356 to double*
%358 = inttoptr i64 %356 to i8*
%359 = tail call i64 @malloc(i32 %163)
%360 = inttoptr i64 %359 to double*
%361 = inttoptr i64 %359 to i8*
br i1 %7, label %362, label %447
362: ; preds = %355
%363 = zext i32 %161 to i64
%364 = icmp ult i32 %161, 2
br i1 %364, label %445, label %365
365: ; preds = %362
%366 = getelementptr double, double* %360, i64 %363
%367 = bitcast double* %366 to i8*
%368 = getelementptr double, double* %357, i64 %363
%369 = bitcast double* %368 to i8*
%370 = getelementptr double, double* %168, i64 %363
%371 = bitcast double* %370 to i8*
%372 = getelementptr double, double* %165, i64 %363
%373 = bitcast double* %372 to i8*
%374 = add nuw nsw i64 %363, 1
%375 = getelementptr double, double* %172, i64 %374
%376 = bitcast double* %375 to i8*
%377 = icmp ult i8* %361, %369
%378 = icmp ult i8* %358, %367
%379 = and i1 %377, %378
%380 = icmp ult i8* %361, %371
%381 = icmp ult i8* %169, %367
%382 = and i1 %380, %381
%383 = or i1 %379, %382
%384 = icmp ult i8* %361, %373
%385 = icmp ult i8* %166, %367
%386 = and i1 %384, %385
%387 = or i1 %383, %386
%388 = icmp ult i8* %361, %376
%389 = icmp ult i8* %173, %367
%390 = and i1 %388, %389
%391 = or i1 %387, %390
%392 = icmp ult i8* %358, %371
%393 = icmp ult i8* %169, %369
%394 = and i1 %392, %393
%395 = or i1 %391, %394
%396 = icmp ult i8* %358, %373
%397 = icmp ult i8* %166, %369
%398 = and i1 %396, %397
%399 = or i1 %395, %398
%400 = icmp ult i8* %358, %376
%401 = icmp ult i8* %173, %369
%402 = and i1 %400, %401
%403 = or i1 %399, %402
br i1 %403, label %445, label %404
404: ; preds = %365
%405 = and i64 %363, 4294967294
br label %406
406: ; preds = %406, %404
%407 = phi i64 [ 0, %404 ], [ %441, %406 ]
%408 = getelementptr inbounds double, double* %168, i64 %407
%409 = bitcast double* %408 to <2 x double>*
%410 = load <2 x double>, <2 x double>* %409
%411 = getelementptr inbounds double, double* %165, i64 %407
%412 = bitcast double* %411 to <2 x double>*
%413 = load <2 x double>, <2 x double>* %412
%414 = getelementptr inbounds double, double* %172, i64 %407
%415 = bitcast double* %414 to <2 x double>*
%416 = load <2 x double>, <2 x double>* %415
%417 = fmul <2 x double> %416, <double -2.000000e+00, double -2.000000e+00>
%418 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %413, <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double> %417)
%419 = or i64 %407, 1
%420 = getelementptr inbounds double, double* %172, i64 %419
%421 = bitcast double* %420 to <2 x double>*
%422 = load <2 x double>, <2 x double>* %421
%423 = fsub <2 x double> %418, %422
%424 = fdiv <2 x double> %423, %410
%425 = getelementptr inbounds double, double* %360, i64 %407
%426 = bitcast double* %425 to <2 x double>*
store <2 x double> %424, <2 x double>* %426
%427 = bitcast double* %414 to <2 x double>*
%428 = load <2 x double>, <2 x double>* %427
%429 = bitcast double* %411 to <2 x double>*
%430 = load <2 x double>, <2 x double>* %429
%431 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %430, <2 x double> <double -2.000000e+00, double -2.000000e+00>, <2 x double> %428)
%432 = bitcast double* %420 to <2 x double>*
%433 = load <2 x double>, <2 x double>* %432
%434 = fadd <2 x double> %431, %433
%435 = bitcast double* %408 to <2 x double>*
%436 = load <2 x double>, <2 x double>* %435
%437 = fmul <2 x double> %436, %436
%438 = fdiv <2 x double> %434, %437
%439 = getelementptr inbounds double, double* %357, i64 %407
%440 = bitcast double* %439 to <2 x double>*
store <2 x double> %438, <2 x double>* %440
%441 = add nuw i64 %407, 2
%442 = icmp eq i64 %441, %405
br i1 %442, label %443, label %406
443: ; preds = %406
%444 = icmp eq i64 %405, %363
br i1 %444, label %447, label %445
445: ; preds = %365, %362, %443
%446 = phi i64 [ 0, %365 ], [ 0, %362 ], [ %405, %443 ]
br label %450
447: ; preds = %450, %443, %355
br i1 %11, label %448, label %508
448: ; preds = %447
%449 = zext i32 %1 to i64
br label %476
450: ; preds = %445, %450
%451 = phi i64 [ %460, %450 ], [ %446, %445 ]
%452 = getelementptr inbounds double, double* %168, i64 %451
%453 = load double, double* %452
%454 = getelementptr inbounds double, double* %165, i64 %451
%455 = load double, double* %454
%456 = getelementptr inbounds double, double* %172, i64 %451
%457 = load double, double* %456
%458 = fmul double %457, -2.000000e+00
%459 = tail call double @llvm.fmuladd.f64(double %455, double 3.000000e+00, double %458)
%460 = add nuw nsw i64 %451, 1
%461 = getelementptr inbounds double, double* %172, i64 %460
%462 = load double, double* %461
%463 = fsub double %459, %462
%464 = fdiv double %463, %453
%465 = getelementptr inbounds double, double* %360, i64 %451
store double %464, double* %465
%466 = load double, double* %456
%467 = load double, double* %454
%468 = tail call double @llvm.fmuladd.f64(double %467, double -2.000000e+00, double %466)
%469 = load double, double* %461
%470 = fadd double %468, %469
%471 = load double, double* %452
%472 = fmul double %471, %471
%473 = fdiv double %470, %472
%474 = getelementptr inbounds double, double* %357, i64 %451
store double %473, double* %474
%475 = icmp eq i64 %460, %363
br i1 %475, label %447, label %450
476: ; preds = %448, %476
%477 = phi i64 [ 0, %448 ], [ %506, %476 ]
%478 = getelementptr inbounds double, double* %3, i64 %477
%479 = load double, double* %478
%480 = tail call i32 @nearest_index(double %479, double* %2, i32 %0)
%481 = sext i32 %480 to i64
%482 = getelementptr inbounds double, double* %2, i64 %481
%483 = load double, double* %482
%484 = load double, double* %478
%485 = fcmp olt double %483, %484
%486 = icmp eq i32 %480, 0
%487 = add nsw i32 %480, -1
%488 = select i1 %486, i32 0, i32 %487
%489 = select i1 %485, i32 %480, i32 %488
%490 = sext i32 %489 to i64
%491 = getelementptr inbounds double, double* %2, i64 %490
%492 = load double, double* %491
%493 = fsub double %484, %492
%494 = getelementptr inbounds double, double* %4, i64 %490
%495 = load double, double* %494
%496 = getelementptr inbounds double, double* %172, i64 %490
%497 = load double, double* %496
%498 = getelementptr inbounds double, double* %360, i64 %490
%499 = load double, double* %498
%500 = getelementptr inbounds double, double* %357, i64 %490
%501 = load double, double* %500
%502 = tail call double @llvm.fmuladd.f64(double %493, double %501, double %499)
%503 = tail call double @llvm.fmuladd.f64(double %493, double %502, double %497)
%504 = tail call double @llvm.fmuladd.f64(double %493, double %503, double %495)
%505 = getelementptr inbounds double, double* %5, i64 %477
store double %504, double* %505
%506 = add nuw nsw i64 %477, 1
%507 = icmp eq i64 %506, %449
br i1 %507, label %508, label %476
508: ; preds = %476, %447
%509 = tail call i32 @free(double* %360)
%510 = tail call i32 @free(double* %357)
%511 = tail call i32 @free(double* %172)
%512 = tail call i32 @free(double* %168)
%513 = tail call i32 @free(double* %165)
br label %514
514: ; preds = %137, %141, %60, %121, %50, %508
ret void
}