#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*/ error_handler(char *);
int nearest_index(double const, double const *, int);
void linear_vertical_interp(int nx, int ny, int nk1, int nk2,
                            const double *grid1, const double *grid2,
                            double *data1, double *data2) {
  int n1, n2, i, n, k, l;
  double w;
  for (k = 1; k < nk1; k++) {
    if (grid1[k] <= grid1[k - 1])
      error_handler("interp.c: grid1 not monotonic");
  }
  for (k = 1; k < nk2; k++) {
    if (grid2[k] <= grid2[k - 1])
      error_handler("interp.c: grid2 not monotonic");
  }
  if (grid1[0] > grid2[0])
    error_handler("interp.c: grid2 lies outside grid1");
  if (grid1[nk1 - 1] < grid2[nk2 - 1])
    error_handler("interp.c: grid2 lies outside grid1");
  for (k = 0; k < nk2; k++) {
    n = nearest_index(grid2[k], grid1, nk1);
    if (grid1[n] < grid2[k]) {
      w = (grid2[k] - grid1[n]) / (grid1[n + 1] - grid1[n]);
      for (l = 0; l < nx * ny; l++) {
        data2[k * nx * ny + l] = (1. - w) * data1[n * nx * ny + l] +
                                 w * data1[(n + 1) * nx * ny + l];
      }
    } else {
      if (n == 0)
        for (l = 0; l < nx * ny; l++)
          data2[k * nx * ny + l] = data1[n * nx * ny + l];
      else {
        w = (grid2[k] - grid1[n - 1]) / (grid1[n] - grid1[n - 1]);
        for (l = 0; l < nx * ny; l++) {
          data2[k * nx * ny + l] = (1. - w) * data1[(n - 1) * nx * ny + l] +
                                   w * data1[n * nx * ny + l];
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<linear_vertical_interp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119f <linear_vertical_interp+0x7f>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     118c <linear_vertical_interp+0x6c>
lea    0xe81(%rip),%rdi
call   1030 <error_handler@plt>
jmp    1191 <linear_vertical_interp+0x71>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114b <linear_vertical_interp+0x2b>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11fa <linear_vertical_interp+0xda>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     11e7 <linear_vertical_interp+0xc7>
lea    0xe44(%rip),%rdi
call   1030 <error_handler@plt>
jmp    11ec <linear_vertical_interp+0xcc>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a6 <linear_vertical_interp+0x86>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    121c <linear_vertical_interp+0xfc>
lea    0xe2d(%rip),%rdi
call   1030 <error_handler@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1256 <linear_vertical_interp+0x136>
lea    0xdf3(%rip),%rdi
call   1030 <error_handler@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    14e2 <linear_vertical_interp+0x3c2>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <nearest_index@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1382 <linear_vertical_interp+0x262>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    137d <linear_vertical_interp+0x25d>
movsd  0xcf4(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12f2 <linear_vertical_interp+0x1d2>
jmp    14cf <linear_vertical_interp+0x3af>
cmpl   $0x0,-0x30(%rbp)
jne    13ec <linear_vertical_interp+0x2cc>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    13e7 <linear_vertical_interp+0x2c7>
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1393 <linear_vertical_interp+0x273>
jmp    14ca <linear_vertical_interp+0x3aa>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    14c5 <linear_vertical_interp+0x3a5>
movsd  0xbac(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    143a <linear_vertical_interp+0x31a>
jmp    14ca <linear_vertical_interp+0x3aa>
jmp    14cf <linear_vertical_interp+0x3af>
jmp    14d4 <linear_vertical_interp+0x3b4>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    125d <linear_vertical_interp+0x13d>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_vertical_interp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,%r13
mov    %r8,%r10
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %edi,0x10(%rsp)
mov    %edx,0xc(%rsp)
cmp    $0x2,%edx
mov    %r8,0x18(%rsp)
jl     1197 <linear_vertical_interp+0x77>
mov    0xc(%rsp),%r15d
mov    $0x1,%ebx
lea    0xea9(%rip),%r12
jmp    1179 <linear_vertical_interp+0x59>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1197 <linear_vertical_interp+0x77>
movsd  -0x8(%r10,%rbx,8),%xmm0
ucomisd (%r10,%rbx,8),%xmm0
jb     1170 <linear_vertical_interp+0x50>
mov    %r12,%rdi
call   1030 <error_handler@plt>
mov    0x18(%rsp),%r10
jmp    1170 <linear_vertical_interp+0x50>
mov    %r14d,%eax
mov    %rax,0x60(%rsp)
cmp    $0x2,%r14d
jl     11ea <linear_vertical_interp+0xca>
mov    $0x1,%ebx
lea    0xe75(%rip),%r12
jmp    11cb <linear_vertical_interp+0xab>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,0x60(%rsp)
je     11ea <linear_vertical_interp+0xca>
movsd  -0x8(%r13,%rbx,8),%xmm0
ucomisd 0x0(%r13,%rbx,8),%xmm0
jb     11c0 <linear_vertical_interp+0xa0>
mov    %r12,%rdi
call   1030 <error_handler@plt>
mov    0x18(%rsp),%r10
jmp    11c0 <linear_vertical_interp+0xa0>
movsd  (%r10),%xmm0
ucomisd 0x0(%r13),%xmm0
jbe    1208 <linear_vertical_interp+0xe8>
lea    0xe46(%rip),%rdi
call   1030 <error_handler@plt>
mov    0x18(%rsp),%r10
movslq 0xc(%rsp),%rax
movslq %r14d,%rcx
mov    %r13,0xb0(%rsp)
movsd  -0x8(%r13,%rcx,8),%xmm0
ucomisd -0x8(%r10,%rax,8),%xmm0
jbe    1239 <linear_vertical_interp+0x119>
lea    0xe15(%rip),%rdi
call   1030 <error_handler@plt>
mov    0x18(%rsp),%r10
test   %r14d,%r14d
jle    1955 <linear_vertical_interp+0x835>
mov    0xf8(%rsp),%rax
mov    0xf0(%rsp),%rsi
imul   0x10(%rsp),%ebp
lea    (%rax,%rbp,8),%rcx
mov    %rcx,0xa8(%rsp)
lea    (%rsi,%rbp,8),%rcx
mov    %rcx,0x38(%rsp)
mov    %ebp,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,0x30(%rsp)
add    $0xfffffffffffffffc,%rcx
mov    %rcx,0x88(%rsp)
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %rbp,%rdx
neg    %rdx
mov    %rdx,0x50(%rsp)
mov    %ecx,%edx
and    $0x3,%edx
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x70(%rsp)
mov    %ebp,%ecx
and    $0x3,%ecx
mov    %rcx,0x98(%rsp)
lea    0x10(%rsi),%rcx
mov    %rcx,0x28(%rsp)
lea    0x10(%rax),%rcx
mov    %rcx,0x58(%rsp)
lea    0x8(%rax),%rcx
mov    %rcx,0xa0(%rsp)
lea    0x8(%rsi),%rcx
mov    %rcx,0x48(%rsp)
mov    %rdx,0x80(%rsp)
shl    $0x5,%rdx
mov    %rdx,0x78(%rsp)
lea    0x70(%rax),%rcx
mov    %rcx,0x68(%rsp)
add    $0x18,%rax
mov    %rax,0x90(%rsp)
xor    %r11d,%r11d
xor    %r15d,%r15d
jmp    1322 <linear_vertical_interp+0x202>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
add    %ebp,%r11d
cmp    0x60(%rsp),%r15
je     1955 <linear_vertical_interp+0x835>
mov    %r11,%rbx
movslq %r11d,%rcx
mov    0xa0(%rsp),%rax
lea    (%rax,%rcx,8),%r13
mov    0x58(%rsp),%rax
mov    %rcx,0x20(%rsp)
lea    (%rax,%rcx,8),%r12
mov    %r15d,%eax
imul   %ebp,%eax
cltq
mov    0xf8(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x10(%rsp)
mov    0xa8(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0x40(%rsp)
mov    %rbp,%r14
mov    0xb0(%rsp),%rbp
movsd  0x0(%rbp,%r15,8),%xmm0
mov    %r10,%rdi
mov    0xc(%rsp),%esi
call   1040 <nearest_index@plt>
mov    0x18(%rsp),%r10
movslq %eax,%rcx
movsd  (%r10,%rcx,8),%xmm1
movsd  0x0(%rbp,%r15,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    14b0 <linear_vertical_interp+0x390>
test   %r14d,%r14d
mov    0xf0(%rsp),%rdi
mov    %rbx,%r11
mov    %r14,%rbp
jle    1310 <linear_vertical_interp+0x1f0>
subsd  %xmm1,%xmm0
movsd  0x8(%r10,%rcx,8),%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
mov    %ebp,%ecx
imul   %eax,%ecx
add    $0x1,%eax
imul   %ebp,%eax
movsd  0xc1a(%rip),%xmm1
subsd  %xmm0,%xmm1
movslq %ecx,%r8
movslq %eax,%r9
cmp    $0x4,%ebp
jae    15dc <linear_vertical_interp+0x4bc>
xor    %esi,%esi
mov    %rsi,%rdx
test   $0x1,%bpl
je     1441 <linear_vertical_interp+0x321>
mov    %ebp,%eax
imul   %r15d,%eax
cltq
lea    (%rsi,%r8,1),%rcx
lea    (%rsi,%r9,1),%rdx
movsd  (%rdi,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rdi,%rcx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
add    %rsi,%rax
mov    0xf8(%rsp),%rcx
movsd  %xmm3,(%rcx,%rax,8)
mov    %rsi,%rdx
or     $0x1,%rdx
not    %rsi
cmp    0x50(%rsp),%rsi
je     1310 <linear_vertical_interp+0x1f0>
mov    0x48(%rsp),%rcx
lea    (%rcx,%r9,8),%rax
lea    (%rcx,%r8,8),%rcx
nopl   0x0(%rax)
movsd  -0x8(%rax,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  -0x8(%rcx,%rdx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,-0x8(%r13,%rdx,8)
movsd  (%rax,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rcx,%rdx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x0(%r13,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rbp
jne    1460 <linear_vertical_interp+0x340>
jmp    1310 <linear_vertical_interp+0x1f0>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rbp
test   %eax,%eax
je     1508 <linear_vertical_interp+0x3e8>
test   %ebp,%ebp
mov    0xf0(%rsp),%r14
mov    %rbx,%r11
jle    1310 <linear_vertical_interp+0x1f0>
lea    -0x1(%rax),%edx
movsd  -0x8(%r10,%rcx,8),%xmm2
subsd  %xmm2,%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
imul   %ebp,%edx
imul   %ebp,%eax
movsd  0xb12(%rip),%xmm1
subsd  %xmm0,%xmm1
movslq %edx,%r8
movslq %eax,%r9
cmp    $0x4,%ebp
jae    16bd <linear_vertical_interp+0x59d>
xor    %esi,%esi
jmp    17c6 <linear_vertical_interp+0x6a6>
test   %ebp,%ebp
mov    0xf0(%rsp),%rdi
mov    %rbx,%r11
jle    1310 <linear_vertical_interp+0x1f0>
cmp    $0x4,%ebp
jb     153b <linear_vertical_interp+0x41b>
mov    0x10(%rsp),%rax
cmp    0x38(%rsp),%rax
jae    17a1 <linear_vertical_interp+0x681>
cmp    %rdi,0x40(%rsp)
jbe    17a1 <linear_vertical_interp+0x681>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %rbp,%rcx
mov    0x98(%rsp),%rsi
test   %rsi,%rsi
je     1584 <linear_vertical_interp+0x464>
mov    0xf8(%rsp),%rdx
mov    0x20(%rsp),%rbx
lea    (%rdx,%rbx,8),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    1570 <linear_vertical_interp+0x450>
cmp    $0x3,%rcx
jb     1310 <linear_vertical_interp+0x1f0>
mov    0x90(%rsp),%rcx
mov    0x20(%rsp),%rdx
lea    (%rcx,%rdx,8),%rcx
nop
movsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x18(%rcx,%rax,8)
movsd  0x8(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x10(%rcx,%rax,8)
movsd  0x10(%rdi,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rax,8)
movsd  0x18(%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
add    $0x4,%rax
cmp    %rax,%rbp
jne    15a0 <linear_vertical_interp+0x480>
jmp    1310 <linear_vertical_interp+0x1f0>
lea    (%rdi,%r9,8),%rdx
mov    0x38(%rsp),%rax
lea    (%rax,%r9,8),%rsi
lea    (%rdi,%r8,8),%rdi
lea    (%rax,%r8,8),%rcx
mov    0x10(%rsp),%r14
cmp    %rsi,%r14
setb   %sil
mov    0x40(%rsp),%rbx
cmp    %rbx,%rdx
setb   %al
cmp    %rcx,%r14
setb   %dl
cmp    %rbx,%rdi
setb   %dil
test   %al,%sil
jne    1792 <linear_vertical_interp+0x672>
mov    $0x0,%esi
and    %dil,%dl
mov    0xf0(%rsp),%rdi
jne    13fb <linear_vertical_interp+0x2db>
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
mov    0x28(%rsp),%rax
lea    (%rax,%r8,8),%rdx
lea    (%rax,%r9,8),%rsi
xor    %edi,%edi
mov    0x30(%rsp),%rax
nopl   0x0(%rax,%rax,1)
movupd -0x10(%rdx,%rdi,8),%xmm4
movupd (%rdx,%rdi,8),%xmm5
movupd -0x10(%rsi,%rdi,8),%xmm6
movupd (%rsi,%rdi,8),%xmm7
mulpd  %xmm2,%xmm6
mulpd  %xmm2,%xmm7
mulpd  %xmm3,%xmm4
addpd  %xmm6,%xmm4
mulpd  %xmm3,%xmm5
addpd  %xmm7,%xmm5
movupd %xmm4,-0x10(%r12,%rdi,8)
movupd %xmm5,(%r12,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rax
jne    1660 <linear_vertical_interp+0x540>
mov    %rax,%rsi
cmp    %rbp,%rax
mov    0xf0(%rsp),%rdi
je     1310 <linear_vertical_interp+0x1f0>
jmp    13fb <linear_vertical_interp+0x2db>
lea    (%r14,%r9,8),%rdx
mov    0x38(%rsp),%rax
lea    (%rax,%r9,8),%rsi
lea    (%r14,%r8,8),%rdi
lea    (%rax,%r8,8),%rcx
mov    0x10(%rsp),%r14
cmp    %rsi,%r14
setb   %sil
mov    0x40(%rsp),%rbx
cmp    %rbx,%rdx
setb   %al
cmp    %rcx,%r14
setb   %dl
cmp    %rbx,%rdi
setb   %dil
test   %al,%sil
jne    17bc <linear_vertical_interp+0x69c>
mov    $0x0,%esi
and    %dil,%dl
mov    0xf0(%rsp),%r14
jne    17c6 <linear_vertical_interp+0x6a6>
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
mov    0x28(%rsp),%rax
lea    (%rax,%r8,8),%rdx
lea    (%rax,%r9,8),%rsi
xor    %edi,%edi
mov    0x30(%rsp),%rax
nopl   0x0(%rax)
movupd -0x10(%rdx,%rdi,8),%xmm4
movupd (%rdx,%rdi,8),%xmm5
movupd -0x10(%rsi,%rdi,8),%xmm6
movupd (%rsi,%rdi,8),%xmm7
mulpd  %xmm2,%xmm6
mulpd  %xmm2,%xmm7
mulpd  %xmm3,%xmm4
addpd  %xmm6,%xmm4
mulpd  %xmm3,%xmm5
addpd  %xmm7,%xmm5
movupd %xmm4,-0x10(%r12,%rdi,8)
movupd %xmm5,(%r12,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rax
jne    1740 <linear_vertical_interp+0x620>
mov    %rax,%rsi
cmp    %rbp,%rax
je     1310 <linear_vertical_interp+0x1f0>
jmp    17c6 <linear_vertical_interp+0x6a6>
xor    %esi,%esi
mov    0xf0(%rsp),%rdi
jmp    13fb <linear_vertical_interp+0x2db>
cmpq   $0xc,0x88(%rsp)
mov    0x78(%rsp),%rsi
jae    187a <linear_vertical_interp+0x75a>
xor    %eax,%eax
jmp    18ec <linear_vertical_interp+0x7cc>
xor    %esi,%esi
mov    0xf0(%rsp),%r14
mov    %rsi,%rdx
test   $0x1,%bpl
je     180e <linear_vertical_interp+0x6ee>
mov    %ebp,%eax
imul   %r15d,%eax
cltq
lea    (%rsi,%r8,1),%rcx
lea    (%rsi,%r9,1),%rdx
movsd  (%r14,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%r14,%rcx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
add    %rsi,%rax
mov    0xf8(%rsp),%rcx
movsd  %xmm3,(%rcx,%rax,8)
mov    %rsi,%rdx
or     $0x1,%rdx
not    %rsi
cmp    0x50(%rsp),%rsi
je     1310 <linear_vertical_interp+0x1f0>
mov    0x48(%rsp),%rcx
lea    (%rcx,%r9,8),%rax
lea    (%rcx,%r8,8),%rcx
nopl   0x0(%rax)
movsd  -0x8(%rax,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  -0x8(%rcx,%rdx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,-0x8(%r13,%rdx,8)
movsd  (%rax,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rcx,%rdx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x0(%r13,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rbp
jne    1830 <linear_vertical_interp+0x710>
jmp    1310 <linear_vertical_interp+0x1f0>
mov    0x68(%rsp),%rax
mov    0x20(%rsp),%rcx
lea    (%rax,%rcx,8),%rcx
mov    0x70(%rsp),%rdx
xor    %eax,%eax
nop
movups (%rdi,%rax,8),%xmm0
movups 0x10(%rdi,%rax,8),%xmm1
movups %xmm0,-0x70(%rcx,%rax,8)
movups %xmm1,-0x60(%rcx,%rax,8)
movups 0x20(%rdi,%rax,8),%xmm0
movups 0x30(%rdi,%rax,8),%xmm1
movups %xmm0,-0x50(%rcx,%rax,8)
movups %xmm1,-0x40(%rcx,%rax,8)
movups 0x40(%rdi,%rax,8),%xmm0
movups 0x50(%rdi,%rax,8),%xmm1
movups %xmm0,-0x30(%rcx,%rax,8)
movups %xmm1,-0x20(%rcx,%rax,8)
movupd 0x60(%rdi,%rax,8),%xmm0
movupd 0x70(%rdi,%rax,8),%xmm1
movupd %xmm0,-0x10(%rcx,%rax,8)
movupd %xmm1,(%rcx,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rdx
jne    1890 <linear_vertical_interp+0x770>
cmpq   $0x0,0x80(%rsp)
je     193f <linear_vertical_interp+0x81f>
mov    0x20(%rsp),%rcx
add    %rax,%rcx
mov    0x58(%rsp),%rdx
lea    (%rdx,%rcx,8),%rcx
mov    0x28(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd -0x10(%rax,%rdx,1),%xmm0
movupd (%rax,%rdx,1),%xmm1
movupd %xmm0,-0x10(%rcx,%rdx,1)
movupd %xmm1,(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rsi
jne    1920 <linear_vertical_interp+0x800>
mov    0x30(%rsp),%rcx
mov    %rcx,%rax
cmp    %rbp,%rcx
je     1310 <linear_vertical_interp+0x1f0>
jmp    153d <linear_vertical_interp+0x41d>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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