#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 point_nearest_line(float *, float *, float *, float *);
int /*<<< orphan*/ vis5d_get_ctx_display_index(int, int *);
int /*<<< orphan*/ vis5d_get_size(int, int *, int *, int *, int *, int *, int *,
                                  int *, int *);
int /*<<< orphan*/ vis5d_get_sizePRIME(int, int *, int *, int *, int *, int *,
                                       int *);
int /*<<< orphan*/ vis5d_gridPRIME_to_xyzPRIME(int, int, int, float, float,
                                               float, float *, float *,
                                               float *);
int /*<<< orphan*/ vis5d_unproject(int, float, float, float *, float *);
int /*<<< orphan*/ vis5d_xyzPRIME_to_gridPRIME(int, int, int, float, float,
                                               float, float *, float *,
                                               float *);
int move_hslice(int index, int curx, int cury, int time, int var, float *level,
                int corner) {
  float cx, cy;
  float a[3], da[3];
  float b[3], db[3];
  float t;
  float topl, botl, aa[3];
  float r, c;
  float maxlevel, minlevel;
  int Nr, Nc, Nl, LowLev, MaxNlVar, WindNl, WindLow;
  int vNr, vNc, vNl[200], vLowLev[200], vMaxNl, vMaxNlVar, vWindNl, vWindLow;
  int dindex;
  vis5d_get_ctx_display_index(index, &dindex);
  vis5d_get_sizePRIME(dindex, &Nr, &Nc, &Nl, &LowLev, &WindNl, &WindLow);
  vis5d_get_size(index, &vNr, &vNc, vNl, vLowLev, &vMaxNl, &vMaxNlVar, &vWindNl,
                 &vWindLow);
  if (vNl[var] == 1) {
    maxlevel = (float)(Nl - 1);
    minlevel = 0.0;
  } else {
    maxlevel = (float)(Nl - 1 + LowLev);
    minlevel = (float)LowLev;
  }
  cx = (float)curx;
  cy = (float)cury;
  vis5d_unproject(dindex, cx, cy, b, db);
  switch (corner) {
  case 0:
    r = 0.0;
    c = (float)(Nc - 1);
    break;
  case 1:
    r = (float)(Nr - 1);
    c = (float)(Nc - 1);
    break;
  case 2:
    r = (float)(Nr - 1);
    c = 0.0;
    break;
  case 3:
    r = 0.0;
    c = 0.0;
    break;
  }
  topl = maxlevel;
  botl = minlevel;
  vis5d_gridPRIME_to_xyzPRIME(dindex, time, var, r, c, botl, &a[0], &a[1],
                              &a[2]);
  vis5d_gridPRIME_to_xyzPRIME(dindex, time, var, r, c, topl, &aa[0], &aa[1],
                              &aa[2]);
  da[0] = aa[0] - a[0];
  da[1] = aa[1] - a[1];
  da[2] = aa[2] - a[2];
  t = point_nearest_line(a, da, b, db);
  if (t == 0.0) {
    return 0;
  } else {
    float x, y, z, row, col;
    x = a[0] + t * da[0];
    y = a[1] + t * da[1];
    z = a[2] + t * da[2];
    vis5d_xyzPRIME_to_gridPRIME(dindex, time, var, x, y, z, &row, &col, level);
    return 1;
  }
}


x86 assembly (clang, -O0):
<move_hslice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x740,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x704(%rbp),%rsi
call   1030 <vis5d_get_ctx_display_index@plt>
mov    -0x704(%rbp),%edi
lea    -0x84(%rbp),%rsi
lea    -0x88(%rbp),%rdx
lea    -0x8c(%rbp),%rcx
lea    -0x90(%rbp),%r8
lea    -0x98(%rbp),%r9
lea    -0x9c(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <vis5d_get_sizePRIME@plt>
mov    -0x8(%rbp),%edi
lea    -0x3d0(%rbp),%rcx
lea    -0x6f0(%rbp),%r8
lea    -0xa0(%rbp),%rsi
lea    -0xa4(%rbp),%rdx
lea    -0x6f4(%rbp),%r9
lea    -0x6f8(%rbp),%r11
lea    -0x6fc(%rbp),%r10
lea    -0x700(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <vis5d_get_size@plt>
movslq -0x18(%rbp),%rax
cmpl   $0x1,-0x3d0(%rbp,%rax,4)
01
jne    1259 <move_hslice+0xe9>
mov    -0x8c(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x7c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x80(%rbp)
jmp    127e <move_hslice+0x10e>
mov    -0x8c(%rbp),%eax
sub    $0x1,%eax
add    -0x90(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x7c(%rbp)
cvtsi2ssl -0x90(%rbp),%xmm0
ff
movss  %xmm0,-0x80(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x704(%rbp),%edi
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
lea    -0x4c(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1060 <vis5d_unproject@plt>
mov    0x10(%rbp),%eax
mov    %rax,-0x720(%rbp)
sub    $0x3,%rax
ja     1351 <move_hslice+0x1e1>
mov    -0x720(%rbp),%rax
lea    0xd2f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x78(%rbp)
jmp    1351 <move_hslice+0x1e1>
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x74(%rbp)
mov    -0x88(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x78(%rbp)
jmp    1351 <move_hslice+0x1e1>
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
jmp    1351 <move_hslice+0x1e1>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x80(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
mov    -0x704(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movss  -0x74(%rbp),%xmm0
movss  -0x78(%rbp),%xmm1
movss  -0x64(%rbp),%xmm2
lea    -0x34(%rbp),%rcx
lea    -0x34(%rbp),%r8
add    $0x4,%r8
lea    -0x34(%rbp),%r9
add    $0x8,%r9
call   1080 <vis5d_gridPRIME_to_xyzPRIME@plt>
mov    -0x704(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movss  -0x74(%rbp),%xmm0
movss  -0x78(%rbp),%xmm1
movss  -0x60(%rbp),%xmm2
lea    -0x70(%rbp),%rcx
lea    -0x70(%rbp),%r8
add    $0x4,%r8
lea    -0x70(%rbp),%r9
add    $0x8,%r9
call   1080 <vis5d_gridPRIME_to_xyzPRIME@plt>
movss  -0x70(%rbp),%xmm0
subss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x6c(%rbp),%xmm0
subss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x68(%rbp),%xmm0
subss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
lea    -0x34(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x4c(%rbp),%rdx
lea    -0x58(%rbp),%rcx
call   1050 <point_nearest_line@plt>
movss  %xmm0,-0x5c(%rbp)
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    143c <move_hslice+0x2cc>
jp     143c <move_hslice+0x2cc>
movl   $0x0,-0x4(%rbp)
jmp    14db <move_hslice+0x36b>
movss  -0x34(%rbp),%xmm1
movss  -0x5c(%rbp),%xmm0
movss  -0x40(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x708(%rbp)
ff
movss  -0x30(%rbp),%xmm1
movss  -0x5c(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x70c(%rbp)
ff
movss  -0x2c(%rbp),%xmm1
movss  -0x5c(%rbp),%xmm0
movss  -0x38(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x710(%rbp)
ff
mov    -0x704(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movss  -0x708(%rbp),%xmm0
ff
movss  -0x70c(%rbp),%xmm1
ff
movss  -0x710(%rbp),%xmm2
ff
mov    -0x20(%rbp),%r9
lea    -0x714(%rbp),%rcx
lea    -0x718(%rbp),%r8
call   1090 <vis5d_xyzPRIME_to_gridPRIME@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_hslice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x6d8,%rsp
mov    %r9,0x48(%rsp)
mov    %r8d,%r12d
mov    %ecx,%r15d
mov    %edx,%r13d
mov    %esi,%r14d
mov    %edi,%ebx
mov    %rsp,%rsi
call   1030 <vis5d_get_ctx_display_index@plt>
mov    (%rsp),%edi
sub    $0x8,%rsp
lea    0x78(%rsp),%rax
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x40(%rsp),%rcx
lea    0x3c(%rsp),%r8
lea    0x7c(%rsp),%r9
push   %rax
call   1070 <vis5d_get_sizePRIME@plt>
add    $0x8,%rsp
lea    0x60(%rsp),%rax
lea    0x64(%rsp),%rbp
lea    0x68(%rsp),%r10
lea    0x74(%rsp),%rsi
lea    0x70(%rsp),%rdx
lea    0x98(%rsp),%rcx
lea    0x3b8(%rsp),%r8
lea    0x6c(%rsp),%r9
mov    %ebx,%edi
push   %rax
push   %rbp
push   %r10
call   1040 <vis5d_get_size@plt>
add    $0x20,%rsp
movslq %r12d,%rax
xor    %ecx,%ecx
cmpl   $0x1,0x90(%rsp,%rax,4)
01
mov    0x38(%rsp),%eax
mov    0x34(%rsp),%edx
xorps  %xmm0,%xmm0
je     1229 <move_hslice+0xb9>
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
movss  %xmm0,0x4(%rsp)
cmove  %ecx,%edx
add    %edx,%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
cvtsi2ss %r13d,%xmm1
mov    (%rsp),%edi
lea    0x84(%rsp),%rsi
lea    0x78(%rsp),%rdx
call   1060 <vis5d_unproject@plt>
mov    0x710(%rsp),%eax
cmp    $0x2,%eax
je     1291 <move_hslice+0x121>
cmp    $0x1,%eax
je     12a4 <move_hslice+0x134>
test   %eax,%eax
movss  0x4(%rsp),%xmm2
jne    12c8 <move_hslice+0x158>
mov    0x8(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
jmp    12cb <move_hslice+0x15b>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
xorps  %xmm1,%xmm1
jmp    12c0 <move_hslice+0x150>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    0x8(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm2
jmp    12ce <move_hslice+0x15e>
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
mov    (%rsp),%edi
lea    0x14(%rsp),%r8
lea    0x18(%rsp),%r9
lea    0x10(%rsp),%rbx
mov    %r15d,%esi
mov    %r12d,%edx
movss  %xmm0,0x2c(%rsp)
movss  %xmm1,0x28(%rsp)
mov    %rbx,%rcx
call   1080 <vis5d_gridPRIME_to_xyzPRIME@plt>
mov    (%rsp),%edi
lea    0x40(%rsp),%r8
lea    0x44(%rsp),%r9
lea    0x3c(%rsp),%rcx
mov    %r15d,%esi
mov    %r12d,%edx
movss  0x2c(%rsp),%xmm0
movss  0x28(%rsp),%xmm1
movss  0x30(%rsp),%xmm2
call   1080 <vis5d_gridPRIME_to_xyzPRIME@plt>
movss  0x3c(%rsp),%xmm0
movss  0x40(%rsp),%xmm1
subss  0x10(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
subss  0x14(%rsp),%xmm1
movss  %xmm1,0x20(%rsp)
movss  0x44(%rsp),%xmm0
subss  0x18(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x84(%rsp),%rdx
lea    0x78(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <point_nearest_line@plt>
movaps %xmm0,%xmm2
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jne    1388 <move_hslice+0x218>
jnp    13d6 <move_hslice+0x266>
movss  0x1c(%rsp),%xmm0
mulss  %xmm2,%xmm0
addss  0x10(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
mulss  %xmm2,%xmm1
addss  0x14(%rsp),%xmm1
mulss  0x24(%rsp),%xmm2
addss  0x18(%rsp),%xmm2
mov    (%rsp),%edi
lea    0x54(%rsp),%rcx
lea    0x50(%rsp),%r8
mov    %r15d,%esi
mov    %r12d,%edx
mov    0x48(%rsp),%r9
call   1090 <vis5d_xyzPRIME_to_gridPRIME@plt>
mov    $0x1,%eax
add    $0x6d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @move_hslice(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, float* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca float*
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca [3 x float]
%19 = alloca [3 x float]
%20 = alloca [3 x float]
%21 = alloca [3 x float]
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca [3 x float]
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca [200 x i32]
%40 = alloca [200 x i32]
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca i32
%46 = alloca float
%47 = alloca float
%48 = alloca float
%49 = alloca float
%50 = alloca float
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store float* %5, float** %14
store i32 %6, i32* %15
%51 = load i32, i32* %9
%52 = call i32 @vis5d_get_ctx_display_index(i32 %51, i32* %45)
%53 = load i32, i32* %45
%54 = call i32 @vis5d_get_sizePRIME(i32 %53, i32* %30, i32* %31, i32* %32, i32* %33, i32* %35, i32* %36)
%55 = load i32, i32* %9
%56 = getelementptr inbounds [200 x i32], [200 x i32]* %39, i64 0, i64 0
%57 = getelementptr inbounds [200 x i32], [200 x i32]* %40, i64 0, i64 0
%58 = call i32 @vis5d_get_size(i32 %55, i32* %37, i32* %38, i32* %56, i32* %57, i32* %41, i32* %42, i32* %43, i32* %44)
%59 = load i32, i32* %13
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [200 x i32], [200 x i32]* %39, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %68
64: ; preds = %7
%65 = load i32, i32* %32
%66 = sub nsw i32 %65, 1
%67 = sitofp i32 %66 to float
store float %67, float* %28
store float 0.000000e+00, float* %29
br label %76
68: ; preds = %7
%69 = load i32, i32* %32
%70 = sub nsw i32 %69, 1
%71 = load i32, i32* %33
%72 = add nsw i32 %70, %71
%73 = sitofp i32 %72 to float
store float %73, float* %28
%74 = load i32, i32* %33
%75 = sitofp i32 %74 to float
store float %75, float* %29
br label %76
76: ; preds = %68, %64
%77 = load i32, i32* %10
%78 = sitofp i32 %77 to float
store float %78, float* %16
%79 = load i32, i32* %11
%80 = sitofp i32 %79 to float
store float %80, float* %17
%81 = load i32, i32* %45
%82 = load float, float* %16
%83 = load float, float* %17
%84 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
%85 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
%86 = call i32 @vis5d_unproject(i32 %81, float %82, float %83, float* %84, float* %85)
%87 = load i32, i32* %15
switch i32 %87, label %104 [
i32 0, label %88
i32 1, label %92
i32 2, label %99
i32 3, label %103
]
88: ; preds = %76
store float 0.000000e+00, float* %26
%89 = load i32, i32* %31
%90 = sub nsw i32 %89, 1
%91 = sitofp i32 %90 to float
store float %91, float* %27
br label %104
92: ; preds = %76
%93 = load i32, i32* %30
%94 = sub nsw i32 %93, 1
%95 = sitofp i32 %94 to float
store float %95, float* %26
%96 = load i32, i32* %31
%97 = sub nsw i32 %96, 1
%98 = sitofp i32 %97 to float
store float %98, float* %27
br label %104
99: ; preds = %76
%100 = load i32, i32* %30
%101 = sub nsw i32 %100, 1
%102 = sitofp i32 %101 to float
store float %102, float* %26
store float 0.000000e+00, float* %27
br label %104
103: ; preds = %76
store float 0.000000e+00, float* %26
store float 0.000000e+00, float* %27
br label %104
104: ; preds = %76, %103, %99, %92, %88
%105 = load float, float* %28
store float %105, float* %23
%106 = load float, float* %29
store float %106, float* %24
%107 = load i32, i32* %45
%108 = load i32, i32* %12
%109 = load i32, i32* %13
%110 = load float, float* %26
%111 = load float, float* %27
%112 = load float, float* %24
%113 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%114 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%115 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%116 = call i32 @vis5d_gridPRIME_to_xyzPRIME(i32 %107, i32 %108, i32 %109, float %110, float %111, float %112, float* %113, float* %114, float* %115)
%117 = load i32, i32* %45
%118 = load i32, i32* %12
%119 = load i32, i32* %13
%120 = load float, float* %26
%121 = load float, float* %27
%122 = load float, float* %23
%123 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 0
%124 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 1
%125 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 2
%126 = call i32 @vis5d_gridPRIME_to_xyzPRIME(i32 %117, i32 %118, i32 %119, float %120, float %121, float %122, float* %123, float* %124, float* %125)
%127 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 0
%128 = load float, float* %127
%129 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%130 = load float, float* %129
%131 = fsub float %128, %130
%132 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
store float %131, float* %132
%133 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 1
%134 = load float, float* %133
%135 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%136 = load float, float* %135
%137 = fsub float %134, %136
%138 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
store float %137, float* %138
%139 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 2
%140 = load float, float* %139
%141 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%142 = load float, float* %141
%143 = fsub float %140, %142
%144 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
store float %143, float* %144
%145 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%146 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%147 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 0
%148 = getelementptr inbounds [3 x float], [3 x float]* %21, i64 0, i64 0
%149 = call float @point_nearest_line(float* %145, float* %146, float* %147, float* %148)
store float %149, float* %22
%150 = load float, float* %22
%151 = fpext float %150 to double
%152 = fcmp oeq double %151, 0.000000e+00
br i1 %152, label %153, label %154
153: ; preds = %104
store i32 0, i32* %8
br label %181
154: ; preds = %104
%155 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%156 = load float, float* %155
%157 = load float, float* %22
%158 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%159 = load float, float* %158
%160 = call float @llvm.fmuladd.f32(float %157, float %159, float %156)
store float %160, float* %46
%161 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 1
%162 = load float, float* %161
%163 = load float, float* %22
%164 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 1
%165 = load float, float* %164
%166 = call float @llvm.fmuladd.f32(float %163, float %165, float %162)
store float %166, float* %47
%167 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 2
%168 = load float, float* %167
%169 = load float, float* %22
%170 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 2
%171 = load float, float* %170
%172 = call float @llvm.fmuladd.f32(float %169, float %171, float %168)
store float %172, float* %48
%173 = load i32, i32* %45
%174 = load i32, i32* %12
%175 = load i32, i32* %13
%176 = load float, float* %46
%177 = load float, float* %47
%178 = load float, float* %48
%179 = load float*, float** %14
%180 = call i32 @vis5d_xyzPRIME_to_gridPRIME(i32 %173, i32 %174, i32 %175, float %176, float %177, float %178, float* %49, float* %50, float* %179)
store i32 1, i32* %8
br label %181
181: ; preds = %154, %153
%182 = load i32, i32* %8
ret i32 %182
}

LLVM IR (-O2):
define i32 @move_hslice(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, float* %5, i32 %6) {
%8 = alloca [3 x float]
%9 = alloca [3 x float]
%10 = alloca [3 x float]
%11 = alloca [3 x float]
%12 = alloca [3 x float]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [200 x i32]
%22 = alloca [200 x i32]
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca float
%29 = alloca float
%30 = bitcast [3 x float]* %8 to i8*
%31 = bitcast [3 x float]* %9 to i8*
%32 = bitcast [3 x float]* %10 to i8*
%33 = bitcast [3 x float]* %11 to i8*
%34 = bitcast [3 x float]* %12 to i8*
%35 = bitcast i32* %13 to i8*
%36 = bitcast i32* %14 to i8*
%37 = bitcast i32* %15 to i8*
%38 = bitcast i32* %16 to i8*
%39 = bitcast i32* %17 to i8*
%40 = bitcast i32* %18 to i8*
%41 = bitcast i32* %19 to i8*
%42 = bitcast i32* %20 to i8*
%43 = bitcast [200 x i32]* %21 to i8*
%44 = bitcast [200 x i32]* %22 to i8*
%45 = bitcast i32* %23 to i8*
%46 = bitcast i32* %24 to i8*
%47 = bitcast i32* %25 to i8*
%48 = bitcast i32* %26 to i8*
%49 = bitcast i32* %27 to i8*
%50 = call i32 @vis5d_get_ctx_display_index(i32 %0, i32* %27)
%51 = load i32, i32* %27
%52 = call i32 @vis5d_get_sizePRIME(i32 %51, i32* %13, i32* %14, i32* %15, i32* %16, i32* %17, i32* %18)
%53 = getelementptr inbounds [200 x i32], [200 x i32]* %21, i64 0, i64 0
%54 = getelementptr inbounds [200 x i32], [200 x i32]* %22, i64 0, i64 0
%55 = call i32 @vis5d_get_size(i32 %0, i32* %19, i32* %20, i32* %53, i32* %54, i32* %23, i32* %24, i32* %25, i32* %26)
%56 = sext i32 %4 to i64
%57 = getelementptr inbounds [200 x i32], [200 x i32]* %21, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = icmp eq i32 %58, 1
%60 = load i32, i32* %15
%61 = add nsw i32 %60, -1
%62 = load i32, i32* %16
%63 = sitofp i32 %62 to float
%64 = select i1 %59, float 0.000000e+00, float %63
%65 = select i1 %59, i32 0, i32 %62
%66 = add nsw i32 %61, %65
%67 = sitofp i32 %66 to float
%68 = sitofp i32 %1 to float
%69 = sitofp i32 %2 to float
%70 = load i32, i32* %27
%71 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%72 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%73 = call i32 @vis5d_unproject(i32 %70, float %68, float %69, float* %71, float* %72)
switch i32 %6, label %89 [
i32 0, label %74
i32 1, label %78
i32 2, label %85
]
74: ; preds = %7
%75 = load i32, i32* %14
%76 = add nsw i32 %75, -1
%77 = sitofp i32 %76 to float
br label %89
78: ; preds = %7
%79 = load i32, i32* %13
%80 = add nsw i32 %79, -1
%81 = sitofp i32 %80 to float
%82 = load i32, i32* %14
%83 = add nsw i32 %82, -1
%84 = sitofp i32 %83 to float
br label %89
85: ; preds = %7
%86 = load i32, i32* %13
%87 = add nsw i32 %86, -1
%88 = sitofp i32 %87 to float
br label %89
89: ; preds = %7, %85, %78, %74
%90 = phi float [ 0.000000e+00, %85 ], [ %84, %78 ], [ %77, %74 ], [ 0.000000e+00, %7 ]
%91 = phi float [ %88, %85 ], [ %81, %78 ], [ 0.000000e+00, %74 ], [ 0.000000e+00, %7 ]
%92 = load i32, i32* %27
%93 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 0
%94 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
%95 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 2
%96 = call i32 @vis5d_gridPRIME_to_xyzPRIME(i32 %92, i32 %3, i32 %4, float %91, float %90, float %64, float* %93, float* %94, float* %95)
%97 = load i32, i32* %27
%98 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 0
%99 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 1
%100 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 2
%101 = call i32 @vis5d_gridPRIME_to_xyzPRIME(i32 %97, i32 %3, i32 %4, float %91, float %90, float %67, float* %98, float* %99, float* %100)
%102 = load float, float* %98
%103 = load float, float* %93
%104 = fsub float %102, %103
%105 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
store float %104, float* %105
%106 = load float, float* %99
%107 = load float, float* %94
%108 = fsub float %106, %107
%109 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 1
store float %108, float* %109
%110 = load float, float* %100
%111 = load float, float* %95
%112 = fsub float %110, %111
%113 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 2
store float %112, float* %113
%114 = call float @point_nearest_line(float* %93, float* %105, float* %71, float* %72)
%115 = fcmp oeq float %114, 0.000000e+00
br i1 %115, label %130, label %116
116: ; preds = %89
%117 = bitcast float* %28 to i8*
%118 = bitcast float* %29 to i8*
%119 = load float, float* %93
%120 = load float, float* %105
%121 = call float @llvm.fmuladd.f32(float %114, float %120, float %119)
%122 = load float, float* %94
%123 = load float, float* %109
%124 = call float @llvm.fmuladd.f32(float %114, float %123, float %122)
%125 = load float, float* %95
%126 = load float, float* %113
%127 = call float @llvm.fmuladd.f32(float %114, float %126, float %125)
%128 = load i32, i32* %27
%129 = call i32 @vis5d_xyzPRIME_to_gridPRIME(i32 %128, i32 %3, i32 %4, float %121, float %124, float %127, float* %28, float* %29, float* %5)
br label %130
130: ; preds = %89, %116
%131 = phi i32 [ 1, %116 ], [ 0, %89 ]
ret i32 %131
}