#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 */
double fmod(double, double);
void spline_eval(int nu, double *u, double *v, int n, double *x, double *y,
                 double *b, double *c, double *d) {
  const int n_1 = n - 1;
  int i, j, k, l;
  double ul, dx, tmp;
  int method = 3;
  if (method == 1 && n > 1) {
    dx = x[n_1] - x[0];
    for (l = 0; l < nu; l++) {
      v[l] = fmod(u[l] - x[0], dx);
      if (v[l] < 0.0)
        v[l] += dx;
      v[l] += x[0];
    }
  } else
    for (l = 0; l < nu; l++)
      v[l] = u[l];
  for (l = 0, i = 0; l < nu; l++) {
    ul = v[l];
    if (ul < x[i] || (i < n_1 && x[i + 1] < ul)) {
      i = 0;
      j = n;
      do {
        k = (i + j) / 2;
        if (ul < x[k])
          j = k;
        else
          i = k;
      } while (j > i + 1);
    }
    dx = ul - x[i];
    tmp = (method == 2 && ul < x[0]) ? 0.0 : d[i];
    v[l] = y[i] + dx * (b[i] + dx * (c[i] + dx * tmp));
  }
}


x86 assembly (clang, -O0):
<spline_eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
movl   $0x3,-0x64(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    1211 <spline_eval+0x101>
cmpl   $0x1,-0x1c(%rbp)
jle    1211 <spline_eval+0x101>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    120c <spline_eval+0xfc>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x58(%rbp),%xmm1
call   1030 <fmod@plt>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    11e4 <spline_eval+0xd4>
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    117f <spline_eval+0x6f>
jmp    1251 <spline_eval+0x141>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    124c <spline_eval+0x13c>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1218 <spline_eval+0x108>
jmp    1251 <spline_eval+0x141>
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13fb <spline_eval+0x2eb>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
ja     12c6 <spline_eval+0x1b6>
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    132c <spline_eval+0x21c>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    132c <spline_eval+0x21c>
movl   $0x0,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    130b <spline_eval+0x1fb>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1311 <spline_eval+0x201>
mov    -0x40(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1316 <spline_eval+0x206>
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     12d3 <spline_eval+0x1c3>
jmp    132c <spline_eval+0x21c>
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x2,-0x64(%rbp)
jne    1371 <spline_eval+0x261>
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1371 <spline_eval+0x261>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1383 <spline_eval+0x273>
mov    0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x58(%rbp),%xmm2
mov    0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm5
movsd  -0x58(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    125f <spline_eval+0x14f>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spline_eval>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    134c <spline_eval+0x24c>
mov    %edi,%r10d
cmp    $0x4,%edi
jb     112a <spline_eval+0x2a>
lea    (%rsi,%r10,8),%rax
cmp    %rdx,%rax
jbe    119c <spline_eval+0x9c>
lea    (%rdx,%r10,8),%rax
cmp    %rsi,%rax
jbe    119c <spline_eval+0x9c>
xor    %eax,%eax
mov    %rax,%r11
not    %r11
add    %r10,%r11
mov    %r10,%rbx
and    $0x3,%rbx
je     1154 <spline_eval+0x54>
xchg   %ax,%ax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rbx
jne    1140 <spline_eval+0x40>
cmp    $0x3,%r11
jb     127c <spline_eval+0x17c>
xchg   %ax,%ax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rax,8)
movsd  0x10(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x10(%rdx,%rax,8)
movsd  0x18(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x18(%rdx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r10
jne    1160 <spline_eval+0x60>
jmp    127c <spline_eval+0x17c>
mov    %r10d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rbx
mov    %rbx,%r14
shr    $0x2,%r14
add    $0x1,%r14
mov    %r14d,%r11d
and    $0x3,%r11d
cmp    $0xc,%rbx
jae    11c2 <spline_eval+0xc2>
xor    %ebx,%ebx
jmp    122c <spline_eval+0x12c>
and    $0xfffffffffffffffc,%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movups (%rsi,%rbx,8),%xmm0
movups 0x10(%rsi,%rbx,8),%xmm1
movups %xmm0,(%rdx,%rbx,8)
movups %xmm1,0x10(%rdx,%rbx,8)
movups 0x20(%rsi,%rbx,8),%xmm0
movups 0x30(%rsi,%rbx,8),%xmm1
movups %xmm0,0x20(%rdx,%rbx,8)
movups %xmm1,0x30(%rdx,%rbx,8)
movups 0x40(%rsi,%rbx,8),%xmm0
movups 0x50(%rsi,%rbx,8),%xmm1
movups %xmm0,0x40(%rdx,%rbx,8)
movups %xmm1,0x50(%rdx,%rbx,8)
movupd 0x60(%rsi,%rbx,8),%xmm0
movupd 0x70(%rsi,%rbx,8),%xmm1
movupd %xmm0,0x60(%rdx,%rbx,8)
movupd %xmm1,0x70(%rdx,%rbx,8)
add    $0x10,%rbx
add    $0xfffffffffffffffc,%r14
jne    11d0 <spline_eval+0xd0>
test   %r11,%r11
je     1273 <spline_eval+0x173>
lea    (%rdx,%rbx,8),%r14
add    $0x10,%r14
lea    (%rsi,%rbx,8),%r15
add    $0x10,%r15
shl    $0x5,%r11
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movupd -0x10(%r15,%rbx,1),%xmm0
movupd (%r15,%rbx,1),%xmm1
movupd %xmm0,-0x10(%r14,%rbx,1)
movupd %xmm1,(%r14,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r11
jne    1250 <spline_eval+0x150>
cmp    %r10,%rax
jne    112c <spline_eval+0x2c>
test   %edi,%edi
jle    134c <spline_eval+0x24c>
mov    0x40(%rsp),%r11
mov    0x38(%rsp),%r14
mov    0x30(%rsp),%r15
lea    -0x1(%rcx),%r12d
xor    %ebx,%ebx
xor    %esi,%esi
jmp    12df <spline_eval+0x1df>
nopl   (%rax)
movslq %esi,%rdi
movsd  (%r8,%rdi,8),%xmm1
subsd  %xmm1,%xmm0
movsd  (%r11,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r14,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r15,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r9,%rdi,8),%xmm1
movsd  %xmm1,(%rdx,%rbx,8)
add    $0x1,%rbx
cmp    %r10,%rbx
je     134c <spline_eval+0x24c>
movsd  (%rdx,%rbx,8),%xmm0
movslq %esi,%rdi
movsd  (%r8,%rdi,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1310 <spline_eval+0x210>
cmp    %r12d,%esi
jge    12a9 <spline_eval+0x1a9>
movslq %esi,%rbp
ucomisd 0x8(%r8,%rbp,8),%xmm0
jbe    12a9 <spline_eval+0x1a9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %esi,%esi
mov    %ecx,%edi
jmp    132d <spline_eval+0x22d>
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%esi
lea    0x1(%rsi),%eax
cmp    %eax,%edi
jle    12a0 <spline_eval+0x1a0>
lea    (%rsi,%rdi,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
movsd  (%r8,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    1320 <spline_eval+0x220>
mov    %ebp,%edi
jmp    1322 <spline_eval+0x222>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @spline_eval(i32 %0, double* %1, double* %2, i32 %3, double* %4, double* %5, double* %6, double* %7, double* %8) {
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca i32
store i32 %0, i32* %10
store double* %1, double** %11
store double* %2, double** %12
store i32 %3, i32* %13
store double* %4, double** %14
store double* %5, double** %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%28 = load i32, i32* %13
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %19
store i32 3, i32* %27
%30 = load i32, i32* %27
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %93
32: ; preds = %9
%33 = load i32, i32* %13
%34 = icmp sgt i32 %33, 1
br i1 %34, label %35, label %93
35: ; preds = %32
%36 = load double*, double** %14
%37 = load i32, i32* %19
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %14
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fsub double %40, %43
store double %44, double* %25
store i32 0, i32* %23
br label %45
45: ; preds = %89, %35
%46 = load i32, i32* %23
%47 = load i32, i32* %10
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %92
49: ; preds = %45
%50 = load double*, double** %11
%51 = load i32, i32* %23
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = load double, double* %53
%55 = load double*, double** %14
%56 = getelementptr inbounds double, double* %55, i64 0
%57 = load double, double* %56
%58 = fsub double %54, %57
%59 = load double, double* %25
%60 = call double @fmod(double %58, double %59)
%61 = load double*, double** %12
%62 = load i32, i32* %23
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
store double %60, double* %64
%65 = load double*, double** %12
%66 = load i32, i32* %23
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
%69 = load double, double* %68
%70 = fcmp olt double %69, 0.000000e+00
br i1 %70, label %71, label %79
71: ; preds = %49
%72 = load double, double* %25
%73 = load double*, double** %12
%74 = load i32, i32* %23
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
%77 = load double, double* %76
%78 = fadd double %77, %72
store double %78, double* %76
br label %79
79: ; preds = %71, %49
%80 = load double*, double** %14
%81 = getelementptr inbounds double, double* %80, i64 0
%82 = load double, double* %81
%83 = load double*, double** %12
%84 = load i32, i32* %23
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = fadd double %87, %82
store double %88, double* %86
br label %89
89: ; preds = %79
%90 = load i32, i32* %23
%91 = add nsw i32 %90, 1
store i32 %91, i32* %23
br label %45
92: ; preds = %45
br label %112
93: ; preds = %32, %9
store i32 0, i32* %23
br label %94
94: ; preds = %108, %93
%95 = load i32, i32* %23
%96 = load i32, i32* %10
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %111
98: ; preds = %94
%99 = load double*, double** %11
%100 = load i32, i32* %23
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
%103 = load double, double* %102
%104 = load double*, double** %12
%105 = load i32, i32* %23
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
store double %103, double* %107
br label %108
108: ; preds = %98
%109 = load i32, i32* %23
%110 = add nsw i32 %109, 1
store i32 %110, i32* %23
br label %94
111: ; preds = %94
br label %112
112: ; preds = %111, %92
store i32 0, i32* %23
store i32 0, i32* %20
br label %113
113: ; preds = %219, %112
%114 = load i32, i32* %23
%115 = load i32, i32* %10
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %222
117: ; preds = %113
%118 = load double*, double** %12
%119 = load i32, i32* %23
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
store double %122, double* %24
%123 = load double, double* %24
%124 = load double*, double** %14
%125 = load i32, i32* %20
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %124, i64 %126
%128 = load double, double* %127
%129 = fcmp olt double %123, %128
br i1 %129, label %143, label %130
130: ; preds = %117
%131 = load i32, i32* %20
%132 = load i32, i32* %19
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %168
134: ; preds = %130
%135 = load double*, double** %14
%136 = load i32, i32* %20
%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* %24
%142 = fcmp olt double %140, %141
br i1 %142, label %143, label %168
143: ; preds = %134, %117
store i32 0, i32* %20
%144 = load i32, i32* %13
store i32 %144, i32* %21
br label %145
145: ; preds = %162, %143
%146 = load i32, i32* %20
%147 = load i32, i32* %21
%148 = add nsw i32 %146, %147
%149 = sdiv i32 %148, 2
store i32 %149, i32* %22
%150 = load double, double* %24
%151 = load double*, double** %14
%152 = load i32, i32* %22
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = load double, double* %154
%156 = fcmp olt double %150, %155
br i1 %156, label %157, label %159
157: ; preds = %145
%158 = load i32, i32* %22
store i32 %158, i32* %21
br label %161
159: ; preds = %145
%160 = load i32, i32* %22
store i32 %160, i32* %20
br label %161
161: ; preds = %159, %157
br label %162
162: ; preds = %161
%163 = load i32, i32* %21
%164 = load i32, i32* %20
%165 = add nsw i32 %164, 1
%166 = icmp sgt i32 %163, %165
br i1 %166, label %145, label %167
167: ; preds = %162
br label %168
168: ; preds = %167, %134, %130
%169 = load double, double* %24
%170 = load double*, double** %14
%171 = load i32, i32* %20
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
%174 = load double, double* %173
%175 = fsub double %169, %174
store double %175, double* %25
%176 = load i32, i32* %27
%177 = icmp eq i32 %176, 2
br i1 %177, label %178, label %185
178: ; preds = %168
%179 = load double, double* %24
%180 = load double*, double** %14
%181 = getelementptr inbounds double, double* %180, i64 0
%182 = load double, double* %181
%183 = fcmp olt double %179, %182
br i1 %183, label %184, label %185
184: ; preds = %178
br label %191
185: ; preds = %178, %168
%186 = load double*, double** %18
%187 = load i32, i32* %20
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
br label %191
191: ; preds = %185, %184
%192 = phi double [ 0.000000e+00, %184 ], [ %190, %185 ]
store double %192, double* %26
%193 = load double*, double** %15
%194 = load i32, i32* %20
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %193, i64 %195
%197 = load double, double* %196
%198 = load double, double* %25
%199 = load double*, double** %16
%200 = load i32, i32* %20
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
%203 = load double, double* %202
%204 = load double, double* %25
%205 = load double*, double** %17
%206 = load i32, i32* %20
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %205, i64 %207
%209 = load double, double* %208
%210 = load double, double* %25
%211 = load double, double* %26
%212 = call double @llvm.fmuladd.f64(double %210, double %211, double %209)
%213 = call double @llvm.fmuladd.f64(double %204, double %212, double %203)
%214 = call double @llvm.fmuladd.f64(double %198, double %213, double %197)
%215 = load double*, double** %12
%216 = load i32, i32* %23
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
store double %214, double* %218
br label %219
219: ; preds = %191
%220 = load i32, i32* %23
%221 = add nsw i32 %220, 1
store i32 %221, i32* %23
br label %113
222: ; preds = %113
ret void
}

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