#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ clean_empty_space(int ***, double ***, double ***,
                                     double ***, double ***, int, int, int);
int /*<<< orphan*/ compute_surface_values(double ***, double ***, double ***,
                                          double ***, int ***, int, int, int,
                                          double, double, double, double, int,
                                          int, int);
int getsurfacetype(int, int *, int *, int *, int *, int *, int *, int *);
scalar_t__ issurface(int);
int /*<<< orphan*/ printf(char *, int);
void set_uvwp_surface(double ***U, double ***V, double ***W, double ***P,
                      int ***Flag, double dx, double dy, double dz, int imax,
                      int jmax, int kmax, double GX, double GY, double GZ,
                      double dt, double Re) {
  clean_empty_space(Flag, U, V, W, P, imax, jmax, kmax);
  int i, j, k;
  int type = 0;
  int nx, ny, nz;
  int mx, my, mz;
  int num;
  for (j = 0; j <= jmax + 1; j++) {
    for (i = 0; i <= imax + 1; i++) {
      for (k = 0; k <= kmax + 1; k++) {
        if (issurface(Flag[i][j][k])) {
          type =
              getsurfacetype(Flag[i][j][k], &nx, &ny, &nz, &mx, &my, &mz, &num);
          switch (type) {
          case 32:
            P[i][j][k] = P[i - 1][j][k];
            break;
          case 16:
            P[i][j][k] = P[i][j + 1][k];
            break;
          case 8:
            P[i][j][k] = P[i][j - 1][k];
            break;
          case 4:
            P[i][j][k] = P[i][j + 1][k];
            break;
          case 1:
            P[i][j][k] = P[i][j][k - 1];
            break;
          case 2:
            P[i][j][k] = P[i][j][k + 1];
            break;
          default:
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            break;
          }
        }
      }
    }
  }
  for (j = 2; j < jmax; j++) {
    for (i = 2; i < imax; i++) {
      for (k = 2; k < kmax; k++) {
        if (issurface(Flag[i][j][k])) {
          compute_surface_values(U, V, W, P, Flag, i, j, k, dt, GX, GY, GZ,
                                 imax, jmax, kmax);
        }
      }
    }
  }
  printf("%d", type);
}


x86 assembly (clang, -O0):
<set_uvwp_surface>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  %xmm0,-0x40(%rbp)
movsd  %xmm1,-0x48(%rbp)
movsd  %xmm2,-0x50(%rbp)
mov    %r9d,-0x54(%rbp)
movsd  %xmm3,-0x60(%rbp)
movsd  %xmm4,-0x68(%rbp)
movsd  %xmm5,-0x70(%rbp)
movsd  %xmm6,-0x78(%rbp)
movsd  %xmm7,-0x80(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x54(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <clean_empty_space@plt>
movl   $0x0,-0x90(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1580 <set_uvwp_surface+0x430>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1567 <set_uvwp_surface+0x417>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     154e <set_uvwp_surface+0x3fe>
mov    -0x38(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <issurface@plt>
cmp    $0x0,%rax
je     1535 <set_uvwp_surface+0x3e5>
mov    -0x38(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    %rsp,%rax
lea    -0xac(%rbp),%rcx
mov    %rcx,0x8(%rax)
lea    -0xa8(%rbp),%rcx
mov    %rcx,(%rax)
lea    -0x94(%rbp),%rsi
lea    -0x98(%rbp),%rdx
lea    -0x9c(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    -0xa4(%rbp),%r9
call   1060 <getsurfacetype@plt>
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xb8(%rbp)
sub    $0x1f,%eax
ja     1507 <set_uvwp_surface+0x3b7>
mov    -0xb8(%rbp),%rax
lea    0xd06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x30(%rbp),%rax
mov    -0x84(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x88(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1530 <set_uvwp_surface+0x3e0>
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1535 <set_uvwp_surface+0x3e5>
jmp    153a <set_uvwp_surface+0x3ea>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1220 <set_uvwp_surface+0xd0>
jmp    1553 <set_uvwp_surface+0x403>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1202 <set_uvwp_surface+0xb2>
jmp    156c <set_uvwp_surface+0x41c>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    11e4 <set_uvwp_surface+0x94>
movl   $0x2,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    16ab <set_uvwp_surface+0x55b>
movl   $0x2,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    1692 <set_uvwp_surface+0x542>
movl   $0x2,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1679 <set_uvwp_surface+0x529>
mov    -0x38(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <issurface@plt>
cmp    $0x0,%rax
je     1660 <set_uvwp_surface+0x510>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x84(%rbp),%r9d
mov    -0x88(%rbp),%r14d
mov    -0x8c(%rbp),%ebx
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
mov    -0x54(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <compute_surface_values@plt>
jmp    1665 <set_uvwp_surface+0x515>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    15bc <set_uvwp_surface+0x46c>
jmp    167e <set_uvwp_surface+0x52e>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    15a3 <set_uvwp_surface+0x453>
jmp    1697 <set_uvwp_surface+0x547>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    158a <set_uvwp_surface+0x43a>
mov    -0x90(%rbp),%esi
lea    0x9c8(%rip),%rdi
call   1040 <printf@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uvwp_surface>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movsd  %xmm6,0x60(%rsp)
movsd  %xmm5,0x58(%rsp)
movsd  %xmm4,0x50(%rsp)
movsd  %xmm3,0x48(%rsp)
mov    %r9d,%ebp
mov    %r8,%rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0xc8(%rsp),%r15d
mov    0xc0(%rsp),%r13d
mov    %rbx,%rdi
mov    %rsi,0x30(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rcx,0x40(%rsp)
mov    %r8,(%rsp)
push   %r15
push   %r13
call   1070 <clean_empty_space@plt>
add    $0x10,%rsp
xor    %r12d,%r12d
cmp    $0xffffffff,%r13d
jl     14b8 <set_uvwp_surface+0x368>
lea    0x2(%r15),%r14d
lea    0x2(%rbp),%eax
mov    %rax,0x28(%rsp)
lea    0x2(%r13),%eax
mov    %rax,0x20(%rsp)
shl    $0x2,%r14
xor    %r13d,%r13d
xor    %r12d,%r12d
mov    %rbp,0x18(%rsp)
jmp    1213 <set_uvwp_surface+0xc3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%r13
cmp    0x20(%rsp),%rax
mov    0x18(%rsp),%rbp
je     13c6 <set_uvwp_surface+0x276>
lea    0x1(%r13),%rax
cmp    $0xffffffff,%ebp
jl     1200 <set_uvwp_surface+0xb0>
mov    %eax,%ecx
mov    %rcx,0x8(%rsp)
xor    %ebp,%ebp
mov    %rax,0x10(%rsp)
jmp    1248 <set_uvwp_surface+0xf8>
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    0x28(%rsp),%rbp
mov    0xc8(%rsp),%r15d
mov    0x10(%rsp),%rax
je     1200 <set_uvwp_surface+0xb0>
cmp    $0xffffffff,%r15d
jl     1230 <set_uvwp_surface+0xe0>
xor    %r15d,%r15d
jmp    127f <set_uvwp_surface+0x12f>
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    (%rax,%r13,8),%rax
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,(%rax,%r15,2)
add    $0x4,%r15
cmp    %r15,%r14
je     1230 <set_uvwp_surface+0xe0>
mov    (%rbx,%rbp,8),%rax
mov    (%rax,%r13,8),%rax
mov    (%rax,%r15,1),%edi
call   1050 <issurface@plt>
test   %rax,%rax
je     1276 <set_uvwp_surface+0x126>
mov    (%rbx,%rbp,8),%rax
mov    (%rax,%r13,8),%rax
mov    (%rax,%r15,1),%edi
lea    0x84(%rsp),%rsi
lea    0x80(%rsp),%rdx
lea    0x7c(%rsp),%rcx
lea    0x78(%rsp),%r8
lea    0x74(%rsp),%r9
lea    0x6c(%rsp),%rax
push   %rax
lea    0x78(%rsp),%rax
push   %rax
call   1060 <getsurfacetype@plt>
add    $0x10,%rsp
mov    %eax,%r12d
lea    -0x1(%r12),%eax
cmp    $0x1f,%eax
ja     1253 <set_uvwp_surface+0x103>
lea    0xd13(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    (%rax,%r13,8),%rax
movsd  -0x8(%rax,%r15,2),%xmm0
mov    $0x1,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    (%rax,%r13,8),%rax
movsd  0x8(%rax,%r15,2),%xmm0
mov    $0x2,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    0x8(%rsp),%rcx
mov    (%rax,%rcx,8),%rcx
movsd  (%rcx,%r15,2),%xmm0
mov    (%rax,%r13,8),%rax
mov    $0x4,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    -0x8(%rax,%r13,8),%rcx
mov    (%rax,%r13,8),%rax
movsd  (%rcx,%r15,2),%xmm0
mov    $0x8,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    0x8(%rsp),%rcx
mov    (%rax,%rcx,8),%rcx
movsd  (%rcx,%r15,2),%xmm0
mov    (%rax,%r13,8),%rax
mov    $0x10,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    (%rsp),%rcx
mov    -0x8(%rcx,%rbp,8),%rax
mov    (%rcx,%rbp,8),%rcx
mov    (%rax,%r13,8),%rax
movsd  (%rax,%r15,2),%xmm0
mov    (%rcx,%r13,8),%rax
mov    $0x20,%r12d
jmp    1270 <set_uvwp_surface+0x120>
mov    0xc0(%rsp),%eax
cmp    $0x3,%eax
jl     14b8 <set_uvwp_surface+0x368>
mov    %eax,%eax
mov    %rax,0x10(%rsp)
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    %r15d,%r13d
mov    $0x2,%r14d
jmp    1404 <set_uvwp_surface+0x2b4>
nop
add    $0x1,%r14
cmp    0x10(%rsp),%r14
mov    0x18(%rsp),%rbp
je     14b8 <set_uvwp_surface+0x368>
cmp    $0x3,%ebp
jl     13f0 <set_uvwp_surface+0x2a0>
mov    $0x2,%ebp
jmp    1423 <set_uvwp_surface+0x2d3>
add    $0x1,%rbp
cmp    0x8(%rsp),%rbp
mov    0xc8(%rsp),%r15d
je     13f0 <set_uvwp_surface+0x2a0>
cmp    $0x3,%r15d
jl     1410 <set_uvwp_surface+0x2c0>
mov    $0x2,%r15d
jmp    1449 <set_uvwp_surface+0x2f9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%r13
je     1410 <set_uvwp_surface+0x2c0>
mov    (%rbx,%rbp,8),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r15,4),%edi
call   1050 <issurface@plt>
test   %rax,%rax
je     1440 <set_uvwp_surface+0x2f0>
sub    $0x8,%rsp
mov    0x38(%rsp),%rdi
mov    0x40(%rsp),%rsi
mov    0x48(%rsp),%rdx
mov    0x8(%rsp),%rcx
mov    %rbx,%r8
mov    %ebp,%r9d
movsd  0x68(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
movsd  0x60(%rsp),%xmm3
mov    0xd0(%rsp),%eax
push   %rax
mov    0xd0(%rsp),%eax
push   %rax
push   0x30(%rsp)
push   %r15
push   %r14
call   1030 <compute_surface_values@plt>
add    $0x30,%rsp
jmp    1440 <set_uvwp_surface+0x2f0>
lea    0xbc1(%rip),%rdi
mov    %r12d,%esi
call   1040 <printf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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