#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 */
float distance_to_hslice(int, int, int, int, int, float, int *);
float distance_to_vslice(int, int, int, int, int, float, float, float, float,
                         int *);
scalar_t__ vis5d_enable_graphics(int, int, int, int);
int /*<<< orphan*/ vis5d_get_chslice(int, int, float *);
int /*<<< orphan*/ vis5d_get_ctx_numvars(int, int *);
int /*<<< orphan*/ vis5d_get_cvslice(int, int, float *, float *, float *,
                                     float *);
int /*<<< orphan*/ vis5d_get_hslice(int, int, float *, float *, float *,
                                    float *);
int /*<<< orphan*/ vis5d_get_hstreamslice(int, int, float *, float *);
int /*<<< orphan*/ vis5d_get_hwindslice(int, int, float *, float *, float *);
int /*<<< orphan*/ vis5d_get_num_of_ctxs_in_display(int, int *, int *);
int /*<<< orphan*/ vis5d_get_size(int, int *, int *, int *, int *, int *, int *,
                                  int *, int *);
int /*<<< orphan*/ vis5d_get_vslice(int, int, float *, float *, float *,
                                    float *, float *, float *, float *);
int /*<<< orphan*/ vis5d_get_vstreamslice(int, int, float *, float *, float *,
                                          float *, float *);
int /*<<< orphan*/ vis5d_get_vwindslice(int, int, float *, float *, float *,
                                        float *, float *, float *);
int /*<<< orphan*/ vis5d_get_wind_vars(int, int *, int *, int *, int *, int *,
                                       int *, int *, int *, int *, int *, int *,
                                       int *, int *, int *, int *, int *, int *,
                                       int *);
int find_nearest_slice(int index, int curx, int cury, int time, int *contype,
                       int *contour, int *corner, int *thecontext) {
  float dist, neardist;
  int var, corn, w;
  int nearctx, yo;
  float interval, low, high, level;
  float row0, col0, row1, col1;
  float density, scale;
  int Uvar, Vvar, Wvar, Uvar2, Vvar2, Wvar2, TrajU, TrajV, TrajW;
  int NumVars;
  int Nr, Nc, Nl[200], LowLev[200], MaxNl, MaxNlVar, WindNl, WindLow;
  int howmany, whichones[20];
  int owner[9];
  vis5d_get_num_of_ctxs_in_display(index, &howmany, whichones);
  neardist = 15.0 * 15.0;
  *contype = *contour = *corner = *thecontext = -1;
  nearctx = -1;
  for (yo = 0; yo < howmany; yo++) {
    int vindex = whichones[yo];
    vis5d_get_ctx_numvars(vindex, &NumVars);
    vis5d_get_size(vindex, &Nr, &Nc, Nl, LowLev, &MaxNl, &MaxNlVar, &WindNl,
                   &WindLow);
    for (var = 0; var < NumVars; var++) {
      if (vis5d_enable_graphics(vindex, 1, var, 3)) {
        vis5d_get_hslice(vindex, var, &interval, &low, &high, &level);
        dist = distance_to_hslice(index, curx, cury, time, var, level, &corn);
        if (dist < neardist) {
          *thecontext = vindex;
          neardist = dist;
          *contype = 1;
          *contour = var;
          *corner = corn;
        }
      }
    }
    for (var = 0; var < NumVars; var++) {
      if (vis5d_enable_graphics(vindex, 3, var, 3)) {
        vis5d_get_chslice(vindex, var, &level);
        dist = distance_to_hslice(index, curx, cury, time, var, level, &corn);
        if (dist < neardist) {
          *thecontext = vindex;
          neardist = dist;
          *contype = 3;
          *contour = var;
          *corner = corn;
        }
      }
    }
    for (var = 0; var < NumVars; var++) {
      if (vis5d_enable_graphics(vindex, 2, var, 3)) {
        vis5d_get_vslice(vindex, var, &interval, &low, &high, &row0, &col0,
                         &row1, &col1);
        dist = distance_to_vslice(index, curx, cury, time, var, row0, col0,
                                  row1, col1, &corn);
        if (dist < neardist) {
          neardist = dist;
          *thecontext = vindex;
          *contype = 2;
          *contour = var;
          *corner = corn;
        }
      }
    }
    for (var = 0; var < NumVars; var++) {
      if (vis5d_enable_graphics(vindex, 4, var, 3)) {
        vis5d_get_cvslice(vindex, var, &row0, &col0, &row1, &col1);
        dist = distance_to_vslice(index, curx, cury, time, var, row0, col0,
                                  row1, col1, &corn);
        if (dist < neardist) {
          neardist = dist;
          *contype = 4;
          *thecontext = vindex;
          *contour = var;
          *corner = corn;
        }
      }
    }
    vis5d_get_wind_vars(index, &owner[0], &Uvar, &owner[1], &Vvar, &owner[2],
                        &Wvar, &owner[3], &Uvar2, &owner[4], &Vvar2, &owner[5],
                        &Wvar2, &owner[6], &TrajU, &owner[7], &TrajV, &owner[8],
                        &TrajW);
    for (w = 0; w < 2; w++) {
      int wner = w == 0 ? owner[0] : owner[3];
      if (wner == vindex && vis5d_enable_graphics(vindex, 6, w, 3)) {
        int uvar = w == 0 ? Uvar : Uvar2;
        vis5d_get_hwindslice(index, w, &density, &scale, &level);
        dist = distance_to_hslice(index, curx, cury, time, uvar, level, &corn);
        if (dist < neardist) {
          neardist = dist;
          *contype = 6;
          *thecontext = vindex;
          *contour = w;
          *corner = corn;
        }
      }
    }
    for (w = 0; w < 2; w++) {
      int wner = w == 0 ? owner[0] : owner[3];
      if (wner == vindex && vis5d_enable_graphics(vindex, 7, w, 3)) {
        int uvar = w == 0 ? Uvar : Uvar2;
        vis5d_get_vwindslice(index, w, &density, &scale, &row0, &col0, &row1,
                             &col1);
        dist = distance_to_vslice(index, curx, cury, time, uvar, row0, col0,
                                  row1, col1, &corn);
        if (dist < neardist) {
          neardist = dist;
          *contype = 7;
          *contour = w;
          *thecontext = vindex;
          *corner = corn;
        }
      }
    }
    for (w = 0; w < 2; w++) {
      int wner = w == 0 ? owner[0] : owner[3];
      if (wner == vindex && vis5d_enable_graphics(vindex, 8, w, 3)) {
        int uvar = w == 0 ? Uvar : Uvar2;
        vis5d_get_hstreamslice(index, w, &density, &level);
        dist = distance_to_hslice(index, curx, cury, time, uvar, level, &corn);
        if (dist < neardist) {
          neardist = dist;
          *contype = 8;
          *contour = w;
          *thecontext = vindex;
          *corner = corn;
        }
      }
    }
    for (w = 0; w < 2; w++) {
      int wner = w == 0 ? owner[0] : owner[3];
      if (wner == vindex && vis5d_enable_graphics(vindex, 9, w, 3)) {
        int uvar = w == 0 ? Uvar : Uvar2;
        vis5d_get_vstreamslice(index, w, &density, &row0, &col0, &row1, &col1);
        dist = distance_to_vslice(index, curx, cury, time, uvar, row0, col0,
                                  row1, col1, &corn);
        if (dist < neardist) {
          neardist = dist;
          *contype = 9;
          *thecontext = vindex;
          *contour = w;
          *corner = corn;
        }
      }
    }
  }
  if (*contype != -1) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<find_nearest_slice>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x868,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
mov    -0x30(%rbp),%edi
lea    -0x780(%rbp),%rdx
lea    -0x724(%rbp),%rsi
call   1030 <vis5d_get_num_of_ctxs_in_display@plt>
movss  0xdc2(%rip),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x50(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x48(%rbp),%rax
movl   $0xffffffff,(%rax)
movl   $0xffffffff,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x724(%rbp),%eax
jge    1d73 <find_nearest_slice+0xb83>
movslq -0x6c(%rbp),%rax
mov    -0x780(%rbp,%rax,4),%eax
mov    %eax,-0x7b4(%rbp)
mov    -0x7b4(%rbp),%edi
lea    -0xbc(%rbp),%rsi
call   1070 <vis5d_get_ctx_numvars@plt>
mov    -0x7b4(%rbp),%edi
lea    -0x3f0(%rbp),%rcx
lea    -0x710(%rbp),%r8
lea    -0xc0(%rbp),%rsi
lea    -0xc4(%rbp),%rdx
lea    -0x714(%rbp),%r9
lea    -0x718(%rbp),%r11
lea    -0x71c(%rbp),%r10
lea    -0x720(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10a0 <vis5d_get_size@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    13d2 <find_nearest_slice+0x1e2>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%edx
mov    $0x1,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     13bf <find_nearest_slice+0x1cf>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    -0x74(%rbp),%rcx
lea    -0x78(%rbp),%r8
lea    -0x7c(%rbp),%r9
call   1040 <vis5d_get_hslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
movss  -0x7c(%rbp),%xmm0
lea    -0x60(%rbp),%r9
call   10c0 <distance_to_hslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    13ba <find_nearest_slice+0x1ca>
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    13bf <find_nearest_slice+0x1cf>
jmp    13c4 <find_nearest_slice+0x1d4>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1303 <find_nearest_slice+0x113>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    1499 <find_nearest_slice+0x2a9>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%edx
mov    $0x3,%ecx
mov    %ecx,%esi
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1486 <find_nearest_slice+0x296>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%esi
lea    -0x7c(%rbp),%rdx
call   1090 <vis5d_get_chslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
movss  -0x7c(%rbp),%xmm0
lea    -0x60(%rbp),%r9
call   10c0 <distance_to_hslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1481 <find_nearest_slice+0x291>
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1486 <find_nearest_slice+0x296>
jmp    148b <find_nearest_slice+0x29b>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    13d9 <find_nearest_slice+0x1e9>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    15aa <find_nearest_slice+0x3ba>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%edx
mov    $0x2,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1597 <find_nearest_slice+0x3a7>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    -0x74(%rbp),%rcx
lea    -0x78(%rbp),%r8
lea    -0x80(%rbp),%r9
lea    -0x84(%rbp),%r11
lea    -0x88(%rbp),%r10
lea    -0x8c(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10e0 <vis5d_get_vslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
movss  -0x80(%rbp),%xmm0
movss  -0x84(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm2
ff
movss  -0x8c(%rbp),%xmm3
ff
lea    -0x60(%rbp),%r9
call   10f0 <distance_to_vslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1592 <find_nearest_slice+0x3a2>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1597 <find_nearest_slice+0x3a7>
jmp    159c <find_nearest_slice+0x3ac>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    14a0 <find_nearest_slice+0x2b0>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    16a1 <find_nearest_slice+0x4b1>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%edx
mov    $0x4,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     168e <find_nearest_slice+0x49e>
mov    -0x7b4(%rbp),%edi
mov    -0x5c(%rbp),%esi
lea    -0x80(%rbp),%rdx
lea    -0x84(%rbp),%rcx
lea    -0x88(%rbp),%r8
lea    -0x8c(%rbp),%r9
call   10d0 <vis5d_get_cvslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
movss  -0x80(%rbp),%xmm0
movss  -0x84(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm2
ff
movss  -0x8c(%rbp),%xmm3
ff
lea    -0x60(%rbp),%r9
call   10f0 <distance_to_vslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1689 <find_nearest_slice+0x499>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    168e <find_nearest_slice+0x49e>
jmp    1693 <find_nearest_slice+0x4a3>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    15b1 <find_nearest_slice+0x3c1>
mov    -0x30(%rbp),%edi
lea    -0x7b0(%rbp),%rsi
lea    -0x7b0(%rbp),%rcx
add    $0x4,%rcx
lea    -0x7b0(%rbp),%r9
add    $0x8,%r9
lea    -0x7b0(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x800(%rbp)
lea    -0x7b0(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x7f0(%rbp)
lea    -0x7b0(%rbp),%r13
add    $0x14,%r13
lea    -0x7b0(%rbp),%r15
add    $0x18,%r15
lea    -0x7b0(%rbp),%rbx
add    $0x1c,%rbx
lea    -0x7b0(%rbp),%r10
add    $0x20,%r10
lea    -0x98(%rbp),%rdx
lea    -0x9c(%rbp),%r8
lea    -0xa0(%rbp),%rax
mov    %rax,-0x808(%rbp)
lea    -0xa4(%rbp),%rax
mov    %rax,-0x7f8(%rbp)
lea    -0xa8(%rbp),%rax
mov    %rax,-0x7e8(%rbp)
lea    -0xac(%rbp),%r12
lea    -0xb0(%rbp),%r14
lea    -0xb4(%rbp),%r11
lea    -0xb8(%rbp),%rax
mov    %rax,-0x7e0(%rbp)
mov    -0x808(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x800(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x7f8(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x7f0(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0x7e8(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0x7e0(%rbp),%rax
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r11,0x50(%rsp)
mov    %r10,0x58(%rsp)
mov    %rax,0x60(%rsp)
call   1080 <vis5d_get_wind_vars@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x2,-0x64(%rbp)
jge    1926 <find_nearest_slice+0x736>
cmpl   $0x0,-0x64(%rbp)
jne    1807 <find_nearest_slice+0x617>
mov    -0x7b0(%rbp),%eax
mov    %eax,-0x80c(%rbp)
jmp    1813 <find_nearest_slice+0x623>
mov    -0x7a4(%rbp),%eax
mov    %eax,-0x80c(%rbp)
mov    -0x80c(%rbp),%eax
mov    %eax,-0x7b8(%rbp)
mov    -0x7b8(%rbp),%eax
cmp    -0x7b4(%rbp),%eax
jne    1913 <find_nearest_slice+0x723>
mov    -0x7b4(%rbp),%edi
mov    -0x64(%rbp),%edx
mov    $0x6,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1913 <find_nearest_slice+0x723>
cmpl   $0x0,-0x64(%rbp)
jne    186e <find_nearest_slice+0x67e>
mov    -0x98(%rbp),%eax
mov    %eax,-0x810(%rbp)
jmp    187a <find_nearest_slice+0x68a>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x810(%rbp)
mov    -0x810(%rbp),%eax
mov    %eax,-0x7bc(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x64(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    -0x94(%rbp),%rcx
lea    -0x7c(%rbp),%r8
call   1100 <vis5d_get_hwindslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x7bc(%rbp),%r8d
movss  -0x7c(%rbp),%xmm0
lea    -0x60(%rbp),%r9
call   10c0 <distance_to_hslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    190e <find_nearest_slice+0x71e>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x6,(%rax)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x64(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1913 <find_nearest_slice+0x723>
jmp    1918 <find_nearest_slice+0x728>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    17e2 <find_nearest_slice+0x5f2>
movl   $0x0,-0x64(%rbp)
cmpl   $0x2,-0x64(%rbp)
jge    1aa7 <find_nearest_slice+0x8b7>
cmpl   $0x0,-0x64(%rbp)
jne    1952 <find_nearest_slice+0x762>
mov    -0x7b0(%rbp),%eax
mov    %eax,-0x814(%rbp)
jmp    195e <find_nearest_slice+0x76e>
mov    -0x7a4(%rbp),%eax
mov    %eax,-0x814(%rbp)
mov    -0x814(%rbp),%eax
mov    %eax,-0x7c0(%rbp)
mov    -0x7c0(%rbp),%eax
cmp    -0x7b4(%rbp),%eax
jne    1a94 <find_nearest_slice+0x8a4>
mov    -0x7b4(%rbp),%edi
mov    -0x64(%rbp),%edx
mov    $0x7,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1a94 <find_nearest_slice+0x8a4>
cmpl   $0x0,-0x64(%rbp)
jne    19b9 <find_nearest_slice+0x7c9>
mov    -0x98(%rbp),%eax
mov    %eax,-0x818(%rbp)
jmp    19c5 <find_nearest_slice+0x7d5>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x818(%rbp)
mov    -0x818(%rbp),%eax
mov    %eax,-0x7c4(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x64(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    -0x94(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    -0x84(%rbp),%r9
lea    -0x88(%rbp),%r10
lea    -0x8c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10b0 <vis5d_get_vwindslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x7c4(%rbp),%r8d
movss  -0x80(%rbp),%xmm0
movss  -0x84(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm2
ff
movss  -0x8c(%rbp),%xmm3
ff
lea    -0x60(%rbp),%r9
call   10f0 <distance_to_vslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1a8f <find_nearest_slice+0x89f>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x7,(%rax)
mov    -0x64(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1a94 <find_nearest_slice+0x8a4>
jmp    1a99 <find_nearest_slice+0x8a9>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    192d <find_nearest_slice+0x73d>
movl   $0x0,-0x64(%rbp)
cmpl   $0x2,-0x64(%rbp)
jge    1beb <find_nearest_slice+0x9fb>
cmpl   $0x0,-0x64(%rbp)
jne    1ad3 <find_nearest_slice+0x8e3>
mov    -0x7b0(%rbp),%eax
mov    %eax,-0x81c(%rbp)
jmp    1adf <find_nearest_slice+0x8ef>
mov    -0x7a4(%rbp),%eax
mov    %eax,-0x81c(%rbp)
mov    -0x81c(%rbp),%eax
mov    %eax,-0x7c8(%rbp)
mov    -0x7c8(%rbp),%eax
cmp    -0x7b4(%rbp),%eax
jne    1bd8 <find_nearest_slice+0x9e8>
mov    -0x7b4(%rbp),%edi
mov    -0x64(%rbp),%edx
mov    $0x8,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1bd8 <find_nearest_slice+0x9e8>
cmpl   $0x0,-0x64(%rbp)
jne    1b3a <find_nearest_slice+0x94a>
mov    -0x98(%rbp),%eax
mov    %eax,-0x820(%rbp)
jmp    1b46 <find_nearest_slice+0x956>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x820(%rbp)
mov    -0x820(%rbp),%eax
mov    %eax,-0x7cc(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x64(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    -0x7c(%rbp),%rcx
call   1060 <vis5d_get_hstreamslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x7cc(%rbp),%r8d
movss  -0x7c(%rbp),%xmm0
lea    -0x60(%rbp),%r9
call   10c0 <distance_to_hslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1bd3 <find_nearest_slice+0x9e3>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x64(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1bd8 <find_nearest_slice+0x9e8>
jmp    1bdd <find_nearest_slice+0x9ed>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1aae <find_nearest_slice+0x8be>
movl   $0x0,-0x64(%rbp)
cmpl   $0x2,-0x64(%rbp)
jge    1d60 <find_nearest_slice+0xb70>
cmpl   $0x0,-0x64(%rbp)
jne    1c17 <find_nearest_slice+0xa27>
mov    -0x7b0(%rbp),%eax
mov    %eax,-0x824(%rbp)
jmp    1c23 <find_nearest_slice+0xa33>
mov    -0x7a4(%rbp),%eax
mov    %eax,-0x824(%rbp)
mov    -0x824(%rbp),%eax
mov    %eax,-0x7d0(%rbp)
mov    -0x7d0(%rbp),%eax
cmp    -0x7b4(%rbp),%eax
jne    1d4d <find_nearest_slice+0xb5d>
mov    -0x7b4(%rbp),%edi
mov    -0x64(%rbp),%edx
mov    $0x9,%esi
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
cmp    $0x0,%rax
je     1d4d <find_nearest_slice+0xb5d>
cmpl   $0x0,-0x64(%rbp)
jne    1c7e <find_nearest_slice+0xa8e>
mov    -0x98(%rbp),%eax
mov    %eax,-0x828(%rbp)
jmp    1c8a <find_nearest_slice+0xa9a>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x828(%rbp)
mov    -0x828(%rbp),%eax
mov    %eax,-0x7d4(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x64(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0x84(%rbp),%r8
lea    -0x88(%rbp),%r9
lea    -0x8c(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <vis5d_get_vstreamslice@plt>
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x7d4(%rbp),%r8d
movss  -0x80(%rbp),%xmm0
movss  -0x84(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm2
ff
movss  -0x8c(%rbp),%xmm3
ff
lea    -0x60(%rbp),%r9
call   10f0 <distance_to_vslice@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1d48 <find_nearest_slice+0xb58>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x7b4(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x64(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1d4d <find_nearest_slice+0xb5d>
jmp    1d52 <find_nearest_slice+0xb62>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1bf2 <find_nearest_slice+0xa02>
jmp    1d65 <find_nearest_slice+0xb75>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1279 <find_nearest_slice+0x89>
mov    -0x48(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1d8c <find_nearest_slice+0xb9c>
movl   $0x1,-0x2c(%rbp)
jmp    1d93 <find_nearest_slice+0xba3>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x868,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_nearest_slice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x758,%rsp
mov    %r9,%rbp
mov    %r8,%r14
mov    %ecx,0xc(%rsp)
mov    %edx,%r13d
mov    %esi,%r12d
mov    %edi,%ebx
mov    0x798(%rsp),%r15
lea    0x40(%rsp),%rsi
lea    0xc0(%rsp),%rdx
call   1030 <vis5d_get_num_of_ctxs_in_display@plt>
movl   $0xffffffff,(%r15)
mov    0x790(%rsp),%rax
movl   $0xffffffff,(%rax)
mov    %rbp,0x28(%rsp)
movl   $0xffffffff,0x0(%rbp)
movl   $0xffffffff,(%r14)
cmpl   $0x0,0x40(%rsp)
jle    1cbe <find_nearest_slice+0xace>
movss  0xd98(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ecx,%ecx
jmp    129a <find_nearest_slice+0xaa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x80(%rsp),%rcx
add    $0x1,%rcx
movslq 0x40(%rsp),%rax
cmp    %rax,%rcx
jge    1cb3 <find_nearest_slice+0xac3>
mov    %rcx,0x80(%rsp)
mov    0xc0(%rsp,%rcx,4),%r15d
mov    %r15d,%edi
lea    0x30(%rsp),%rsi
call   1070 <vis5d_get_ctx_numvars@plt>
sub    $0x8,%rsp
mov    %r15d,%edi
lea    0xa8(%rsp),%rsi
lea    0xa4(%rsp),%rdx
lea    0x438(%rsp),%rcx
lea    0x118(%rsp),%r8
lea    0xa0(%rsp),%r9
lea    0x94(%rsp),%rax
push   %rax
lea    0xa0(%rsp),%rax
push   %rax
lea    0xac(%rsp),%rax
push   %rax
call   10a0 <vis5d_get_size@plt>
add    $0x20,%rsp
cmpl   $0x0,0x30(%rsp)
jle    1640 <find_nearest_slice+0x450>
xor    %ebp,%ebp
jmp    132f <find_nearest_slice+0x13f>
nopl   0x0(%rax)
add    $0x1,%ebp
mov    0x30(%rsp),%eax
cmp    %eax,%ebp
jge    13d0 <find_nearest_slice+0x1e0>
mov    %r15d,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1320 <find_nearest_slice+0x130>
mov    %r15d,%edi
mov    %ebp,%esi
lea    0x4c(%rsp),%rdx
lea    0x48(%rsp),%rcx
lea    0x44(%rsp),%r8
lea    0x20(%rsp),%r9
call   1040 <vis5d_get_hslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1320 <find_nearest_slice+0x130>
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
movl   $0x1,(%r14)
mov    0x28(%rsp),%rax
mov    %ebp,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
jmp    1320 <find_nearest_slice+0x130>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1640 <find_nearest_slice+0x450>
xor    %ebp,%ebp
jmp    13ef <find_nearest_slice+0x1ff>
nopl   0x0(%rax)
add    $0x1,%ebp
mov    0x30(%rsp),%eax
cmp    %eax,%ebp
jge    1480 <find_nearest_slice+0x290>
mov    %r15d,%edi
mov    $0x3,%esi
mov    %ebp,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     13e0 <find_nearest_slice+0x1f0>
mov    %r15d,%edi
mov    %ebp,%esi
lea    0x20(%rsp),%rdx
call   1090 <vis5d_get_chslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    13e0 <find_nearest_slice+0x1f0>
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
movl   $0x3,(%r14)
mov    0x28(%rsp),%rax
mov    %ebp,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
jmp    13e0 <find_nearest_slice+0x1f0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %eax,%eax
jle    1640 <find_nearest_slice+0x450>
mov    %r14,%rbp
xor    %r14d,%r14d
jmp    14a1 <find_nearest_slice+0x2b1>
add    $0x1,%r14d
mov    0x30(%rsp),%eax
cmp    %eax,%r14d
jge    1570 <find_nearest_slice+0x380>
mov    %r15d,%edi
mov    $0x2,%esi
mov    %r14d,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1490 <find_nearest_slice+0x2a0>
sub    $0x8,%rsp
mov    %r15d,%edi
mov    %r14d,%esi
lea    0x54(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x4c(%rsp),%r8
lea    0x24(%rsp),%r9
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
lea    0x30(%rsp),%rax
push   %rax
call   10e0 <vis5d_get_vslice@plt>
add    $0x20,%rsp
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %r14d,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1490 <find_nearest_slice+0x2a0>
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
movl   $0x2,0x0(%rbp)
mov    0x28(%rsp),%rax
mov    %r14d,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
jmp    1490 <find_nearest_slice+0x2a0>
nopw   0x0(%rax,%rax,1)
test   %eax,%eax
mov    %rbp,%r14
jle    1640 <find_nearest_slice+0x450>
xor    %ebp,%ebp
jmp    158d <find_nearest_slice+0x39d>
nop
add    $0x1,%ebp
cmp    0x30(%rsp),%ebp
jge    1640 <find_nearest_slice+0x450>
mov    %r15d,%edi
mov    $0x4,%esi
mov    %ebp,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1580 <find_nearest_slice+0x390>
mov    %r15d,%edi
mov    %ebp,%esi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
call   10d0 <vis5d_get_cvslice@plt>
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1580 <find_nearest_slice+0x390>
movl   $0x4,(%r14)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x28(%rsp),%rax
mov    %ebp,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
jmp    1580 <find_nearest_slice+0x390>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sub    $0x8,%rsp
mov    %ebx,%edi
lea    0x58(%rsp),%rsi
lea    0x40(%rsp),%rdx
lea    0x5c(%rsp),%rcx
lea    0xc4(%rsp),%r8
lea    0x60(%rsp),%r9
lea    0xac(%rsp),%rax
push   %rax
lea    0x80(%rsp),%rax
push   %rax
lea    0xc0(%rsp),%rax
push   %rax
lea    0x8c(%rsp),%rax
push   %rax
lea    0xd4(%rsp),%rax
push   %rax
lea    0x98(%rsp),%rax
push   %rax
lea    0xe8(%rsp),%rax
push   %rax
lea    0xa4(%rsp),%rax
push   %rax
lea    0xfc(%rsp),%rax
push   %rax
lea    0xb0(%rsp),%rax
push   %rax
lea    0x8c(%rsp),%rax
push   %rax
lea    0xbc(%rsp),%rax
push   %rax
lea    0x120(%rsp),%rax
push   %rax
call   1080 <vis5d_get_wind_vars@plt>
add    $0x70,%rsp
cmp    %r15d,0x50(%rsp)
jne    1780 <find_nearest_slice+0x590>
mov    %r15d,%edi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1780 <find_nearest_slice+0x590>
mov    0x38(%rsp),%ebp
mov    %ebx,%edi
xor    %esi,%esi
lea    0x24(%rsp),%rdx
lea    0x3c(%rsp),%rcx
lea    0x20(%rsp),%r8
call   1100 <vis5d_get_hwindslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1780 <find_nearest_slice+0x590>
movl   $0x6,(%r14)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x28(%rsp),%rax
movl   $0x0,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
nop
cmp    %r15d,0x5c(%rsp)
jne    1830 <find_nearest_slice+0x640>
mov    %r15d,%edi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1830 <find_nearest_slice+0x640>
mov    0x34(%rsp),%ebp
mov    %ebx,%edi
mov    $0x1,%esi
lea    0x24(%rsp),%rdx
lea    0x3c(%rsp),%rcx
lea    0x20(%rsp),%r8
call   1100 <vis5d_get_hwindslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1830 <find_nearest_slice+0x640>
movl   $0x6,(%r14)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %r15d,0x50(%rsp)
jne    1900 <find_nearest_slice+0x710>
mov    %r15d,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1900 <find_nearest_slice+0x710>
mov    0x38(%rsp),%ebp
mov    %ebx,%edi
xor    %esi,%esi
lea    0x24(%rsp),%rdx
lea    0x3c(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
lea    0x10(%rsp),%rax
push   %rax
lea    0x1c(%rsp),%rax
push   %rax
call   10b0 <vis5d_get_vwindslice@plt>
add    $0x10,%rsp
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1900 <find_nearest_slice+0x710>
movl   $0x7,(%r14)
mov    0x28(%rsp),%rax
movl   $0x0,(%rax)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
cmp    %r15d,0x5c(%rsp)
jne    19d0 <find_nearest_slice+0x7e0>
mov    %r15d,%edi
mov    $0x7,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     19d0 <find_nearest_slice+0x7e0>
mov    0x34(%rsp),%ebp
mov    %ebx,%edi
mov    $0x1,%esi
lea    0x24(%rsp),%rdx
lea    0x3c(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
lea    0x10(%rsp),%rax
push   %rax
lea    0x1c(%rsp),%rax
push   %rax
call   10b0 <vis5d_get_vwindslice@plt>
add    $0x10,%rsp
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    19d0 <find_nearest_slice+0x7e0>
movl   $0x7,(%r14)
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
nopl   0x0(%rax)
cmp    %r15d,0x50(%rsp)
jne    1a70 <find_nearest_slice+0x880>
mov    %r15d,%edi
mov    $0x8,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1a70 <find_nearest_slice+0x880>
mov    0x38(%rsp),%ebp
mov    %ebx,%edi
xor    %esi,%esi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   1060 <vis5d_get_hstreamslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1a70 <find_nearest_slice+0x880>
movl   $0x8,(%r14)
mov    0x28(%rsp),%rax
movl   $0x0,(%rax)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
nopw   0x0(%rax,%rax,1)
cmp    %r15d,0x5c(%rsp)
jne    1b10 <find_nearest_slice+0x920>
mov    %r15d,%edi
mov    $0x8,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1b10 <find_nearest_slice+0x920>
mov    0x34(%rsp),%ebp
mov    %ebx,%edi
mov    $0x1,%esi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   1060 <vis5d_get_hstreamslice@plt>
movss  0x20(%rsp),%xmm0
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10c0 <distance_to_hslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1b10 <find_nearest_slice+0x920>
movl   $0x8,(%r14)
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
nopl   0x0(%rax)
cmp    %r15d,0x50(%rsp)
jne    1be0 <find_nearest_slice+0x9f0>
mov    %r15d,%edi
mov    $0x9,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1be0 <find_nearest_slice+0x9f0>
mov    0x38(%rsp),%ebp
sub    $0x8,%rsp
mov    %ebx,%edi
xor    %esi,%esi
lea    0x2c(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x1c(%rsp),%r9
lea    0x18(%rsp),%rax
push   %rax
call   1050 <vis5d_get_vstreamslice@plt>
add    $0x10,%rsp
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1be0 <find_nearest_slice+0x9f0>
movl   $0x9,(%r14)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x28(%rsp),%rax
movl   $0x0,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %r15d,0x5c(%rsp)
jne    1280 <find_nearest_slice+0x90>
mov    %r15d,%edi
mov    $0x9,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1110 <vis5d_enable_graphics@plt>
test   %rax,%rax
je     1280 <find_nearest_slice+0x90>
mov    0x34(%rsp),%ebp
sub    $0x8,%rsp
mov    %ebx,%edi
mov    $0x1,%esi
lea    0x2c(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x1c(%rsp),%r9
lea    0x18(%rsp),%rax
push   %rax
call   1050 <vis5d_get_vstreamslice@plt>
add    $0x10,%rsp
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mov    %ebx,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
lea    0x8(%rsp),%r9
call   10f0 <distance_to_vslice@plt>
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1280 <find_nearest_slice+0x90>
movl   $0x9,(%r14)
mov    0x798(%rsp),%rax
mov    %r15d,(%rax)
mov    0x28(%rsp),%rax
movl   $0x1,(%rax)
mov    0x8(%rsp),%eax
mov    0x790(%rsp),%rcx
mov    %eax,(%rcx)
movss  %xmm0,0x4(%rsp)
jmp    1280 <find_nearest_slice+0x90>
xor    %eax,%eax
cmpl   $0xffffffff,(%r14)
setne  %al
jmp    1cc0 <find_nearest_slice+0xad0>
xor    %eax,%eax
add    $0x758,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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