void vert_interp_lev3d(int gridsize, double missval, double *vardata1,
                       double *vardata2, int nlev2, int *lev_idx1,
                       int *lev_idx2, double *lev_wgt1, double *lev_wgt2) {
  int i, ilev;
  int idx1, idx2;
  int offset;
  double wgt1, wgt2;
  double w1, w2;
  double var1L1, var1L2, *var2;
  for (ilev = 0; ilev < nlev2; ilev++) {
    offset = ilev * gridsize;
    var2 = vardata2 + offset;
    for (i = 0; i < gridsize; i++) {
      idx1 = lev_idx1[offset + i];
      idx2 = lev_idx2[offset + i];
      wgt1 = lev_wgt1[offset + i];
      wgt2 = lev_wgt2[offset + i];
      var1L1 = *(vardata1 + idx1);
      var1L2 = *(vardata1 + idx2);
      w1 = wgt1;
      w2 = wgt2;
      if ((((var1L1) != (var1L1)) || ((missval) != (missval))
               ? (((var1L1) != (var1L1)) && ((missval) != (missval)) ? 1 : 0)
               : !(var1L1 < missval || missval < var1L1)))
        w1 = 0;
      if ((((var1L2) != (var1L2)) || ((missval) != (missval))
               ? (((var1L2) != (var1L2)) && ((missval) != (missval)) ? 1 : 0)
               : !(var1L2 < missval || missval < var1L2)))
        w2 = 0;
      if ((!(w1 < 0 || 0 < w1)) && (!(w2 < 0 || 0 < w2))) {
        var2[i] = missval;
      } else if ((!(w1 < 0 || 0 < w1))) {
        if (w2 >= 0.5)
          var2[i] = var1L2;
        else
          var2[i] = missval;
      } else if ((!(w2 < 0 || 0 < w2))) {
        if (w1 >= 0.5)
          var2[i] = var1L1;
        else
          var2[i] = missval;
      } else {
        var2[i] = var1L1 * w1 + var1L2 * w2;
      }
    }
  }
}


x86 assembly (clang, -O0):
<vert_interp_lev3d>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14f0 <vert_interp_lev3d+0x3f0>
mov    -0x40(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14dd <vert_interp_lev3d+0x3dd>
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x18(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jne    122b <vert_interp_lev3d+0x12b>
jp     122b <vert_interp_lev3d+0x12b>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    122b <vert_interp_lev3d+0x12b>
jp     122b <vert_interp_lev3d+0x12b>
jmp    127f <vert_interp_lev3d+0x17f>
movsd  -0x78(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jne    1246 <vert_interp_lev3d+0x146>
jp     1246 <vert_interp_lev3d+0x146>
jmp    1270 <vert_interp_lev3d+0x170>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1261 <vert_interp_lev3d+0x161>
jp     1261 <vert_interp_lev3d+0x161>
jmp    1270 <vert_interp_lev3d+0x170>
mov    $0x1,%al
test   $0x1,%al
jne    12a7 <vert_interp_lev3d+0x1a7>
jmp    12af <vert_interp_lev3d+0x1af>
xor    %eax,%eax
test   $0x1,%al
jne    12a7 <vert_interp_lev3d+0x1a7>
jmp    12af <vert_interp_lev3d+0x1af>
movsd  -0x78(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12af <vert_interp_lev3d+0x1af>
movsd  -0x10(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12af <vert_interp_lev3d+0x1af>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jne    12e0 <vert_interp_lev3d+0x1e0>
jp     12e0 <vert_interp_lev3d+0x1e0>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    12e0 <vert_interp_lev3d+0x1e0>
jp     12e0 <vert_interp_lev3d+0x1e0>
jmp    1334 <vert_interp_lev3d+0x234>
movsd  -0x80(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jne    12fb <vert_interp_lev3d+0x1fb>
jp     12fb <vert_interp_lev3d+0x1fb>
jmp    1325 <vert_interp_lev3d+0x225>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1316 <vert_interp_lev3d+0x216>
jp     1316 <vert_interp_lev3d+0x216>
jmp    1325 <vert_interp_lev3d+0x225>
mov    $0x1,%al
test   $0x1,%al
jne    135c <vert_interp_lev3d+0x25c>
jmp    1364 <vert_interp_lev3d+0x264>
xor    %eax,%eax
test   $0x1,%al
jne    135c <vert_interp_lev3d+0x25c>
jmp    1364 <vert_interp_lev3d+0x264>
movsd  -0x80(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1364 <vert_interp_lev3d+0x264>
movsd  -0x10(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1364 <vert_interp_lev3d+0x264>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
ja     13be <vert_interp_lev3d+0x2be>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     13be <vert_interp_lev3d+0x2be>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
ja     13be <vert_interp_lev3d+0x2be>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     13be <vert_interp_lev3d+0x2be>
movsd  -0x10(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14ca <vert_interp_lev3d+0x3ca>
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
ja     1429 <vert_interp_lev3d+0x329>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1429 <vert_interp_lev3d+0x329>
movsd  -0x70(%rbp),%xmm0
movsd  0xc15(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     140f <vert_interp_lev3d+0x30f>
movsd  -0x80(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1424 <vert_interp_lev3d+0x324>
movsd  -0x10(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14c5 <vert_interp_lev3d+0x3c5>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
ja     1494 <vert_interp_lev3d+0x394>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1494 <vert_interp_lev3d+0x394>
movsd  -0x68(%rbp),%xmm0
movsd  0xbaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     147a <vert_interp_lev3d+0x37a>
movsd  -0x78(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    148f <vert_interp_lev3d+0x38f>
movsd  -0x10(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14c0 <vert_interp_lev3d+0x3c0>
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14c5 <vert_interp_lev3d+0x3c5>
jmp    14ca <vert_interp_lev3d+0x3ca>
jmp    14cf <vert_interp_lev3d+0x3cf>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1162 <vert_interp_lev3d+0x62>
jmp    14e2 <vert_interp_lev3d+0x3e2>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    112f <vert_interp_lev3d+0x2f>
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vert_interp_lev3d>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %ecx,%ecx
jle    1230 <vert_interp_lev3d+0x130>
mov    0x38(%rsp),%r10
mov    0x30(%rsp),%rax
movslq %edi,%r11
mov    %ecx,%r14d
mov    %r11d,%r13d
lea    0x0(,%r11,4),%r15
shl    $0x3,%r11
shl    $0x2,%r13
xor    %r12d,%r12d
xorpd  %xmm1,%xmm1
movsd  0xebd(%rip),%xmm2
jmp    116c <vert_interp_lev3d+0x6c>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12
add    %r15,%r8
add    %r15,%r9
add    %r11,%rax
add    %r11,%r10
add    %r11,%rdx
cmp    %r14,%r12
je     1230 <vert_interp_lev3d+0x130>
test   %edi,%edi
jle    1150 <vert_interp_lev3d+0x50>
xor    %ecx,%ecx
jmp    118e <vert_interp_lev3d+0x8e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,(%rdx,%rcx,2)
add    $0x4,%rcx
cmp    %rcx,%r13
je     1150 <vert_interp_lev3d+0x50>
movslq (%r8,%rcx,1),%rbx
movsd  (%rax,%rcx,2),%xmm4
movsd  (%rsi,%rbx,8),%xmm3
ucomisd %xmm3,%xmm0
jp     1214 <vert_interp_lev3d+0x114>
ucomisd %xmm0,%xmm3
jne    11ac <vert_interp_lev3d+0xac>
xorpd  %xmm4,%xmm4
movslq (%r9,%rcx,1),%rbx
movsd  (%r10,%rcx,2),%xmm6
movsd  (%rsi,%rbx,8),%xmm5
ucomisd %xmm0,%xmm5
jp     1222 <vert_interp_lev3d+0x122>
jne    11c7 <vert_interp_lev3d+0xc7>
xorpd  %xmm6,%xmm6
ucomisd %xmm1,%xmm4
jne    11d9 <vert_interp_lev3d+0xd9>
ucomisd %xmm6,%xmm1
ja     11d9 <vert_interp_lev3d+0xd9>
ucomisd %xmm1,%xmm6
jbe    1180 <vert_interp_lev3d+0x80>
ucomisd %xmm1,%xmm4
je     11f3 <vert_interp_lev3d+0xf3>
ucomisd %xmm1,%xmm6
je     1200 <vert_interp_lev3d+0x100>
mulsd  %xmm6,%xmm5
mulsd  %xmm4,%xmm3
addsd  %xmm5,%xmm3
jmp    120a <vert_interp_lev3d+0x10a>
ucomisd %xmm2,%xmm6
jb     1180 <vert_interp_lev3d+0x80>
movsd  %xmm5,(%rdx,%rcx,2)
jmp    1185 <vert_interp_lev3d+0x85>
ucomisd %xmm2,%xmm4
jb     1180 <vert_interp_lev3d+0x80>
movsd  %xmm3,(%rdx,%rcx,2)
jmp    1185 <vert_interp_lev3d+0x85>
ucomisd %xmm0,%xmm0
jnp    11ac <vert_interp_lev3d+0xac>
ucomisd %xmm3,%xmm3
jp     11a8 <vert_interp_lev3d+0xa8>
jmp    11ac <vert_interp_lev3d+0xac>
ucomisd %xmm0,%xmm0
jnp    11c7 <vert_interp_lev3d+0xc7>
ucomisd %xmm5,%xmm5
jp     11c3 <vert_interp_lev3d+0xc3>
jmp    11c7 <vert_interp_lev3d+0xc7>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vert_interp_lev3d(i32 %0, double %1, double* nocapture %2, double* nocapture writeonly %3, i32 %4, i32* nocapture %5, i32* nocapture %6, double* nocapture %7, double* nocapture %8) {
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %86
11: ; preds = %9
%12 = icmp sgt i32 %0, 0
%13 = fcmp uno double %1, 0.000000e+00
%14 = sext i32 %0 to i64
%15 = zext i32 %4 to i64
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %11, %83
%18 = phi i64 [ 0, %11 ], [ %84, %83 ]
%19 = mul nsw i64 %18, %14
%20 = getelementptr inbounds double, double* %3, i64 %19
br i1 %12, label %21, label %83
21: ; preds = %17, %80
%22 = phi i64 [ %81, %80 ], [ 0, %17 ]
%23 = add nsw i64 %22, %19
%24 = getelementptr inbounds i32, i32* %5, i64 %23
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %6, i64 %23
%27 = load i32, i32* %26
%28 = getelementptr inbounds double, double* %7, i64 %23
%29 = load double, double* %28
%30 = getelementptr inbounds double, double* %8, i64 %23
%31 = load double, double* %30
%32 = sext i32 %25 to i64
%33 = getelementptr inbounds double, double* %2, i64 %32
%34 = load double, double* %33
%35 = sext i32 %27 to i64
%36 = getelementptr inbounds double, double* %2, i64 %35
%37 = load double, double* %36
%38 = fcmp uno double %34, %1
br i1 %38, label %39, label %42
39: ; preds = %21
%40 = fcmp uno double %34, 0.000000e+00
%41 = and i1 %13, %40
br i1 %41, label %44, label %45
42: ; preds = %21
%43 = fcmp ueq double %34, %1
br i1 %43, label %44, label %45
44: ; preds = %42, %39
br label %45
45: ; preds = %39, %44, %42
%46 = phi double [ 0.000000e+00, %44 ], [ %29, %39 ], [ %29, %42 ]
%47 = fcmp uno double %37, %1
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = fcmp uno double %37, 0.000000e+00
%50 = and i1 %13, %49
br i1 %50, label %53, label %54
51: ; preds = %45
%52 = fcmp ueq double %37, %1
br i1 %52, label %53, label %54
53: ; preds = %51, %48
br label %54
54: ; preds = %48, %53, %51
%55 = phi double [ 0.000000e+00, %53 ], [ %31, %48 ], [ %31, %51 ]
%56 = fcmp one double %46, 0.000000e+00
%57 = fcmp olt double %55, 0.000000e+00
%58 = select i1 %56, i1 true, i1 %57
%59 = fcmp ogt double %55, 0.000000e+00
%60 = select i1 %58, i1 true, i1 %59
br i1 %60, label %63, label %61
61: ; preds = %54
%62 = getelementptr inbounds double, double* %20, i64 %22
store double %1, double* %62
br label %80
63: ; preds = %54
br i1 %56, label %69, label %64
64: ; preds = %63
%65 = fcmp ult double %55, 5.000000e-01
%66 = getelementptr inbounds double, double* %20, i64 %22
br i1 %65, label %68, label %67
67: ; preds = %64
store double %37, double* %66
br label %80
68: ; preds = %64
store double %1, double* %66
br label %80
69: ; preds = %63
%70 = fcmp ueq double %55, 0.000000e+00
br i1 %70, label %71, label %76
71: ; preds = %69
%72 = fcmp ult double %46, 5.000000e-01
%73 = getelementptr inbounds double, double* %20, i64 %22
br i1 %72, label %75, label %74
74: ; preds = %71
store double %34, double* %73
br label %80
75: ; preds = %71
store double %1, double* %73
br label %80
76: ; preds = %69
%77 = fmul double %37, %55
%78 = tail call double @llvm.fmuladd.f64(double %34, double %46, double %77)
%79 = getelementptr inbounds double, double* %20, i64 %22
store double %78, double* %79
br label %80
80: ; preds = %61, %76, %75, %74, %67, %68
%81 = add nuw nsw i64 %22, 1
%82 = icmp eq i64 %81, %16
br i1 %82, label %83, label %21
83: ; preds = %80, %17
%84 = add nuw nsw i64 %18, 1
%85 = icmp eq i64 %84, %15
br i1 %85, label %86, label %17
86: ; preds = %83, %9
ret void
}