#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__ d3(int, double *, double *, double *, double *, double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double pow(double, int);
int splines3(int n, const double *X, const double *Y, double *h, double *M,
             double *A, double *B, double tol) {
  int j, i;
  double *a, *b, *c;
  a = (double *)malloc((n + 1) * sizeof(double));
  b = (double *)malloc((n + 1) * sizeof(double));
  c = (double *)malloc((n + 1) * sizeof(double));
  for (j = 0; j < n; j++) {
    h[j + 1] = X[j + 1] - X[j];
  }
  b[0] = b[n] = 1;
  a[0] = 0;
  c[n - 1] = 0;
  M[0] = M[n] = 0;
  for (i = 1; i < n; i++) {
    j = i - 1;
    c[i - 1] = h[j] / 6.;
    b[i] = (h[j] + h[j + 1]) / 3.;
    c[i] = h[i + 1] / 6;
    M[i] = (Y[i + 1] - Y[i]) / h[i + 1] - (Y[i] - Y[i - 1]) / h[i];
  }
  if (d3(n, a, b, c, M, tol)) {
    free(a);
    free(b);
    free(c);
    return 1;
  }
  for (j = 0; j < n; j++) {
    A[j] = ((Y[j + 1] - Y[j]) / h[j + 1]) - (M[j + 1] - M[j]) * h[j + 1] / 6.;
    B[j] = Y[j] - M[j] * pow(h[j + 1], 2) / 6.;
  }
  return 0;
}


x86 assembly (clang, -O0):
<splines3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ff <splines3+0xbf>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11b4 <splines3+0x74>
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xdf1(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movsd  0xde0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1385 <splines3+0x245>
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd78(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xd43(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd10(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1266 <splines3+0x126>
mov    -0x8(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x28(%rbp),%r8
movsd  -0x38(%rbp),%xmm0
call   1040 <d3@plt>
cmp    $0x0,%rax
je     13d3 <splines3+0x293>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e8 <splines3+0x3a8>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14e1 <splines3+0x3a1>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movsd  0xbb8(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xb4a(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13da <splines3+0x29a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splines3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %r9,0x18(%rsp)
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%r14d
lea    0x8(,%r14,8),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %ebp,%edi
mov    %r14,%rbp
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rbp,(%rsp)
test   %ebp,%ebp
jle    1374 <splines3+0x234>
mov    (%rsp),%rcx
mov    %ecx,%eax
cmp    $0x4,%ecx
jb     11d5 <splines3+0x95>
lea    0x8(%rbx),%rcx
lea    0x8(,%rax,8),%rdx
add    %r13,%rdx
cmp    %rdx,%rcx
jae    1291 <splines3+0x151>
lea    (%rbx,%rax,8),%rcx
add    $0x8,%rcx
cmp    %r13,%rcx
jbe    1291 <splines3+0x151>
xor    %ecx,%ecx
mov    %rcx,%rsi
not    %rsi
add    %rax,%rsi
mov    %rax,%rdi
and    $0x3,%rdi
je     121d <splines3+0xdd>
nopl   0x0(%rax)
lea    0x1(%rcx),%rdx
movsd  0x8(%r13,%rcx,8),%xmm0
subsd  0x0(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rcx,8)
mov    %rdx,%rcx
add    $0xffffffffffffffff,%rdi
jne    11f0 <splines3+0xb0>
cmp    $0x3,%rsi
jb     1374 <splines3+0x234>
jmp    1230 <splines3+0xf0>
mov    %rcx,%rdx
cmp    $0x3,%rsi
jb     1374 <splines3+0x234>
nopw   0x0(%rax,%rax,1)
movsd  0x8(%r13,%rdx,8),%xmm0
subsd  0x0(%r13,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rdx,8)
movsd  0x10(%r13,%rdx,8),%xmm0
subsd  0x8(%r13,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rdx,8)
movsd  0x18(%r13,%rdx,8),%xmm0
subsd  0x10(%r13,%rdx,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rdx,8)
movsd  0x20(%r13,%rdx,8),%xmm0
subsd  0x18(%r13,%rdx,8),%xmm0
movsd  %xmm0,0x20(%rbx,%rdx,8)
lea    0x4(%rdx),%rcx
mov    %rcx,%rdx
cmp    %rcx,%rax
jne    1230 <splines3+0xf0>
jmp    1374 <splines3+0x234>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     155d <splines3+0x41d>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movupd 0x0(%r13,%rdx,8),%xmm0
movupd 0x8(%r13,%rdx,8),%xmm1
subpd  %xmm0,%xmm1
movupd 0x10(%r13,%rdx,8),%xmm0
movupd 0x18(%r13,%rdx,8),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm1,0x8(%rbx,%rdx,8)
movupd %xmm2,0x18(%rbx,%rdx,8)
movupd 0x20(%r13,%rdx,8),%xmm0
movupd 0x28(%r13,%rdx,8),%xmm1
subpd  %xmm0,%xmm1
movupd 0x30(%r13,%rdx,8),%xmm0
movupd 0x38(%r13,%rdx,8),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm1,0x28(%rbx,%rdx,8)
movupd %xmm2,0x38(%rbx,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rdi
jne    12c0 <splines3+0x180>
test   $0x1,%sil
je     136b <splines3+0x22b>
lea    0x0(,%rdx,8),%rsi
or     $0x8,%rsi
movupd 0x0(%r13,%rsi,1),%xmm0
movupd 0x10(%r13,%rsi,1),%xmm1
movupd 0x0(%r13,%rdx,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%r13,%rdx,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%rbx,%rsi,1)
movupd %xmm1,0x10(%rbx,%rsi,1)
cmp    %rax,%rcx
jne    11d7 <splines3+0x97>
mov    (%rsp),%rdx
movslq %edx,%rax
movabs $0x3ff0000000000000,%rcx
mov    0x20(%rsp),%rbp
mov    %rcx,0x0(%rbp,%rax,8)
mov    %rcx,0x0(%rbp)
mov    0x8(%rsp),%r13
movq   $0x0,0x0(%r13)
movq   $0x0,-0x8(%r14,%rax,8)
movq   $0x0,(%r15,%rax,8)
movq   $0x0,(%r15)
cmp    $0x2,%edx
jl     144d <splines3+0x30d>
mov    (%rsp),%eax
lea    -0x8(,%rax,8),%rax
ff
xor    %ecx,%ecx
movsd  0xc2a(%rip),%xmm0
movsd  0xc2a(%rip),%xmm1
xchg   %ax,%ax
movsd  (%rbx,%rcx,1),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%r14,%rcx,1)
movsd  (%rbx,%rcx,1),%xmm2
addsd  0x8(%rbx,%rcx,1),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbp,%rcx,1)
movsd  0x10(%rbx,%rcx,1),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%r14,%rcx,1)
movsd  0x8(%r12,%rcx,1),%xmm2
movsd  0x10(%r12,%rcx,1),%xmm3
subsd  %xmm2,%xmm3
divsd  0x10(%rbx,%rcx,1),%xmm3
subsd  (%r12,%rcx,1),%xmm2
divsd  0x8(%rbx,%rcx,1),%xmm2
subsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%r15,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    13e0 <splines3+0x2a0>
mov    (%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %r15,%r8
movsd  0x10(%rsp),%xmm0
call   1040 <d3@plt>
test   %rax,%rax
je     148f <splines3+0x34f>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
jmp    154e <splines3+0x40e>
cmpl   $0x0,(%rsp)
jle    154c <splines3+0x40c>
mov    (%rsp),%eax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
mov    0x18(%rsp),%rbp
nopl   0x0(%rax)
lea    0x1(%r14),%r13
movsd  0x8(%r12,%r14,8),%xmm0
subsd  (%r12,%r14,8),%xmm0
movsd  0x8(%rbx,%r14,8),%xmm1
movsd  0x8(%r15,%r14,8),%xmm2
subsd  (%r15,%r14,8),%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm2
movsd  0xb1b(%rip),%xmm1
divsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,0x0(%rbp,%r14,8)
movsd  (%r12,%r14,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r15,%r14,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rbx,%r14,8),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0xad6(%rip),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0x60(%rsp),%rax
movsd  %xmm1,(%rax,%r14,8)
mov    %r13,%r14
cmp    %r13,0x8(%rsp)
jne    14b0 <splines3+0x370>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%sil
jne    1330 <splines3+0x1f0>
jmp    136b <splines3+0x22b>

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

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