#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(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void spline(int n, double *input_x, double *a) {
  int i;
  double *h = (double *)malloc(n * sizeof(double));
  double *alpha = (double *)malloc(n * sizeof(double));
  double *mu = (double *)malloc(n * sizeof(double));
  double *zeta = (double *)malloc(n * sizeof(double));
  double *l = (double *)malloc(n * sizeof(double));
  double *b = (double *)malloc(n * sizeof(double));
  double *c = (double *)malloc(n * sizeof(double));
  double *d = (double *)malloc(n * sizeof(double));
  for (i = 0; i < n - 1; i++) {
    h[i] = input_x[i + 1] - input_x[i];
  }
  for (i = 1; i < n - 1; i++) {
    alpha[i] =
        3.0 / h[i] * (a[i + 1] - a[i]) - 3.0 / h[i - 1] * (a[i] - a[i - 1]);
  }
  l[0] = 1.0;
  mu[0] = 0.0;
  zeta[0] = 0.0;
  for (i = 1; i < n - 1; i++) {
    l[i] = 2.0 * (input_x[i + 1] - input_x[i - 1]) - h[i - 1] * mu[i - 1];
    mu[i] = h[i] / l[i];
    zeta[i] = (alpha[i] - h[i - 1] * zeta[i - 1]) / l[i];
  }
  l[n - 1] = 1;
  zeta[n - 1] = 0;
  c[n - 1] = 0;
  for (i = n - 2; i >= 0; i--) {
    c[i] = zeta[i] - mu[i] * c[i + 1];
    b[i] = (a[i + 1] - a[i]) / h[i] - h[i] * (c[i + 1] + 2.0 * c[i]) / 3.0;
    d[i] = (c[i + 1] - c[i]) / (3.0 * h[i]);
  }
  printf("i\tx\ta\tb\tc\td\n");
  for (i = 0; i < n - 1; i++) {
    printf("%d\t%.4lf\t%.4lf\t%.4lf\t%.4lf\t%.4lf\n", i, input_x[i], a[i], b[i],
           c[i], d[i]);
  }
  printf("%d\t%.4lf\t%.4lf\n", i, input_x[i], a[i]);
  free(h);
  free(alpha);
  free(mu);
  free(l);
  free(zeta);
  free(b);
  free(c);
  free(d);
}


x86 assembly (clang, -O0):
<spline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    122d <spline+0xfd>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e2 <spline+0xb2>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12f0 <spline+0x1c0>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xdb3(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xd7a(%rip),%xmm1
divsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1234 <spline+0x104>
mov    -0x48(%rbp),%rax
movsd  0xd04(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1441 <spline+0x311>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x1c(%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
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    131d <spline+0x1ed>
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xbaa(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     15c4 <spline+0x494>
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $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
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x58(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xaac(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xa68(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    148e <spline+0x35e>
lea    0xa45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    164a <spline+0x51a>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x60(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
lea    0x9e8(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15d9 <spline+0x4a9>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0x9d1(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,0x10(%rsp)
lea    0x0(,%rdi,8),%r13d
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r13d,%edi
call   1060 <malloc@plt>
mov    0x30(%rsp),%rcx
mov    0x10(%rsp),%r9
mov    %rax,%r10
lea    -0x1(%r9),%r11d
cmp    $0x1,%r9d
mov    %rbp,0x40(%rsp)
jle    125b <spline+0x11b>
mov    0x20(%rsp),%r13
mov    %rbx,0x8(%rsp)
mov    %r11d,%ebp
cmp    $0x4,%r11d
jb     120f <spline+0xcf>
lea    (%r15,%rbp,8),%rax
add    $0x8,%rax
cmp    %rax,%r14
jae    1313 <spline+0x1d3>
lea    (%r14,%rbp,8),%rax
cmp    %r15,%rax
jbe    1313 <spline+0x1d3>
xor    %eax,%eax
mov    0x8(%rsp),%r8
mov    0x28(%rsp),%rdi
mov    %rax,%rdx
not    %rdx
add    %rbp,%rdx
mov    %rbp,%rsi
and    $0x3,%rsi
je     129e <spline+0x15e>
nopl   (%rax)
lea    0x1(%rax),%rcx
movsd  0x8(%r15,%rax,8),%xmm0
subsd  (%r15,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
mov    %rcx,%rax
add    $0xffffffffffffffff,%rsi
jne    1230 <spline+0xf0>
cmp    $0x3,%rdx
jae    12b0 <spline+0x170>
jmp    1405 <spline+0x2c5>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x0(%rbp)
movq   $0x0,(%rcx)
mov    0x20(%rsp),%r13
movq   $0x0,0x0(%r13)
movslq %r11d,%rcx
mov    %rax,0x0(%rbp,%rcx,8)
movq   $0x0,0x0(%r13,%rcx,8)
movq   $0x0,(%rbx,%rcx,8)
mov    %rbx,%r8
jmp    17e8 <spline+0x6a8>
mov    %rax,%rcx
cmp    $0x3,%rdx
jb     1405 <spline+0x2c5>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%r15,%rcx,8),%xmm0
subsd  (%r15,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x10(%r15,%rcx,8),%xmm0
subsd  0x8(%r15,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r14,%rcx,8)
movsd  0x18(%r15,%rcx,8),%xmm0
subsd  0x10(%r15,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r14,%rcx,8)
movsd  0x20(%r15,%rcx,8),%xmm0
subsd  0x18(%r15,%rcx,8),%xmm0
movsd  %xmm0,0x18(%r14,%rcx,8)
lea    0x4(%rcx),%rax
mov    %rax,%rcx
cmp    %rax,%rbp
jne    12b0 <spline+0x170>
jmp    1405 <spline+0x2c5>
mov    %ebp,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
mov    0x8(%rsp),%r8
mov    0x28(%rsp),%rdi
je     1529 <spline+0x3e9>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%r15,%rcx,8),%xmm0
movupd 0x8(%r15,%rcx,8),%xmm1
subpd  %xmm0,%xmm1
movupd 0x10(%r15,%rcx,8),%xmm0
movupd 0x18(%r15,%rcx,8),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm1,(%r14,%rcx,8)
movupd %xmm2,0x10(%r14,%rcx,8)
movupd 0x20(%r15,%rcx,8),%xmm0
movupd 0x28(%r15,%rcx,8),%xmm1
subpd  %xmm0,%xmm1
movupd 0x30(%r15,%rcx,8),%xmm0
movupd 0x38(%r15,%rcx,8),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm1,0x20(%r14,%rcx,8)
movupd %xmm2,0x30(%r14,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1350 <spline+0x210>
test   $0x1,%dl
je     13fc <spline+0x2bc>
lea    0x0(,%rcx,8),%rdx
or     $0x8,%rdx
movupd (%r15,%rdx,1),%xmm0
movupd 0x10(%r15,%rdx,1),%xmm1
movupd (%r15,%rcx,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%r15,%rcx,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%r14,%rcx,8)
movupd %xmm1,0x10(%r14,%rcx,8)
cmp    %rbp,%rax
jne    121b <spline+0xdb>
cmp    $0x2,%r9d
jle    14fe <spline+0x3be>
lea    -0x1(%rbp),%r8
mov    $0x1,%eax
cmp    $0x2,%r8
jb     1544 <spline+0x404>
mov    %r10,0x18(%rsp)
lea    (%rdi,%rbp,8),%rsi
mov    %rdi,%r10
mov    %rdi,%rdx
add    $0x8,%rdx
lea    (%r14,%rbp,8),%rcx
mov    %rbp,%rdi
lea    (%r12,%rbp,8),%rbp
add    $0x8,%rbp
cmp    %rcx,%rdx
setb   %bl
cmp    %rsi,%r14
setb   %cl
cmp    %rbp,%rdx
setb   %dl
cmp    %r12,%rsi
seta   %sil
test   %cl,%bl
jne    1539 <spline+0x3f9>
and    %sil,%dl
mov    %rdi,%rbp
mov    %r10,%rdi
mov    0x18(%rsp),%r10
jne    1544 <spline+0x404>
mov    %r8,%rdx
and    $0xfffffffffffffffe,%rdx
mov    %r8,%rax
or     $0x1,%rax
xor    %esi,%esi
movapd 0xb6f(%rip),%xmm0
movapd 0xb77(%rip),%xmm1
nopl   0x0(%rax)
movupd (%r14,%rsi,8),%xmm2
movapd %xmm1,%xmm3
divpd  %xmm2,%xmm3
movupd 0x8(%r14,%rsi,8),%xmm2
movapd %xmm0,%xmm4
divpd  %xmm2,%xmm4
movupd (%r12,%rsi,8),%xmm2
movupd 0x8(%r12,%rsi,8),%xmm5
movupd 0x10(%r12,%rsi,8),%xmm6
subpd  %xmm5,%xmm6
mulpd  %xmm4,%xmm6
subpd  %xmm2,%xmm5
mulpd  %xmm3,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,0x8(%rdi,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%rdx
jne    14a0 <spline+0x360>
cmp    %rdx,%r8
jne    1544 <spline+0x404>
jmp    15aa <spline+0x46a>
movabs $0x3ff0000000000000,%rax
mov    0x40(%rsp),%rdx
mov    %rax,(%rdx)
mov    0x30(%rsp),%rbx
movq   $0x0,(%rbx)
movq   $0x0,0x0(%r13)
jmp    1654 <spline+0x514>
xor    %ecx,%ecx
test   $0x1,%dl
jne    13c1 <spline+0x281>
jmp    13fc <spline+0x2bc>
mov    %rdi,%rbp
mov    %r10,%rdi
mov    0x18(%rsp),%r10
movsd  0xad4(%rip),%xmm0
movsd  0xad4(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm0,%xmm2
divsd  (%r14,%rax,8),%xmm2
movsd  (%r12,%rax,8),%xmm3
movsd  0x8(%r12,%rax,8),%xmm4
subsd  %xmm3,%xmm4
subsd  -0x8(%r12,%rax,8),%xmm3
mulsd  %xmm2,%xmm4
movapd %xmm1,%xmm2
divsd  -0x8(%r14,%rax,8),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
movsd  %xmm2,(%rdi,%rax,8)
lea    0x1(%rax),%rcx
mov    %rcx,%rax
cmp    %rcx,%rbp
jne    1560 <spline+0x420>
movabs $0x3ff0000000000000,%rax
mov    0x40(%rsp),%rdx
mov    %rax,(%rdx)
mov    0x30(%rsp),%rbx
movq   $0x0,(%rbx)
movq   $0x0,0x0(%r13)
cmp    $0x3,%r9d
mov    0x8(%rsp),%r8
jl     1654 <spline+0x514>
lea    -0x8(,%rbp,8),%rax
ff
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x10(%r15,%rcx,1),%xmm0
subsd  (%r15,%rcx,1),%xmm0
movsd  (%rbx,%rcx,1),%xmm1
mulsd  (%r14,%rcx,1),%xmm1
addsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdx,%rcx,1)
movsd  0x8(%r14,%rcx,1),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx,%rcx,1)
movsd  (%r14,%rcx,1),%xmm0
mulsd  0x0(%r13,%rcx,1),%xmm0
movsd  0x8(%rdi,%rcx,1),%xmm1
subsd  %xmm0,%xmm1
divsd  0x8(%rdx,%rcx,1),%xmm1
movsd  %xmm1,0x8(%r13,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    15f0 <spline+0x4b0>
movslq %r11d,%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rdx,%rax,8)
movq   $0x0,0x0(%r13,%rax,8)
movq   $0x0,(%r8,%rax,8)
cmp    $0x2,%r9d
jl     17e8 <spline+0x6a8>
mov    %rbp,0x50(%rsp)
mov    %r11d,0x4c(%rsp)
lea    -0x2(%r9),%eax
shl    $0x3,%rax
lea    0x8(%r12),%rcx
mov    %r8,%rdx
add    $0x8,%rdx
mov    $0xfffffffffffffff8,%r8
movsd  0x973(%rip),%xmm0
mov    %r13,%r9
mov    %r14,%rbp
mov    0x38(%rsp),%rsi
mov    %r10,%r13
nopl   0x0(%rax,%rax,1)
movsd  (%r9,%rax,1),%xmm1
movsd  (%rdx,%rax,1),%xmm2
movsd  (%rbx,%rax,1),%xmm3
mulsd  %xmm2,%xmm3
subsd  %xmm3,%xmm1
movsd  %xmm1,-0x8(%rdx,%rax,1)
movsd  (%rcx,%rax,1),%xmm3
subsd  -0x8(%rcx,%rax,1),%xmm3
movsd  0x0(%rbp,%rax,1),%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm4,%xmm1
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rsi,%rax,1)
movsd  (%rdx,%rax,1),%xmm1
subsd  -0x8(%rdx,%rax,1),%xmm1
movsd  0x0(%rbp,%rax,1),%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,(%r10,%rax,1)
add    $0x8,%r8
add    $0xfffffffffffffff8,%rcx
add    $0xfffffffffffffff8,%rdx
add    $0xfffffffffffffff8,%r10
add    $0xfffffffffffffff8,%rsi
add    $0xfffffffffffffff8,%rbp
add    $0xfffffffffffffff8,%rbx
add    $0xfffffffffffffff8,%r9
cmp    %r8,%rax
jne    16c0 <spline+0x580>
lea    0x907(%rip),%rdi
call   1040 <puts@plt>
xor    %esi,%esi
cmpl   $0x2,0x10(%rsp)
mov    0x20(%rsp),%rbx
mov    0x8(%rsp),%rbp
jl     17ff <spline+0x6bf>
xor    %ebx,%ebx
mov    %r12,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %rbp,%r13
mov    0x38(%rsp),%rbp
mov    0x50(%rsp),%r12
movsd  (%r15,%rbx,8),%xmm0
mov    0x10(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm1
movsd  0x0(%rbp,%rbx,8),%xmm2
movsd  0x0(%r13,%rbx,8),%xmm3
mov    0x18(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm4
lea    0x872(%rip),%rdi
mov    %ebx,%esi
mov    $0x5,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1790 <spline+0x650>
mov    0x4c(%rsp),%esi
mov    0x20(%rsp),%rbx
mov    %r13,%rbp
mov    0x18(%rsp),%r13
mov    0x10(%rsp),%r12
jmp    17ff <spline+0x6bf>
mov    %r8,%rbp
mov    %r13,%rbx
mov    %r10,%r13
lea    0x86a(%rip),%rdi
call   1040 <puts@plt>
xor    %esi,%esi
mov    %esi,%eax
movsd  (%r15,%rax,8),%xmm0
movsd  (%r12,%rax,8),%xmm1
lea    0x83e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"i\09x\09a\09b\09c\09d\0A\00"
@.str.1 = [34 x i8] c"%d\09%.4lf\09%.4lf\09%.4lf\09%.4lf\09%.4lf\0A\00"
@.str.2 = [16 x i8] c"%d\09%.4lf\09%.4lf\0A\00"
define void @spline(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = trunc i64 %18 to i32
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to double*
store double* %21, double** %8
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = mul i64 %23, 8
%25 = trunc i64 %24 to i32
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %9
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 8
%31 = trunc i64 %30 to i32
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to double*
store double* %33, double** %10
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = mul i64 %35, 8
%37 = trunc i64 %36 to i32
%38 = call i64 @malloc(i32 %37)
%39 = inttoptr i64 %38 to double*
store double* %39, double** %11
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to double*
store double* %45, double** %12
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 8
%49 = trunc i64 %48 to i32
%50 = call i64 @malloc(i32 %49)
%51 = inttoptr i64 %50 to double*
store double* %51, double** %13
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 8
%55 = trunc i64 %54 to i32
%56 = call i64 @malloc(i32 %55)
%57 = inttoptr i64 %56 to double*
store double* %57, double** %14
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = mul i64 %59, 8
%61 = trunc i64 %60 to i32
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to double*
store double* %63, double** %15
store i32 0, i32* %7
br label %64
64: ; preds = %86, %3
%65 = load i32, i32* %7
%66 = load i32, i32* %4
%67 = sub nsw i32 %66, 1
%68 = icmp slt i32 %65, %67
br i1 %68, label %69, label %89
69: ; preds = %64
%70 = load double*, double** %5
%71 = load i32, i32* %7
%72 = add nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %70, i64 %73
%75 = load double, double* %74
%76 = load double*, double** %5
%77 = load i32, i32* %7
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
%81 = fsub double %75, %80
%82 = load double*, double** %8
%83 = load i32, i32* %7
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
store double %81, double* %85
br label %86
86: ; preds = %69
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %64
89: ; preds = %64
store i32 1, i32* %7
br label %90
90: ; preds = %140, %89
%91 = load i32, i32* %7
%92 = load i32, i32* %4
%93 = sub nsw i32 %92, 1
%94 = icmp slt i32 %91, %93
br i1 %94, label %95, label %143
95: ; preds = %90
%96 = load double*, double** %8
%97 = load i32, i32* %7
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = load double, double* %99
%101 = fdiv double 3.000000e+00, %100
%102 = load double*, double** %6
%103 = load i32, i32* %7
%104 = add nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %102, i64 %105
%107 = load double, double* %106
%108 = load double*, double** %6
%109 = load i32, i32* %7
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = fsub double %107, %112
%114 = load double*, double** %8
%115 = load i32, i32* %7
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %114, i64 %117
%119 = load double, double* %118
%120 = fdiv double 3.000000e+00, %119
%121 = load double*, double** %6
%122 = load i32, i32* %7
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %121, i64 %123
%125 = load double, double* %124
%126 = load double*, double** %6
%127 = load i32, i32* %7
%128 = sub nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %126, i64 %129
%131 = load double, double* %130
%132 = fsub double %125, %131
%133 = fmul double %120, %132
%134 = fneg double %133
%135 = call double @llvm.fmuladd.f64(double %101, double %113, double %134)
%136 = load double*, double** %9
%137 = load i32, i32* %7
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
store double %135, double* %139
br label %140
140: ; preds = %95
%141 = load i32, i32* %7
%142 = add nsw i32 %141, 1
store i32 %142, i32* %7
br label %90
143: ; preds = %90
%144 = load double*, double** %12
%145 = getelementptr inbounds double, double* %144, i64 0
store double 1.000000e+00, double* %145
%146 = load double*, double** %10
%147 = getelementptr inbounds double, double* %146, i64 0
store double 0.000000e+00, double* %147
%148 = load double*, double** %11
%149 = getelementptr inbounds double, double* %148, i64 0
store double 0.000000e+00, double* %149
store i32 1, i32* %7
br label %150
150: ; preds = %232, %143
%151 = load i32, i32* %7
%152 = load i32, i32* %4
%153 = sub nsw i32 %152, 1
%154 = icmp slt i32 %151, %153
br i1 %154, label %155, label %235
155: ; preds = %150
%156 = load double*, double** %5
%157 = load i32, i32* %7
%158 = add nsw i32 %157, 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %156, i64 %159
%161 = load double, double* %160
%162 = load double*, double** %5
%163 = load i32, i32* %7
%164 = sub nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %162, i64 %165
%167 = load double, double* %166
%168 = fsub double %161, %167
%169 = load double*, double** %8
%170 = load i32, i32* %7
%171 = sub nsw i32 %170, 1
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %169, i64 %172
%174 = load double, double* %173
%175 = load double*, double** %10
%176 = load i32, i32* %7
%177 = sub nsw i32 %176, 1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %175, i64 %178
%180 = load double, double* %179
%181 = fmul double %174, %180
%182 = fneg double %181
%183 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %168, double %182)
%184 = load double*, double** %12
%185 = load i32, i32* %7
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
store double %183, double* %187
%188 = load double*, double** %8
%189 = load i32, i32* %7
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %188, i64 %190
%192 = load double, double* %191
%193 = load double*, double** %12
%194 = load i32, i32* %7
%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** %10
%200 = load i32, i32* %7
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
store double %198, double* %202
%203 = load double*, double** %9
%204 = load i32, i32* %7
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds double, double* %203, i64 %205
%207 = load double, double* %206
%208 = load double*, double** %8
%209 = load i32, i32* %7
%210 = sub nsw i32 %209, 1
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %208, i64 %211
%213 = load double, double* %212
%214 = load double*, double** %11
%215 = load i32, i32* %7
%216 = sub nsw i32 %215, 1
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %214, i64 %217
%219 = load double, double* %218
%220 = fneg double %213
%221 = call double @llvm.fmuladd.f64(double %220, double %219, double %207)
%222 = load double*, double** %12
%223 = load i32, i32* %7
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = fdiv double %221, %226
%228 = load double*, double** %11
%229 = load i32, i32* %7
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %228, i64 %230
store double %227, double* %231
br label %232
232: ; preds = %155
%233 = load i32, i32* %7
%234 = add nsw i32 %233, 1
store i32 %234, i32* %7
br label %150
235: ; preds = %150
%236 = load double*, double** %12
%237 = load i32, i32* %4
%238 = sub nsw i32 %237, 1
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds double, double* %236, i64 %239
store double 1.000000e+00, double* %240
%241 = load double*, double** %11
%242 = load i32, i32* %4
%243 = sub nsw i32 %242, 1
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %241, i64 %244
store double 0.000000e+00, double* %245
%246 = load double*, double** %14
%247 = load i32, i32* %4
%248 = sub nsw i32 %247, 1
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double, double* %246, i64 %249
store double 0.000000e+00, double* %250
%251 = load i32, i32* %4
%252 = sub nsw i32 %251, 2
store i32 %252, i32* %7
br label %253
253: ; preds = %344, %235
%254 = load i32, i32* %7
%255 = icmp sge i32 %254, 0
br i1 %255, label %256, label %347
256: ; preds = %253
%257 = load double*, double** %11
%258 = load i32, i32* %7
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %257, i64 %259
%261 = load double, double* %260
%262 = load double*, double** %10
%263 = load i32, i32* %7
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %262, i64 %264
%266 = load double, double* %265
%267 = load double*, double** %14
%268 = load i32, i32* %7
%269 = add nsw i32 %268, 1
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds double, double* %267, i64 %270
%272 = load double, double* %271
%273 = fneg double %266
%274 = call double @llvm.fmuladd.f64(double %273, double %272, double %261)
%275 = load double*, double** %14
%276 = load i32, i32* %7
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds double, double* %275, i64 %277
store double %274, double* %278
%279 = load double*, double** %6
%280 = load i32, i32* %7
%281 = add nsw i32 %280, 1
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %279, i64 %282
%284 = load double, double* %283
%285 = load double*, double** %6
%286 = load i32, i32* %7
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %285, i64 %287
%289 = load double, double* %288
%290 = fsub double %284, %289
%291 = load double*, double** %8
%292 = load i32, i32* %7
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds double, double* %291, i64 %293
%295 = load double, double* %294
%296 = fdiv double %290, %295
%297 = load double*, double** %8
%298 = load i32, i32* %7
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds double, double* %297, i64 %299
%301 = load double, double* %300
%302 = load double*, double** %14
%303 = load i32, i32* %7
%304 = add nsw i32 %303, 1
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds double, double* %302, i64 %305
%307 = load double, double* %306
%308 = load double*, double** %14
%309 = load i32, i32* %7
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %308, i64 %310
%312 = load double, double* %311
%313 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %312, double %307)
%314 = fmul double %301, %313
%315 = fdiv double %314, 3.000000e+00
%316 = fsub double %296, %315
%317 = load double*, double** %13
%318 = load i32, i32* %7
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds double, double* %317, i64 %319
store double %316, double* %320
%321 = load double*, double** %14
%322 = load i32, i32* %7
%323 = add nsw i32 %322, 1
%324 = sext i32 %323 to i64
%325 = getelementptr inbounds double, double* %321, i64 %324
%326 = load double, double* %325
%327 = load double*, double** %14
%328 = load i32, i32* %7
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds double, double* %327, i64 %329
%331 = load double, double* %330
%332 = fsub double %326, %331
%333 = load double*, double** %8
%334 = load i32, i32* %7
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds double, double* %333, i64 %335
%337 = load double, double* %336
%338 = fmul double 3.000000e+00, %337
%339 = fdiv double %332, %338
%340 = load double*, double** %15
%341 = load i32, i32* %7
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds double, double* %340, i64 %342
store double %339, double* %343
br label %344
344: ; preds = %256
%345 = load i32, i32* %7
%346 = add nsw i32 %345, -1
store i32 %346, i32* %7
br label %253
347: ; preds = %253
%348 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %349
349: ; preds = %382, %347
%350 = load i32, i32* %7
%351 = load i32, i32* %4
%352 = sub nsw i32 %351, 1
%353 = icmp slt i32 %350, %352
br i1 %353, label %354, label %385
354: ; preds = %349
%355 = load i32, i32* %7
%356 = load double*, double** %5
%357 = load i32, i32* %7
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds double, double* %356, i64 %358
%360 = load double, double* %359
%361 = load double*, double** %6
%362 = load i32, i32* %7
%363 = sext i32 %362 to i64
%364 = getelementptr inbounds double, double* %361, i64 %363
%365 = load double, double* %364
%366 = load double*, double** %13
%367 = load i32, i32* %7
%368 = sext i32 %367 to i64
%369 = getelementptr inbounds double, double* %366, i64 %368
%370 = load double, double* %369
%371 = load double*, double** %14
%372 = load i32, i32* %7
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds double, double* %371, i64 %373
%375 = load double, double* %374
%376 = load double*, double** %15
%377 = load i32, i32* %7
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds double, double* %376, i64 %378
%380 = load double, double* %379
%381 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %355, double %360, double %365, double %370, double %375, double %380)
br label %382
382: ; preds = %354
%383 = load i32, i32* %7
%384 = add nsw i32 %383, 1
store i32 %384, i32* %7
br label %349
385: ; preds = %349
%386 = load i32, i32* %7
%387 = load double*, double** %5
%388 = load i32, i32* %7
%389 = sext i32 %388 to i64
%390 = getelementptr inbounds double, double* %387, i64 %389
%391 = load double, double* %390
%392 = load double*, double** %6
%393 = load i32, i32* %7
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds double, double* %392, i64 %394
%396 = load double, double* %395
%397 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %386, double %391, double %396)
%398 = load double*, double** %8
%399 = call i32 @free(double* %398)
%400 = load double*, double** %9
%401 = call i32 @free(double* %400)
%402 = load double*, double** %10
%403 = call i32 @free(double* %402)
%404 = load double*, double** %12
%405 = call i32 @free(double* %404)
%406 = load double*, double** %11
%407 = call i32 @free(double* %406)
%408 = load double*, double** %13
%409 = call i32 @free(double* %408)
%410 = load double*, double** %14
%411 = call i32 @free(double* %410)
%412 = load double*, double** %15
%413 = call i32 @free(double* %412)
ret void
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"%d\09%.4lf\09%.4lf\09%.4lf\09%.4lf\09%.4lf\0A\00"
@.str.2 = [16 x i8] c"%d\09%.4lf\09%.4lf\0A\00"
@str = [12 x i8] c"i\09x\09a\09b\09c\09d\00"
define void @spline(i32 %0, double* nocapture %1, double* nocapture %2) {
%4 = shl i32 %0, 3
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to double*
%7 = inttoptr i64 %5 to i8*
%8 = tail call i64 @malloc(i32 %4)
%9 = inttoptr i64 %8 to double*
%10 = tail call i64 @malloc(i32 %4)
%11 = inttoptr i64 %10 to double*
%12 = tail call i64 @malloc(i32 %4)
%13 = inttoptr i64 %12 to double*
%14 = tail call i64 @malloc(i32 %4)
%15 = inttoptr i64 %14 to double*
%16 = tail call i64 @malloc(i32 %4)
%17 = inttoptr i64 %16 to double*
%18 = tail call i64 @malloc(i32 %4)
%19 = inttoptr i64 %18 to double*
%20 = tail call i64 @malloc(i32 %4)
%21 = inttoptr i64 %20 to double*
%22 = add i32 %0, -1
%23 = icmp sgt i32 %0, 1
br i1 %23, label %29, label %24
24: ; preds = %3
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %13
%25 = sext i32 %22 to i64
%26 = getelementptr inbounds double, double* %15, i64 %25
store double 1.000000e+00, double* %26
%27 = getelementptr inbounds double, double* %13, i64 %25
store double 0.000000e+00, double* %27
%28 = getelementptr inbounds double, double* %19, i64 %25
store double 0.000000e+00, double* %28
br label %327
29: ; preds = %3
%30 = zext i32 %22 to i64
%31 = icmp ult i32 %22, 4
br i1 %31, label %119, label %32
32: ; preds = %29
%33 = getelementptr double, double* %6, i64 %30
%34 = add nuw nsw i64 %30, 1
%35 = getelementptr double, double* %1, i64 %34
%36 = bitcast double* %35 to i8*
%37 = icmp ult i8* %7, %36
%38 = icmp ugt double* %33, %1
%39 = and i1 %37, %38
br i1 %39, label %119, label %40
40: ; preds = %32
%41 = and i64 %30, 4294967292
%42 = add nsw i64 %41, -4
%43 = lshr exact i64 %42, 2
%44 = add nuw nsw i64 %43, 1
%45 = and i64 %44, 1
%46 = icmp eq i64 %42, 0
br i1 %46, label %94, label %47
47: ; preds = %40
%48 = and i64 %44, 9223372036854775806
br label %49
49: ; preds = %49, %47
%50 = phi i64 [ 0, %47 ], [ %91, %49 ]
%51 = phi i64 [ 0, %47 ], [ %92, %49 ]
%52 = or i64 %50, 1
%53 = getelementptr inbounds double, double* %1, i64 %52
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %53, i64 2
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = getelementptr inbounds double, double* %1, i64 %50
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = getelementptr inbounds double, double* %59, i64 2
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = fsub <2 x double> %55, %61
%66 = fsub <2 x double> %58, %64
%67 = getelementptr inbounds double, double* %6, i64 %50
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> %65, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %66, <2 x double>* %70
%71 = or i64 %50, 4
%72 = or i64 %50, 5
%73 = getelementptr inbounds double, double* %1, i64 %72
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %73, i64 2
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = getelementptr inbounds double, double* %1, i64 %71
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = getelementptr inbounds double, double* %79, i64 2
%83 = bitcast double* %82 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = fsub <2 x double> %75, %81
%86 = fsub <2 x double> %78, %84
%87 = getelementptr inbounds double, double* %6, i64 %71
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %85, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
%91 = add nuw i64 %50, 8
%92 = add i64 %51, 2
%93 = icmp eq i64 %92, %48
br i1 %93, label %94, label %49
94: ; preds = %49, %40
%95 = phi i64 [ 0, %40 ], [ %91, %49 ]
%96 = icmp eq i64 %45, 0
br i1 %96, label %117, label %97
97: ; preds = %94
%98 = or i64 %95, 1
%99 = getelementptr inbounds double, double* %1, i64 %98
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = getelementptr inbounds double, double* %1, i64 %95
%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> %101, %107
%112 = fsub <2 x double> %104, %110
%113 = getelementptr inbounds double, double* %6, i64 %95
%114 = bitcast double* %113 to <2 x double>*
store <2 x double> %111, <2 x double>* %114
%115 = getelementptr inbounds double, double* %113, i64 2
%116 = bitcast double* %115 to <2 x double>*
store <2 x double> %112, <2 x double>* %116
br label %117
117: ; preds = %94, %97
%118 = icmp eq i64 %41, %30
br i1 %118, label %140, label %119
119: ; preds = %32, %29, %117
%120 = phi i64 [ 0, %32 ], [ 0, %29 ], [ %41, %117 ]
%121 = xor i64 %120, -1
%122 = add nsw i64 %121, %30
%123 = and i64 %30, 3
%124 = icmp eq i64 %123, 0
br i1 %124, label %137, label %125
125: ; preds = %119, %125
%126 = phi i64 [ %128, %125 ], [ %120, %119 ]
%127 = phi i64 [ %135, %125 ], [ 0, %119 ]
%128 = add nuw nsw i64 %126, 1
%129 = getelementptr inbounds double, double* %1, i64 %128
%130 = load double, double* %129
%131 = getelementptr inbounds double, double* %1, i64 %126
%132 = load double, double* %131
%133 = fsub double %130, %132
%134 = getelementptr inbounds double, double* %6, i64 %126
store double %133, double* %134
%135 = add i64 %127, 1
%136 = icmp eq i64 %135, %123
br i1 %136, label %137, label %125
137: ; preds = %125, %119
%138 = phi i64 [ %120, %119 ], [ %128, %125 ]
%139 = icmp ult i64 %122, 3
br i1 %139, label %140, label %197
140: ; preds = %137, %197, %117
%141 = icmp sgt i32 %0, 2
br i1 %141, label %143, label %142
142: ; preds = %140
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %13
br label %285
143: ; preds = %140
%144 = zext i32 %22 to i64
%145 = add nsw i64 %30, -1
%146 = icmp ult i64 %145, 2
br i1 %146, label %195, label %147
147: ; preds = %143
%148 = getelementptr double, double* %9, i64 1
%149 = getelementptr double, double* %9, i64 %30
%150 = bitcast double* %149 to i8*
%151 = getelementptr double, double* %6, i64 %30
%152 = add nuw nsw i64 %30, 1
%153 = getelementptr double, double* %2, i64 %152
%154 = icmp ult double* %148, %151
%155 = icmp ult i8* %7, %150
%156 = and i1 %154, %155
%157 = icmp ult double* %148, %153
%158 = icmp ugt double* %149, %2
%159 = and i1 %157, %158
%160 = or i1 %156, %159
br i1 %160, label %195, label %161
161: ; preds = %147
%162 = and i64 %145, -2
%163 = or i64 %145, 1
br label %164
164: ; preds = %164, %161
%165 = phi i64 [ 0, %161 ], [ %191, %164 ]
%166 = or i64 %165, 1
%167 = getelementptr inbounds double, double* %6, i64 %166
%168 = bitcast double* %167 to <2 x double>*
%169 = load <2 x double>, <2 x double>* %168
%170 = fdiv <2 x double> <double 3.000000e+00, double 3.000000e+00>, %169
%171 = add i64 %165, 2
%172 = getelementptr inbounds double, double* %2, i64 %171
%173 = bitcast double* %172 to <2 x double>*
%174 = load <2 x double>, <2 x double>* %173
%175 = getelementptr inbounds double, double* %2, i64 %166
%176 = bitcast double* %175 to <2 x double>*
%177 = load <2 x double>, <2 x double>* %176
%178 = fsub <2 x double> %174, %177
%179 = getelementptr inbounds double, double* %6, i64 %165
%180 = bitcast double* %179 to <2 x double>*
%181 = load <2 x double>, <2 x double>* %180
%182 = getelementptr inbounds double, double* %2, i64 %165
%183 = bitcast double* %182 to <2 x double>*
%184 = load <2 x double>, <2 x double>* %183
%185 = fsub <2 x double> %177, %184
%186 = fdiv <2 x double> <double -3.000000e+00, double -3.000000e+00>, %181
%187 = fmul <2 x double> %186, %185
%188 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %170, <2 x double> %178, <2 x double> %187)
%189 = getelementptr inbounds double, double* %9, i64 %166
%190 = bitcast double* %189 to <2 x double>*
store <2 x double> %188, <2 x double>* %190
%191 = add nuw i64 %165, 2
%192 = icmp eq i64 %191, %162
br i1 %192, label %193, label %164
193: ; preds = %164
%194 = icmp eq i64 %145, %162
br i1 %194, label %250, label %195
195: ; preds = %147, %143, %193
%196 = phi i64 [ 1, %147 ], [ 1, %143 ], [ %163, %193 ]
br label %228
197: ; preds = %137, %197
%198 = phi i64 [ %220, %197 ], [ %138, %137 ]
%199 = add nuw nsw i64 %198, 1
%200 = getelementptr inbounds double, double* %1, i64 %199
%201 = load double, double* %200
%202 = getelementptr inbounds double, double* %1, i64 %198
%203 = load double, double* %202
%204 = fsub double %201, %203
%205 = getelementptr inbounds double, double* %6, i64 %198
store double %204, double* %205
%206 = add nuw nsw i64 %198, 2
%207 = getelementptr inbounds double, double* %1, i64 %206
%208 = load double, double* %207
%209 = getelementptr inbounds double, double* %1, i64 %199
%210 = load double, double* %209
%211 = fsub double %208, %210
%212 = getelementptr inbounds double, double* %6, i64 %199
store double %211, double* %212
%213 = add nuw nsw i64 %198, 3
%214 = getelementptr inbounds double, double* %1, i64 %213
%215 = load double, double* %214
%216 = getelementptr inbounds double, double* %1, i64 %206
%217 = load double, double* %216
%218 = fsub double %215, %217
%219 = getelementptr inbounds double, double* %6, i64 %206
store double %218, double* %219
%220 = add nuw nsw i64 %198, 4
%221 = getelementptr inbounds double, double* %1, i64 %220
%222 = load double, double* %221
%223 = getelementptr inbounds double, double* %1, i64 %213
%224 = load double, double* %223
%225 = fsub double %222, %224
%226 = getelementptr inbounds double, double* %6, i64 %213
store double %225, double* %226
%227 = icmp eq i64 %220, %30
br i1 %227, label %140, label %197
228: ; preds = %195, %228
%229 = phi i64 [ %233, %228 ], [ %196, %195 ]
%230 = getelementptr inbounds double, double* %6, i64 %229
%231 = load double, double* %230
%232 = fdiv double 3.000000e+00, %231
%233 = add nuw nsw i64 %229, 1
%234 = getelementptr inbounds double, double* %2, i64 %233
%235 = load double, double* %234
%236 = getelementptr inbounds double, double* %2, i64 %229
%237 = load double, double* %236
%238 = fsub double %235, %237
%239 = add nsw i64 %229, -1
%240 = getelementptr inbounds double, double* %6, i64 %239
%241 = load double, double* %240
%242 = getelementptr inbounds double, double* %2, i64 %239
%243 = load double, double* %242
%244 = fsub double %237, %243
%245 = fdiv double -3.000000e+00, %241
%246 = fmul double %245, %244
%247 = tail call double @llvm.fmuladd.f64(double %232, double %238, double %246)
%248 = getelementptr inbounds double, double* %9, i64 %229
store double %247, double* %248
%249 = icmp eq i64 %233, %144
br i1 %249, label %250, label %228
250: ; preds = %228, %193
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %13
br i1 %141, label %251, label %285
251: ; preds = %250
%252 = zext i32 %22 to i64
br label %253
253: ; preds = %251, %253
%254 = phi i64 [ 1, %251 ], [ %255, %253 ]
%255 = add nuw nsw i64 %254, 1
%256 = getelementptr inbounds double, double* %1, i64 %255
%257 = load double, double* %256
%258 = add nsw i64 %254, -1
%259 = getelementptr inbounds double, double* %1, i64 %258
%260 = load double, double* %259
%261 = fsub double %257, %260
%262 = getelementptr inbounds double, double* %6, i64 %258
%263 = load double, double* %262
%264 = getelementptr inbounds double, double* %11, i64 %258
%265 = load double, double* %264
%266 = fneg double %263
%267 = fmul double %265, %266
%268 = tail call double @llvm.fmuladd.f64(double %261, double 2.000000e+00, double %267)
%269 = getelementptr inbounds double, double* %15, i64 %254
store double %268, double* %269
%270 = getelementptr inbounds double, double* %6, i64 %254
%271 = load double, double* %270
%272 = fdiv double %271, %268
%273 = getelementptr inbounds double, double* %11, i64 %254
store double %272, double* %273
%274 = getelementptr inbounds double, double* %9, i64 %254
%275 = load double, double* %274
%276 = load double, double* %262
%277 = getelementptr inbounds double, double* %13, i64 %258
%278 = load double, double* %277
%279 = fneg double %276
%280 = tail call double @llvm.fmuladd.f64(double %279, double %278, double %275)
%281 = load double, double* %269
%282 = fdiv double %280, %281
%283 = getelementptr inbounds double, double* %13, i64 %254
store double %282, double* %283
%284 = icmp eq i64 %255, %252
br i1 %284, label %285, label %253
285: ; preds = %253, %142, %250
%286 = sext i32 %22 to i64
%287 = getelementptr inbounds double, double* %15, i64 %286
store double 1.000000e+00, double* %287
%288 = getelementptr inbounds double, double* %13, i64 %286
store double 0.000000e+00, double* %288
%289 = getelementptr inbounds double, double* %19, i64 %286
store double 0.000000e+00, double* %289
br i1 %23, label %290, label %327
290: ; preds = %285
%291 = add nsw i32 %0, -2
%292 = zext i32 %291 to i64
br label %293
293: ; preds = %290, %293
%294 = phi i64 [ %292, %290 ], [ %325, %293 ]
%295 = getelementptr inbounds double, double* %13, i64 %294
%296 = load double, double* %295
%297 = getelementptr inbounds double, double* %11, i64 %294
%298 = load double, double* %297
%299 = add nuw nsw i64 %294, 1
%300 = getelementptr inbounds double, double* %19, i64 %299
%301 = load double, double* %300
%302 = fneg double %298
%303 = tail call double @llvm.fmuladd.f64(double %302, double %301, double %296)
%304 = getelementptr inbounds double, double* %19, i64 %294
store double %303, double* %304
%305 = getelementptr inbounds double, double* %2, i64 %299
%306 = load double, double* %305
%307 = getelementptr inbounds double, double* %2, i64 %294
%308 = load double, double* %307
%309 = fsub double %306, %308
%310 = getelementptr inbounds double, double* %6, i64 %294
%311 = load double, double* %310
%312 = fdiv double %309, %311
%313 = tail call double @llvm.fmuladd.f64(double %303, double 2.000000e+00, double %301)
%314 = fmul double %313, %311
%315 = fdiv double %314, 3.000000e+00
%316 = fsub double %312, %315
%317 = getelementptr inbounds double, double* %17, i64 %294
store double %316, double* %317
%318 = load double, double* %300
%319 = load double, double* %304
%320 = fsub double %318, %319
%321 = load double, double* %310
%322 = fmul double %321, 3.000000e+00
%323 = fdiv double %320, %322
%324 = getelementptr inbounds double, double* %21, i64 %294
store double %323, double* %324
%325 = add nsw i64 %294, -1
%326 = icmp eq i64 %294, 0
br i1 %326, label %329, label %293
327: ; preds = %24, %285
%328 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %349
329: ; preds = %293
%330 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br i1 %23, label %331, label %349
331: ; preds = %329
%332 = zext i32 %22 to i64
br label %333
333: ; preds = %331, %333
%334 = phi i64 [ 0, %331 ], [ %347, %333 ]
%335 = getelementptr inbounds double, double* %1, i64 %334
%336 = load double, double* %335
%337 = getelementptr inbounds double, double* %2, i64 %334
%338 = load double, double* %337
%339 = getelementptr inbounds double, double* %17, i64 %334
%340 = load double, double* %339
%341 = getelementptr inbounds double, double* %19, i64 %334
%342 = load double, double* %341
%343 = getelementptr inbounds double, double* %21, i64 %334
%344 = load double, double* %343
%345 = trunc i64 %334 to i32
%346 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %345, double %336, double %338, double %340, double %342, double %344)
%347 = add nuw nsw i64 %334, 1
%348 = icmp eq i64 %347, %332
br i1 %348, label %349, label %333
349: ; preds = %333, %329, %327
%350 = phi i32 [ 0, %327 ], [ 0, %329 ], [ %22, %333 ]
%351 = zext i32 %350 to i64
%352 = getelementptr inbounds double, double* %1, i64 %351
%353 = load double, double* %352
%354 = getelementptr inbounds double, double* %2, i64 %351
%355 = load double, double* %354
%356 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %350, double %353, double %355)
%357 = tail call i32 @free(double* %6)
%358 = tail call i32 @free(double* %9)
%359 = tail call i32 @free(double* %11)
%360 = tail call i32 @free(double* %15)
%361 = tail call i32 @free(double* %13)
%362 = tail call i32 @free(double* %17)
%363 = tail call i32 @free(double* %19)
%364 = tail call i32 @free(double* %21)
ret void
}