#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*/ init_matrix2(double ***, int /*<<< orphan*/, int,
                                int /*<<< orphan*/, int, int /*<<< orphan*/,
                                int, double);
int /*<<< orphan*/ isfluid(int);
scalar_t__ strcmp(char *, char *);
void init_uvwp(double UI, double VI, double WI, double PI, int ***Flag,
               int imax, int jmax, int kmax, double ***U, double ***V,
               double ***W, double ***P, char *problem) {
  int i, j, k;
  init_matrix2(U, 0, imax + 1, 0, jmax + 1, 0, kmax + 1, UI);
  init_matrix2(V, 0, imax + 1, 0, jmax + 1, 0, kmax + 1, VI);
  init_matrix2(W, 0, imax + 1, 0, jmax + 1, 0, kmax + 1, WI);
  init_matrix2(P, 0, imax + 1, 0, jmax + 1, 0, kmax + 1, PI);
  for (i = 1; i <= imax + 1; i++) {
    for (j = 1; j <= jmax + 1; j++) {
      for (k = 1; k <= kmax + 1; k++) {
        if (!isfluid(Flag[i][j][k])) {
          U[i][j][k] = 0;
          U[i - 1][j][k] = 0;
          V[i][j][k] = 0;
          V[i][j - 1][k] = 0;
          W[i][j][k] = 0;
          W[i][j][k - 1] = 0;
          P[i][j][k] = 0;
        }
      }
    }
  }
  if (strcmp(problem, "step.pgm") == 0 || strcmp(problem, "surface.pgm") == 0) {
    for (i = 0; i <= imax + 1; i++) {
      for (j = 0; j <= jmax + 1; j++) {
        for (k = 0; k <= kmax * 0.5; k++) {
          U[i][j][k] = U[i][j][k] * 0.5;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<init_uvwp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %edx,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%r8d
add    $0x1,%r8d
mov    -0x34(%rbp),%eax
add    $0x1,%eax
movsd  -0x8(%rbp),%xmm0
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1050 <init_matrix2@plt>
mov    -0x48(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%r8d
add    $0x1,%r8d
mov    -0x34(%rbp),%eax
add    $0x1,%eax
movsd  -0x10(%rbp),%xmm0
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1050 <init_matrix2@plt>
mov    0x10(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%r8d
add    $0x1,%r8d
mov    -0x34(%rbp),%eax
add    $0x1,%eax
movsd  -0x18(%rbp),%xmm0
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1050 <init_matrix2@plt>
mov    0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%r8d
add    $0x1,%r8d
mov    -0x34(%rbp),%eax
add    $0x1,%eax
movsd  -0x20(%rbp),%xmm0
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1050 <init_matrix2@plt>
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     13be <init_uvwp+0x28e>
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     13ab <init_uvwp+0x27b>
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1398 <init_uvwp+0x268>
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <isfluid@plt>
cmp    $0x0,%eax
jne    1385 <init_uvwp+0x255>
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    138a <init_uvwp+0x25a>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    125c <init_uvwp+0x12c>
jmp    139d <init_uvwp+0x26d>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1244 <init_uvwp+0x114>
jmp    13b0 <init_uvwp+0x280>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    122c <init_uvwp+0xfc>
mov    0x20(%rbp),%rdi
lea    0xc3f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     13f2 <init_uvwp+0x2c2>
mov    0x20(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    14c4 <init_uvwp+0x394>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     14bf <init_uvwp+0x38f>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     14ac <init_uvwp+0x37c>
movl   $0x0,-0x54(%rbp)
cvtsi2sdl -0x54(%rbp),%xmm1
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xbc5(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1499 <init_uvwp+0x369>
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  0xb97(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1429 <init_uvwp+0x2f9>
jmp    149e <init_uvwp+0x36e>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1411 <init_uvwp+0x2e1>
jmp    14b1 <init_uvwp+0x381>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13f9 <init_uvwp+0x2c9>
jmp    14c4 <init_uvwp+0x394>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uvwp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r13
mov    %r8,%rbx
mov    %rsi,0x10(%rsp)
mov    %rdi,%r15
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x1(%rsi),%ebp
mov    %rdx,0x20(%rsp)
lea    0x1(%rdx),%r12d
mov    %rcx,0x30(%rsp)
lea    0x1(%rcx),%r14d
mov    %r14d,(%rsp)
mov    %r8,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r12d,%r8d
xor    %r9d,%r9d
call   1050 <init_matrix2@plt>
mov    %r14d,(%rsp)
mov    %r13,0x40(%rsp)
mov    %r13,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r12d,%r8d
xor    %r9d,%r9d
movsd  0x8(%rsp),%xmm0
call   1050 <init_matrix2@plt>
mov    %r14d,(%rsp)
mov    0x80(%rsp),%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r12d,%r8d
xor    %r9d,%r9d
movsd  0x18(%rsp),%xmm0
call   1050 <init_matrix2@plt>
mov    %r14d,(%rsp)
mov    0x88(%rsp),%rdi
xor    %esi,%esi
mov    %rbp,0x8(%rsp)
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r12,0x38(%rsp)
mov    %r12d,%r8d
xor    %r9d,%r9d
movsd  0x28(%rsp),%xmm0
call   1050 <init_matrix2@plt>
cmpl   $0x0,0x10(%rsp)
js     131c <init_uvwp+0x1ec>
mov    0x30(%rsp),%rax
add    $0x2,%eax
mov    0x20(%rsp),%rcx
add    $0x2,%ecx
mov    %rcx,0x28(%rsp)
mov    0x10(%rsp),%rcx
add    $0x2,%ecx
mov    %rcx,0x18(%rsp)
lea    -0x4(,%rax,4),%r13
ff
mov    $0x1,%r14d
jmp    124f <init_uvwp+0x11f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     131c <init_uvwp+0x1ec>
cmpl   $0x0,0x20(%rsp)
js     1240 <init_uvwp+0x110>
mov    $0x1,%r12d
jmp    126b <init_uvwp+0x13b>
xchg   %ax,%ax
add    $0x1,%r12
cmp    0x28(%rsp),%r12
je     1240 <init_uvwp+0x110>
cmpl   $0x0,0x30(%rsp)
js     1260 <init_uvwp+0x130>
xor    %ebp,%ebp
jmp    1289 <init_uvwp+0x159>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%rbp
cmp    %rbp,%r13
je     1260 <init_uvwp+0x130>
mov    (%r15,%r14,8),%rax
mov    (%rax,%r12,8),%rax
mov    0x4(%rax,%rbp,1),%edi
call   1030 <isfluid@plt>
test   %eax,%eax
jne    1280 <init_uvwp+0x150>
mov    (%rbx,%r14,8),%rax
mov    (%rax,%r12,8),%rax
movq   $0x0,0x8(%rax,%rbp,2)
mov    -0x8(%rbx,%r14,8),%rax
mov    (%rax,%r12,8),%rax
movq   $0x0,0x8(%rax,%rbp,2)
mov    0x40(%rsp),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r12,8),%rcx
movq   $0x0,0x8(%rcx,%rbp,2)
mov    -0x8(%rax,%r12,8),%rax
movq   $0x0,0x8(%rax,%rbp,2)
mov    0x80(%rsp),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r12,8),%rax
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rax,%rbp,2)
mov    0x88(%rsp),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r12,8),%rax
movq   $0x0,0x8(%rax,%rbp,2)
jmp    1280 <init_uvwp+0x150>
lea    0xcfd(%rip),%rsi
mov    0x90(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     135f <init_uvwp+0x22f>
lea    0xcea(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    0x8(%rsp),%rdi
mov    0x38(%rsp),%rbp
jne    1370 <init_uvwp+0x240>
cmpl   $0xffffffff,0x10(%rsp)
jge    137f <init_uvwp+0x24f>
jmp    1370 <init_uvwp+0x240>
cmpl   $0xffffffff,0x10(%rsp)
mov    0x8(%rsp),%rdi
mov    0x38(%rsp),%rbp
jge    137f <init_uvwp+0x24f>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xorps  %xmm0,%xmm0
cvtsi2sdl 0x30(%rsp),%xmm0
mulsd  0xc70(%rip),%xmm0
xor    %eax,%eax
test   %ebp,%ebp
cmovle %eax,%ebp
add    $0x1,%ebp
test   %edi,%edi
cmovle %eax,%edi
add    $0x1,%edi
xorpd  %xmm1,%xmm1
movsd  0xc52(%rip),%xmm2
jmp    13b9 <init_uvwp+0x289>
add    $0x1,%rax
cmp    %rdi,%rax
je     1370 <init_uvwp+0x240>
cmpl   $0xffffffff,0x20(%rsp)
jl     13b0 <init_uvwp+0x280>
xor    %ecx,%ecx
jmp    13d9 <init_uvwp+0x2a9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rcx
cmp    %rbp,%rcx
je     13b0 <init_uvwp+0x280>
ucomisd %xmm1,%xmm0
jb     13d0 <init_uvwp+0x2a0>
mov    (%rbx,%rax,8),%rdx
mov    (%rdx,%rcx,8),%rdx
xor    %esi,%esi
nopl   0x0(%rax)
movsd  (%rdx,%rsi,8),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rdx,%rsi,8)
add    $0x1,%rsi
xorps  %xmm3,%xmm3
cvtsi2sd %esi,%xmm3
ucomisd %xmm3,%xmm0
jae    13f0 <init_uvwp+0x2c0>
jmp    13d0 <init_uvwp+0x2a0>

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

LLVM IR (-O2):
@.str = [9 x i8] c"step.pgm\00"
@.str.1 = [12 x i8] c"surface.pgm\00"
define void @init_uvwp(double %0, double %1, double %2, double %3, i32*** nocapture %4, i32 %5, i32 %6, i32 %7, double*** %8, double*** %9, double*** %10, double*** %11, i8* %12) {
%14 = add nsw i32 %5, 1
%15 = add nsw i32 %6, 1
%16 = add nsw i32 %7, 1
%17 = tail call i32 @init_matrix2(double*** %8, i32 0, i32 %14, i32 0, i32 %15, i32 0, i32 %16, double %0)
%18 = tail call i32 @init_matrix2(double*** %9, i32 0, i32 %14, i32 0, i32 %15, i32 0, i32 %16, double %1)
%19 = tail call i32 @init_matrix2(double*** %10, i32 0, i32 %14, i32 0, i32 %15, i32 0, i32 %16, double %2)
%20 = tail call i32 @init_matrix2(double*** %11, i32 0, i32 %14, i32 0, i32 %15, i32 0, i32 %16, double %3)
%21 = icmp slt i32 %5, 0
br i1 %21, label %89, label %22
22: ; preds = %13
%23 = icmp slt i32 %6, 0
%24 = icmp slt i32 %7, 0
%25 = add i32 %7, 2
%26 = add i32 %6, 2
%27 = add nuw i32 %5, 2
%28 = zext i32 %27 to i64
%29 = zext i32 %26 to i64
%30 = zext i32 %25 to i64
br label %31
31: ; preds = %22, %86
%32 = phi i64 [ 1, %22 ], [ %87, %86 ]
br i1 %23, label %86, label %33
33: ; preds = %31
%34 = getelementptr inbounds i32**, i32*** %4, i64 %32
%35 = getelementptr inbounds double**, double*** %8, i64 %32
%36 = add nsw i64 %32, -1
%37 = getelementptr inbounds double**, double*** %8, i64 %36
%38 = getelementptr inbounds double**, double*** %9, i64 %32
%39 = getelementptr inbounds double**, double*** %10, i64 %32
%40 = getelementptr inbounds double**, double*** %11, i64 %32
br label %41
41: ; preds = %33, %83
%42 = phi i64 [ 1, %33 ], [ %84, %83 ]
br i1 %24, label %83, label %43
43: ; preds = %41
%44 = add nsw i64 %42, -1
br label %45
45: ; preds = %43, %80
%46 = phi i64 [ 1, %43 ], [ %81, %80 ]
%47 = load i32**, i32*** %34
%48 = getelementptr inbounds i32*, i32** %47, i64 %42
%49 = load i32*, i32** %48
%50 = getelementptr inbounds i32, i32* %49, i64 %46
%51 = load i32, i32* %50
%52 = tail call i32 @isfluid(i32 %51)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %80
54: ; preds = %45
%55 = load double**, double*** %35
%56 = getelementptr inbounds double*, double** %55, i64 %42
%57 = load double*, double** %56
%58 = getelementptr inbounds double, double* %57, i64 %46
store double 0.000000e+00, double* %58
%59 = load double**, double*** %37
%60 = getelementptr inbounds double*, double** %59, i64 %42
%61 = load double*, double** %60
%62 = getelementptr inbounds double, double* %61, i64 %46
store double 0.000000e+00, double* %62
%63 = load double**, double*** %38
%64 = getelementptr inbounds double*, double** %63, i64 %42
%65 = load double*, double** %64
%66 = getelementptr inbounds double, double* %65, i64 %46
store double 0.000000e+00, double* %66
%67 = getelementptr inbounds double*, double** %63, i64 %44
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 %46
store double 0.000000e+00, double* %69
%70 = load double**, double*** %39
%71 = getelementptr inbounds double*, double** %70, i64 %42
%72 = load double*, double** %71
%73 = add nsw i64 %46, -1
%74 = getelementptr inbounds double, double* %72, i64 %73
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %75
%76 = load double**, double*** %40
%77 = getelementptr inbounds double*, double** %76, i64 %42
%78 = load double*, double** %77
%79 = getelementptr inbounds double, double* %78, i64 %46
store double 0.000000e+00, double* %79
br label %80
80: ; preds = %45, %54
%81 = add nuw nsw i64 %46, 1
%82 = icmp eq i64 %81, %30
br i1 %82, label %83, label %45
83: ; preds = %80, %41
%84 = add nuw nsw i64 %42, 1
%85 = icmp eq i64 %84, %29
br i1 %85, label %86, label %41
86: ; preds = %83, %31
%87 = add nuw nsw i64 %32, 1
%88 = icmp eq i64 %87, %28
br i1 %88, label %89, label %31
89: ; preds = %86, %13
%90 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %97, label %92
92: ; preds = %89
%93 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%94 = icmp ne i64 %93, 0
%95 = icmp slt i32 %5, -1
%96 = or i1 %94, %95
br i1 %96, label %135, label %99
97: ; preds = %89
%98 = icmp slt i32 %5, -1
br i1 %98, label %135, label %99
99: ; preds = %92, %97
%100 = icmp slt i32 %6, -1
%101 = sitofp i32 %7 to double
%102 = fmul double %101, 5.000000e-01
%103 = fcmp ult double %102, 0.000000e+00
%104 = call i32 @llvm.smax.i32(i32 %15, i32 0)
%105 = add nuw i32 %104, 1
%106 = call i32 @llvm.smax.i32(i32 %14, i32 0)
%107 = add nuw i32 %106, 1
%108 = zext i32 %107 to i64
%109 = zext i32 %105 to i64
br label %110
110: ; preds = %99, %132
%111 = phi i64 [ 0, %99 ], [ %133, %132 ]
br i1 %100, label %132, label %112
112: ; preds = %110
%113 = getelementptr inbounds double**, double*** %8, i64 %111
br label %114
114: ; preds = %112, %129
%115 = phi i64 [ 0, %112 ], [ %130, %129 ]
br i1 %103, label %129, label %116
116: ; preds = %114
%117 = load double**, double*** %113
%118 = getelementptr inbounds double*, double** %117, i64 %115
%119 = load double*, double** %118
br label %120
120: ; preds = %116, %120
%121 = phi i64 [ 0, %116 ], [ %125, %120 ]
%122 = getelementptr inbounds double, double* %119, i64 %121
%123 = load double, double* %122
%124 = fmul double %123, 5.000000e-01
store double %124, double* %122
%125 = add nuw i64 %121, 1
%126 = trunc i64 %125 to i32
%127 = sitofp i32 %126 to double
%128 = fcmp ult double %102, %127
br i1 %128, label %129, label %120
129: ; preds = %120, %114
%130 = add nuw nsw i64 %115, 1
%131 = icmp eq i64 %130, %109
br i1 %131, label %132, label %114
132: ; preds = %129, %110
%133 = add nuw nsw i64 %111, 1
%134 = icmp eq i64 %133, %108
br i1 %134, label %135, label %110
135: ; preds = %132, %97, %92
ret void
}