#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errhandler(int, char *, char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
double getValidValue(double);
scalar_t__ isboundary(int);
scalar_t__ isfluid(int);
scalar_t__ issurface(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, ...);
int /*<<< orphan*/ write_vtkHeader_debug(int /*<<< orphan*/ *, int, int, int,
                                         double, double, double);
int /*<<< orphan*/ write_vtkPointCoordinates_debug(int /*<<< orphan*/ *, int,
                                                   int, int, double, double,
                                                   double);
void write_vtkFile_debug(const char *szProblem, int timeStepNumber,
                         double xlength, double ylength, double zlength,
                         int imax, int jmax, int kmax, double dx, double dy,
                         double dz, double ***U, double ***V, double ***W,
                         double ***P, int ***Flag) {
  int i, j, k;
  double uVel, vVel, wVel;
  char szFileName[80];
  FILE *fp = NULL;
  sprintf(szFileName, "simulation/%s.%i_debug.vtk", szProblem, timeStepNumber);
  fp = fopen(szFileName, "w");
  if (fp == NULL) {
    char szBuff[80];
    sprintf(szBuff, "Failed to open %s", szFileName);
    errhandler(92,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/"
               "master/FinalProject/visual.c",
               szBuff);
    return;
  }
  write_vtkHeader_debug(fp, imax, jmax, kmax, dx, dy, dz);
  write_vtkPointCoordinates_debug(fp, imax, jmax, kmax, dx, dy, dz);
  fprintf(fp, "POINT_DATA %i \n", (imax + 3) * (jmax + 3) * (kmax + 3));
  fprintf(fp, "\n");
  fprintf(fp, "VECTORS velocity float\n");
  for (k = -1; k < kmax + 2; k++) {
    for (j = -1; j < jmax + 2; j++) {
      for (i = -1; i < imax + 2; i++) {
        if (i >= 0 && j >= 0 && k >= 0 && i < imax + 1 && j < jmax + 1 &&
            k < kmax + 1) {
          uVel = getValidValue((U[i][j][k] + U[i][j + 1][k] + U[i][j][k + 1] +
                                U[i][j + 1][k + 1]) *
                               0.25);
          vVel = getValidValue((V[i][j][k] + V[i + 1][j][k] + V[i][j][k + 1] +
                                V[i + 1][j][k + 1]) *
                               0.25);
          wVel = getValidValue((W[i][j][k] + W[i + 1][j][k] + W[i][j + 1][k] +
                                W[i + 1][j + 1][k]) *
                               0.25);
          fprintf(fp, "%f %f %f\n", uVel, vVel, wVel);
        } else {
          fprintf(fp, "0 0 0\n");
        }
      }
    }
  }
  fprintf(fp, "\n");
  fprintf(fp, "CELL_DATA %i \n", ((imax + 2) * (jmax + 2) * (kmax + 2)));
  fprintf(fp, "SCALARS pressure float 1 \n");
  fprintf(fp, "LOOKUP_TABLE default \n");
  for (k = 0; k < kmax + 2; k++) {
    for (j = 0; j < jmax + 2; j++) {
      for (i = 0; i < imax + 2; i++) {
        if (P[i][j][k] == 0) {
          fprintf(fp, "-5\n");
        } else {
          fprintf(fp, "%f\n", getValidValue(P[i][j][k]));
        }
      }
    }
  }
  fprintf(fp, "\n");
  fprintf(fp, "SCALARS flag short 1 \n");
  fprintf(fp, "LOOKUP_TABLE default \n");
  for (k = 0; k < kmax + 2; k++) {
    for (j = 0; j < jmax + 2; j++) {
      for (i = 0; i < imax + 2; i++) {
        if (isfluid(Flag[i][j][k])) {
          if (issurface(Flag[i][j][k])) {
            fprintf(fp, "2\n");
          } else {
            fprintf(fp, "1\n");
          }
        } else if (isboundary(Flag[i][j][k])) {
          fprintf(fp, "3\n");
        } else
          fprintf(fp, "0\n");
      }
    }
  }
  if (fclose(fp)) {
    char szBuff[80];
    sprintf(szBuff, "Failed to close %s", szFileName);
    errhandler(196,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/"
               "master/FinalProject/visual.c",
               szBuff);
  }
}


x86 assembly (clang, -O0):
<write_vtkFile_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
movsd  %xmm3,-0x40(%rbp)
movsd  %xmm4,-0x48(%rbp)
movsd  %xmm5,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movq   $0x0,-0xd8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0xd8(%rbp)
cmpq   $0x0,-0xd8(%rbp)
jne    1286 <write_vtkFile_debug+0xd6>
lea    -0x130(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x130(%rbp),%rdx
mov    $0x5c,%edi
lea    0xdbb(%rip),%rsi
call   1040 <errhandler@plt>
jmp    197b <write_vtkFile_debug+0x7cb>
mov    -0xd8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
call   1060 <write_vtkHeader_debug@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
call   1080 <write_vtkPointCoordinates_debug@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x3,%edx
mov    -0x30(%rbp),%eax
add    $0x3,%eax
imul   %eax,%edx
mov    -0x34(%rbp),%eax
add    $0x3,%eax
imul   %eax,%edx
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    160f <write_vtkFile_debug+0x45f>
movl   $0xffffffff,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    15fc <write_vtkFile_debug+0x44c>
movl   $0xffffffff,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    15e9 <write_vtkFile_debug+0x439>
cmpl   $0x0,-0x5c(%rbp)
jl     15c1 <write_vtkFile_debug+0x411>
cmpl   $0x0,-0x60(%rbp)
jl     15c1 <write_vtkFile_debug+0x411>
cmpl   $0x0,-0x64(%rbp)
jl     15c1 <write_vtkFile_debug+0x411>
mov    -0x5c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    15c1 <write_vtkFile_debug+0x411>
mov    -0x60(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    15c1 <write_vtkFile_debug+0x411>
mov    -0x64(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    15c1 <write_vtkFile_debug+0x411>
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xbb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10c0 <getValidValue@plt>
movsd  %xmm0,-0x70(%rbp)
mov    0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xb14(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10c0 <getValidValue@plt>
movsd  %xmm0,-0x78(%rbp)
mov    0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xa76(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10c0 <getValidValue@plt>
movsd  %xmm0,-0x80(%rbp)
mov    -0xd8(%rbp),%rdi
movsd  -0x70(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
lea    0xb3a(%rip),%rsi
mov    $0x3,%al
call   1090 <fprintf@plt>
jmp    15d6 <write_vtkFile_debug+0x426>
mov    -0xd8(%rbp),%rdi
lea    0xb2a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    15db <write_vtkFile_debug+0x42b>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    135c <write_vtkFile_debug+0x1ac>
jmp    15ee <write_vtkFile_debug+0x43e>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1344 <write_vtkFile_debug+0x194>
jmp    1601 <write_vtkFile_debug+0x451>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    132c <write_vtkFile_debug+0x17c>
mov    -0xd8(%rbp),%rdi
lea    0xb0b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x2c(%rbp),%edx
add    $0x2,%edx
mov    -0x30(%rbp),%eax
add    $0x2,%eax
imul   %eax,%edx
mov    -0x34(%rbp),%eax
add    $0x2,%eax
imul   %eax,%edx
lea    0xab6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0xab0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0xab6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    178b <write_vtkFile_debug+0x5db>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1778 <write_vtkFile_debug+0x5c8>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1765 <write_vtkFile_debug+0x5b5>
mov    0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    170d <write_vtkFile_debug+0x55d>
jp     170d <write_vtkFile_debug+0x55d>
mov    -0xd8(%rbp),%rdi
lea    0xa40(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1752 <write_vtkFile_debug+0x5a2>
mov    -0xd8(%rbp),%rax
mov    %rax,-0x188(%rbp)
mov    0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10c0 <getValidValue@plt>
mov    -0x188(%rbp),%rdi
lea    0x9aa(%rip),%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
jmp    1757 <write_vtkFile_debug+0x5a7>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    16b2 <write_vtkFile_debug+0x502>
jmp    176a <write_vtkFile_debug+0x5ba>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    169a <write_vtkFile_debug+0x4ea>
jmp    177d <write_vtkFile_debug+0x5cd>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1682 <write_vtkFile_debug+0x4d2>
mov    -0xd8(%rbp),%rdi
lea    0x98f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0x997(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
lea    0x967(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1931 <write_vtkFile_debug+0x781>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    191e <write_vtkFile_debug+0x76e>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    190b <write_vtkFile_debug+0x75b>
mov    0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <isfluid@plt>
cmp    $0x0,%rax
je     189a <write_vtkFile_debug+0x6ea>
mov    0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1070 <issurface@plt>
cmp    $0x0,%rax
je     1880 <write_vtkFile_debug+0x6d0>
mov    -0xd8(%rbp),%rdi
lea    0x8e8(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1895 <write_vtkFile_debug+0x6e5>
mov    -0xd8(%rbp),%rdi
lea    0x8d1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    18f8 <write_vtkFile_debug+0x748>
mov    0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   10a0 <isboundary@plt>
cmp    $0x0,%rax
je     18de <write_vtkFile_debug+0x72e>
mov    -0xd8(%rbp),%rdi
lea    0x890(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    18f3 <write_vtkFile_debug+0x743>
mov    -0xd8(%rbp),%rdi
lea    0x811(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    18f8 <write_vtkFile_debug+0x748>
jmp    18fd <write_vtkFile_debug+0x74d>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1801 <write_vtkFile_debug+0x651>
jmp    1910 <write_vtkFile_debug+0x760>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    17e9 <write_vtkFile_debug+0x639>
jmp    1923 <write_vtkFile_debug+0x773>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    17d1 <write_vtkFile_debug+0x621>
mov    -0xd8(%rbp),%rdi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     197b <write_vtkFile_debug+0x7cb>
lea    -0x180(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
lea    0x809(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x180(%rbp),%rdx
mov    $0xc4,%edi
lea    0x6c1(%rip),%rsi
call   1040 <errhandler@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_vtkFile_debug>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r9,0x50(%rsp)
movsd  %xmm5,(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
mov    %r8d,%r13d
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xe04(%rip),%rsi
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0xe09(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1510 <write_vtkFile_debug+0x340>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %r13d,%ecx
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1060 <write_vtkHeader_debug@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %r13d,%ecx
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1090 <write_vtkPointCoordinates_debug@plt>
lea    0x3(%r15),%eax
lea    0x3(%r14),%ecx
imul   %eax,%ecx
lea    0x3(%r13),%edx
imul   %ecx,%edx
lea    0xe3c(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
lea    0xe2e(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
lea    0x2(%r13),%eax
cmp    $0xfffffffd,%r13d
mov    %rbx,(%rsp)
mov    %r14,0x28(%rsp)
mov    %r15,0x30(%rsp)
mov    %r13,0x40(%rsp)
mov    %eax,0x24(%rsp)
jle    153f <write_vtkFile_debug+0x36f>
mov    %eax,%ecx
xor    %edx,%edx
movslq %r15d,%rax
mov    %rax,0x68(%rsp)
lea    0x2(%r15),%eax
mov    %rax,0x8(%rsp)
movslq %r14d,%rax
mov    %rax,0x60(%rsp)
lea    0x2(%r14),%eax
mov    %rax,0x10(%rsp)
movslq %r13d,%rax
mov    %rax,0x58(%rsp)
test   %ecx,%ecx
cmovg  %ecx,%edx
mov    %rdx,0x48(%rsp)
mov    $0xffffffffffffffff,%rbp
jmp    1342 <write_vtkFile_debug+0x172>
nopl   0x0(%rax)
add    $0x1,%rbp
mov    %rbp,%r12
cmp    0x48(%rsp),%r12
je     14ff <write_vtkFile_debug+0x32f>
cmp    $0xfffffffd,%r14d
jle    1330 <write_vtkFile_debug+0x160>
lea    0x1(%rbp),%r12
mov    $0xffffffffffffffff,%r14
jmp    1372 <write_vtkFile_debug+0x1a2>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r14
mov    %r14,%r13
cmp    0x10(%rsp),%r13
je     14ec <write_vtkFile_debug+0x31c>
cmp    $0xfffffffd,%r15d
jle    1360 <write_vtkFile_debug+0x190>
lea    0x1(%r14),%r13
mov    $0xffffffffffffffff,%r15
jmp    13b8 <write_vtkFile_debug+0x1e8>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xd60(%rip),%rdi
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
add    $0x1,%r15
cmp    0x8(%rsp),%r15
je     14d9 <write_vtkFile_debug+0x309>
test   %r15,%r15
js     1390 <write_vtkFile_debug+0x1c0>
test   %r14,%r14
js     1390 <write_vtkFile_debug+0x1c0>
test   %rbp,%rbp
js     1390 <write_vtkFile_debug+0x1c0>
cmp    0x68(%rsp),%r15
jg     1390 <write_vtkFile_debug+0x1c0>
cmp    0x60(%rsp),%r14
jg     1390 <write_vtkFile_debug+0x1c0>
cmp    0x58(%rsp),%rbp
jg     1390 <write_vtkFile_debug+0x1c0>
mov    0x50(%rsp),%rax
mov    (%rax,%r15,8),%rax
mov    (%rax,%r14,8),%rcx
mov    0x8(%rax,%r14,8),%rax
movsd  (%rcx,%rbp,8),%xmm0
addsd  (%rax,%rbp,8),%xmm0
addsd  0x8(%rcx,%rbp,8),%xmm0
addsd  0x8(%rax,%rbp,8),%xmm0
movsd  0xbf4(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10d0 <getValidValue@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x150(%rsp),%rcx
mov    (%rcx,%r15,8),%rax
mov    0x8(%rcx,%r15,8),%rcx
mov    (%rax,%r14,8),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    (%rcx,%r14,8),%rcx
addsd  (%rcx,%rbp,8),%xmm0
addsd  0x8(%rax,%rbp,8),%xmm0
lea    0x1(%r15),%rbx
addsd  0x8(%rcx,%rbp,8),%xmm0
mulsd  0xbaa(%rip),%xmm0
call   10d0 <getValidValue@plt>
movsd  %xmm0,0x38(%rsp)
mov    0x158(%rsp),%rcx
mov    (%rcx,%r15,8),%rax
mov    0x8(%rcx,%r15,8),%rcx
mov    (%rax,%r14,8),%rdx
mov    0x8(%rax,%r14,8),%rax
movsd  (%rdx,%rbp,8),%xmm0
mov    (%rcx,%r14,8),%rdx
addsd  (%rdx,%rbp,8),%xmm0
addsd  (%rax,%rbp,8),%xmm0
mov    0x8(%rcx,%r14,8),%rax
addsd  (%rax,%rbp,8),%xmm0
mulsd  0xb60(%rip),%xmm0
call   10d0 <getValidValue@plt>
movapd %xmm0,%xmm2
mov    (%rsp),%rdi
lea    0xc43(%rip),%rsi
movsd  0x18(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mov    $0x3,%al
call   10a0 <fprintf@plt>
mov    %rbx,%r15
mov    (%rsp),%rbx
cmp    0x8(%rsp),%r15
jne    13b8 <write_vtkFile_debug+0x1e8>
mov    %r13,%r14
mov    0x30(%rsp),%r15
cmp    0x10(%rsp),%r13
jne    1372 <write_vtkFile_debug+0x1a2>
mov    %r12,%rbp
mov    0x28(%rsp),%r14
cmp    0x48(%rsp),%r12
jne    1342 <write_vtkFile_debug+0x172>
mov    0x8(%rsp),%r12
mov    0x10(%rsp),%rbp
mov    0x40(%rsp),%r13
jmp    1547 <write_vtkFile_debug+0x377>
lea    0xb16(%rip),%rsi
lea    0xc0(%rsp),%rbx
lea    0x70(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0xb0a(%rip),%rsi
mov    $0x5c,%edi
jmp    1872 <write_vtkFile_debug+0x6a2>
lea    0x2(%r15),%r12d
lea    0x2(%r14),%ebp
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
mov    %rbp,0x10(%rsp)
mov    %ebp,%edx
mov    %r12,%rbp
imul   %r12d,%edx
mov    0x24(%rsp),%r12d
imul   %r12d,%edx
lea    0xb96(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xb94(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
lea    0xb96(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
cmp    $0xffffffff,%r13d
jl     16a2 <write_vtkFile_debug+0x4d2>
mov    0x160(%rsp),%r15
mov    %rbp,%rax
cmp    $0x2,%eax
mov    $0x1,%ebp
mov    %rax,0x8(%rsp)
cmovge %eax,%ebp
mov    0x10(%rsp),%rcx
cmp    $0x2,%ecx
mov    $0x1,%eax
cmovge %ecx,%eax
mov    %rax,0x18(%rsp)
mov    $0x1,%eax
cmp    $0x2,%r12d
cmovge %r12d,%eax
mov    %rax,0x38(%rsp)
xor    %r13d,%r13d
lea    0xb45(%rip),%r14
jmp    161f <write_vtkFile_debug+0x44f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    0x38(%rsp),%r13
je     16e6 <write_vtkFile_debug+0x516>
cmpl   $0xffffffff,0x28(%rsp)
jl     1610 <write_vtkFile_debug+0x440>
xor    %ebx,%ebx
jmp    163b <write_vtkFile_debug+0x46b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    0x18(%rsp),%rbx
je     1610 <write_vtkFile_debug+0x440>
cmpl   $0xffffffff,0x30(%rsp)
jl     1630 <write_vtkFile_debug+0x460>
xor    %r12d,%r12d
jmp    1670 <write_vtkFile_debug+0x4a0>
nopw   0x0(%rax,%rax,1)
call   10d0 <getValidValue@plt>
mov    (%rsp),%rdi
lea    0xa9d(%rip),%rsi
mov    $0x1,%al
call   10a0 <fprintf@plt>
add    $0x1,%r12
cmp    %r12,%rbp
je     1630 <write_vtkFile_debug+0x460>
mov    (%r15,%r12,8),%rax
mov    (%rax,%rbx,8),%rax
movsd  (%rax,%r13,8),%xmm0
ucomisd 0x982(%rip),%xmm0
jne    1650 <write_vtkFile_debug+0x480>
jp     1650 <write_vtkFile_debug+0x480>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    (%rsp),%rcx
call   10f0 <fwrite@plt>
jmp    1667 <write_vtkFile_debug+0x497>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
lea    0xa97(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
lea    0xa63(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
jmp    183a <write_vtkFile_debug+0x66a>
mov    $0xa,%edi
mov    (%rsp),%rbx
mov    %rbx,%rsi
call   1070 <fputc@plt>
lea    0xa4f(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
lea    0xa1b(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
cmpl   $0xffffffff,0x40(%rsp)
jl     183a <write_vtkFile_debug+0x66a>
mov    0x8(%rsp),%r12
cmp    $0x2,%r12d
mov    $0x1,%ecx
cmovl  %ecx,%r12d
mov    0x10(%rsp),%rax
cmp    $0x2,%eax
cmovl  %ecx,%eax
mov    %rax,0x10(%rsp)
mov    0x24(%rsp),%eax
cmp    $0x2,%eax
cmovge %eax,%ecx
mov    %rcx,0x8(%rsp)
xor    %r13d,%r13d
lea    0x9f8(%rip),%r14
jmp    178f <write_vtkFile_debug+0x5bf>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    0x8(%rsp),%r13
je     183a <write_vtkFile_debug+0x66a>
cmpl   $0xffffffff,0x28(%rsp)
jl     1780 <write_vtkFile_debug+0x5b0>
xor    %ebx,%ebx
jmp    17ab <write_vtkFile_debug+0x5db>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    0x10(%rsp),%rbx
je     1780 <write_vtkFile_debug+0x5b0>
cmpl   $0xffffffff,0x30(%rsp)
jl     17a0 <write_vtkFile_debug+0x5d0>
xor    %ebp,%ebp
jmp    17dc <write_vtkFile_debug+0x60c>
cs nopw 0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
mov    (%rsp),%rcx
call   10f0 <fwrite@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
je     17a0 <write_vtkFile_debug+0x5d0>
mov    0x168(%rsp),%r15
mov    (%r15,%rbp,8),%rax
mov    (%rax,%rbx,8),%rax
mov    (%rax,%r13,4),%edi
call   1030 <isfluid@plt>
mov    (%r15,%rbp,8),%rcx
mov    (%rcx,%rbx,8),%rcx
mov    (%rcx,%r13,4),%edi
test   %rax,%rax
je     1820 <write_vtkFile_debug+0x650>
call   1080 <issurface@plt>
mov    %r14,%rdi
test   %rax,%rax
je     17c0 <write_vtkFile_debug+0x5f0>
lea    0x94a(%rip),%rdi
jmp    17c0 <write_vtkFile_debug+0x5f0>
nopl   0x0(%rax)
call   10b0 <isboundary@plt>
lea    0x8d9(%rip),%rdi
test   %rax,%rax
je     17c0 <write_vtkFile_debug+0x5f0>
lea    0x932(%rip),%rdi
jmp    17c0 <write_vtkFile_debug+0x5f0>
mov    (%rsp),%rdi
call   1050 <fclose@plt>
test   %rax,%rax
je     187a <write_vtkFile_debug+0x6aa>
lea    0x91e(%rip),%rsi
lea    0xc0(%rsp),%rbx
lea    0x70(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10e0 <sprintf@plt>
lea    0x7d2(%rip),%rsi
mov    $0xc4,%edi
mov    %rbx,%rdx
call   1040 <errhandler@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"simulation/%s.%i_debug.vtk\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [18 x i8] c"Failed to open %s\00"
@.str.3 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/FinalProject/visual.c\00"
@.str.4 = [16 x i8] c"POINT_DATA %i \0A\00"
@.str.6 = [24 x i8] c"VECTORS velocity float\0A\00"
@.str.7 = [10 x i8] c"%f %f %f\0A\00"
@.str.8 = [7 x i8] c"0 0 0\0A\00"
@.str.9 = [15 x i8] c"CELL_DATA %i \0A\00"
@.str.10 = [27 x i8] c"SCALARS pressure float 1 \0A\00"
@.str.11 = [23 x i8] c"LOOKUP_TABLE default \0A\00"
@.str.12 = [4 x i8] c"-5\0A\00"
@.str.13 = [4 x i8] c"%f\0A\00"
@.str.14 = [23 x i8] c"SCALARS flag short 1 \0A\00"
@.str.15 = [3 x i8] c"2\0A\00"
@.str.16 = [3 x i8] c"1\0A\00"
@.str.17 = [3 x i8] c"3\0A\00"
@.str.18 = [3 x i8] c"0\0A\00"
@.str.19 = [19 x i8] c"Failed to close %s\00"
define void @write_vtkFile_debug(i8* %0, i32 %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, double %8, double %9, double %10, double*** nocapture %11, double*** nocapture %12, double*** nocapture %13, double*** nocapture %14, i32*** nocapture %15) {
%17 = alloca [80 x i8]
%18 = alloca [80 x i8]
%19 = alloca [80 x i8]
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %17, i64 0, i64 0
%21 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %20, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%22 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %18, i64 0, i64 0
%26 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %25, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%27 = call i32 @errhandler(i32 92, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.3, i64 0, i64 0), i8* %25)
br label %269
28: ; preds = %16
%29 = tail call i32 @write_vtkHeader_debug(i32* %22, i32 %5, i32 %6, i32 %7, double %8, double %9, double %10)
%30 = tail call i32 @write_vtkPointCoordinates_debug(i32* %22, i32 %5, i32 %6, i32 %7, double %8, double %9, double %10)
%31 = add nsw i32 %5, 3
%32 = add nsw i32 %6, 3
%33 = mul nsw i32 %32, %31
%34 = add nsw i32 %7, 3
%35 = mul nsw i32 %33, %34
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = tail call i32 @fputc(i32 10, i32* %22)
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 23, i64 1, i32* %22)
%39 = add i32 %7, 2
%40 = icmp sgt i32 %7, -3
br i1 %40, label %44, label %41
41: ; preds = %28
%42 = add nsw i32 %5, 2
%43 = add nsw i32 %6, 2
br label %161
44: ; preds = %28
%45 = icmp sgt i32 %6, -3
%46 = icmp sgt i32 %5, -3
%47 = sext i32 %5 to i64
%48 = add i32 %5, 2
%49 = sext i32 %6 to i64
%50 = add i32 %6, 2
%51 = sext i32 %7 to i64
%52 = call i32 @llvm.smax.i32(i32 %39, i32 0)
%53 = zext i32 %52 to i64
%54 = zext i32 %50 to i64
%55 = zext i32 %48 to i64
br label %56
56: ; preds = %44, %158
%57 = phi i64 [ -1, %44 ], [ %159, %158 ]
br i1 %45, label %60, label %58
58: ; preds = %56
%59 = add nsw i64 %57, 1
br label %158
60: ; preds = %56
%61 = icmp slt i64 %57, 0
%62 = icmp sgt i64 %57, %51
%63 = add nsw i64 %57, 1
br label %64
64: ; preds = %60, %155
%65 = phi i64 [ -1, %60 ], [ %156, %155 ]
br i1 %46, label %68, label %66
66: ; preds = %64
%67 = add nsw i64 %65, 1
br label %155
68: ; preds = %64
%69 = icmp slt i64 %65, 0
%70 = icmp sgt i64 %65, %49
%71 = add nsw i64 %65, 1
br label %72
72: ; preds = %68, %152
%73 = phi i64 [ -1, %68 ], [ %153, %152 ]
%74 = icmp slt i64 %73, 0
%75 = select i1 %74, i1 true, i1 %69
%76 = select i1 %75, i1 true, i1 %61
%77 = icmp sgt i64 %73, %47
%78 = select i1 %76, i1 true, i1 %77
%79 = select i1 %78, i1 true, i1 %70
%80 = select i1 %79, i1 true, i1 %62
br i1 %80, label %149, label %81
81: ; preds = %72
%82 = getelementptr inbounds double**, double*** %11, i64 %73
%83 = load double**, double*** %82
%84 = getelementptr inbounds double*, double** %83, i64 %65
%85 = load double*, double** %84
%86 = getelementptr inbounds double, double* %85, i64 %57
%87 = load double, double* %86
%88 = getelementptr inbounds double*, double** %83, i64 %71
%89 = load double*, double** %88
%90 = getelementptr inbounds double, double* %89, i64 %57
%91 = load double, double* %90
%92 = fadd double %87, %91
%93 = getelementptr inbounds double, double* %85, i64 %63
%94 = load double, double* %93
%95 = fadd double %92, %94
%96 = getelementptr inbounds double, double* %89, i64 %63
%97 = load double, double* %96
%98 = fadd double %95, %97
%99 = fmul double %98, 2.500000e-01
%100 = tail call double @getValidValue(double %99)
%101 = getelementptr inbounds double**, double*** %12, i64 %73
%102 = load double**, double*** %101
%103 = getelementptr inbounds double*, double** %102, i64 %65
%104 = load double*, double** %103
%105 = getelementptr inbounds double, double* %104, i64 %57
%106 = load double, double* %105
%107 = add nuw nsw i64 %73, 1
%108 = getelementptr inbounds double**, double*** %12, i64 %107
%109 = load double**, double*** %108
%110 = getelementptr inbounds double*, double** %109, i64 %65
%111 = load double*, double** %110
%112 = getelementptr inbounds double, double* %111, i64 %57
%113 = load double, double* %112
%114 = fadd double %106, %113
%115 = getelementptr inbounds double, double* %104, i64 %63
%116 = load double, double* %115
%117 = fadd double %114, %116
%118 = getelementptr inbounds double, double* %111, i64 %63
%119 = load double, double* %118
%120 = fadd double %117, %119
%121 = fmul double %120, 2.500000e-01
%122 = tail call double @getValidValue(double %121)
%123 = getelementptr inbounds double**, double*** %13, i64 %73
%124 = load double**, double*** %123
%125 = getelementptr inbounds double*, double** %124, i64 %65
%126 = load double*, double** %125
%127 = getelementptr inbounds double, double* %126, i64 %57
%128 = load double, double* %127
%129 = getelementptr inbounds double**, double*** %13, i64 %107
%130 = load double**, double*** %129
%131 = getelementptr inbounds double*, double** %130, i64 %65
%132 = load double*, double** %131
%133 = getelementptr inbounds double, double* %132, i64 %57
%134 = load double, double* %133
%135 = fadd double %128, %134
%136 = getelementptr inbounds double*, double** %124, i64 %71
%137 = load double*, double** %136
%138 = getelementptr inbounds double, double* %137, i64 %57
%139 = load double, double* %138
%140 = fadd double %135, %139
%141 = getelementptr inbounds double*, double** %130, i64 %71
%142 = load double*, double** %141
%143 = getelementptr inbounds double, double* %142, i64 %57
%144 = load double, double* %143
%145 = fadd double %140, %144
%146 = fmul double %145, 2.500000e-01
%147 = tail call double @getValidValue(double %146)
%148 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %100, double %122, double %147)
br label %152
149: ; preds = %72
%150 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 6, i64 1, i32* %22)
%151 = add nsw i64 %73, 1
br label %152
152: ; preds = %81, %149
%153 = phi i64 [ %107, %81 ], [ %151, %149 ]
%154 = icmp eq i64 %153, %55
br i1 %154, label %155, label %72
155: ; preds = %152, %66
%156 = phi i64 [ %67, %66 ], [ %71, %152 ]
%157 = icmp eq i64 %156, %54
br i1 %157, label %158, label %64
158: ; preds = %155, %58
%159 = phi i64 [ %59, %58 ], [ %63, %155 ]
%160 = icmp eq i64 %159, %53
br i1 %160, label %161, label %56
161: ; preds = %158, %41
%162 = phi i32 [ %43, %41 ], [ %50, %158 ]
%163 = phi i32 [ %42, %41 ], [ %48, %158 ]
%164 = tail call i32 @fputc(i32 10, i32* %22)
%165 = mul nsw i32 %162, %163
%166 = mul nsw i32 %165, %39
%167 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %166)
%168 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i64 26, i64 1, i32* %22)
%169 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i64 22, i64 1, i32* %22)
%170 = icmp sgt i32 %7, -2
br i1 %170, label %171, label %258
171: ; preds = %161
%172 = icmp sgt i32 %6, -2
%173 = icmp sgt i32 %5, -2
%174 = call i32 @llvm.smax.i32(i32 %163, i32 1)
%175 = call i32 @llvm.smax.i32(i32 %162, i32 1)
%176 = call i32 @llvm.smax.i32(i32 %39, i32 1)
%177 = zext i32 %176 to i64
%178 = zext i32 %175 to i64
%179 = zext i32 %174 to i64
br label %180
180: ; preds = %171, %204
%181 = phi i64 [ 0, %171 ], [ %205, %204 ]
br i1 %172, label %182, label %204
182: ; preds = %180, %201
%183 = phi i64 [ %202, %201 ], [ 0, %180 ]
br i1 %173, label %184, label %201
184: ; preds = %182, %198
%185 = phi i64 [ %199, %198 ], [ 0, %182 ]
%186 = getelementptr inbounds double**, double*** %14, i64 %185
%187 = load double**, double*** %186
%188 = getelementptr inbounds double*, double** %187, i64 %183
%189 = load double*, double** %188
%190 = getelementptr inbounds double, double* %189, i64 %181
%191 = load double, double* %190
%192 = fcmp oeq double %191, 0.000000e+00
br i1 %192, label %193, label %195
193: ; preds = %184
%194 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 3, i64 1, i32* %22)
br label %198
195: ; preds = %184
%196 = tail call double @getValidValue(double %191)
%197 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), double %196)
br label %198
198: ; preds = %193, %195
%199 = add nuw nsw i64 %185, 1
%200 = icmp eq i64 %199, %179
br i1 %200, label %201, label %184
201: ; preds = %198, %182
%202 = add nuw nsw i64 %183, 1
%203 = icmp eq i64 %202, %178
br i1 %203, label %204, label %182
204: ; preds = %201, %180
%205 = add nuw nsw i64 %181, 1
%206 = icmp eq i64 %205, %177
br i1 %206, label %207, label %180
207: ; preds = %204
%208 = tail call i32 @fputc(i32 10, i32* %22)
%209 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i64 22, i64 1, i32* %22)
%210 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i64 22, i64 1, i32* %22)
br i1 %170, label %211, label %262
211: ; preds = %207
%212 = icmp sgt i32 %6, -2
%213 = icmp sgt i32 %5, -2
%214 = call i32 @llvm.smax.i32(i32 %163, i32 1)
%215 = call i32 @llvm.smax.i32(i32 %162, i32 1)
%216 = call i32 @llvm.smax.i32(i32 %39, i32 1)
%217 = zext i32 %216 to i64
%218 = zext i32 %215 to i64
%219 = zext i32 %214 to i64
br label %220
220: ; preds = %211, %255
%221 = phi i64 [ 0, %211 ], [ %256, %255 ]
br i1 %212, label %222, label %255
222: ; preds = %220, %252
%223 = phi i64 [ %253, %252 ], [ 0, %220 ]
br i1 %213, label %224, label %252
224: ; preds = %222, %247
%225 = phi i64 [ %250, %247 ], [ 0, %222 ]
%226 = getelementptr inbounds i32**, i32*** %15, i64 %225
%227 = load i32**, i32*** %226
%228 = getelementptr inbounds i32*, i32** %227, i64 %223
%229 = load i32*, i32** %228
%230 = getelementptr inbounds i32, i32* %229, i64 %221
%231 = load i32, i32* %230
%232 = tail call i64 @isfluid(i32 %231)
%233 = icmp eq i64 %232, 0
%234 = load i32**, i32*** %226
%235 = getelementptr inbounds i32*, i32** %234, i64 %223
%236 = load i32*, i32** %235
%237 = getelementptr inbounds i32, i32* %236, i64 %221
%238 = load i32, i32* %237
br i1 %233, label %243, label %239
239: ; preds = %224
%240 = tail call i64 @issurface(i32 %238)
%241 = icmp eq i64 %240, 0
%242 = select i1 %241, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
br label %247
243: ; preds = %224
%244 = tail call i64 @isboundary(i32 %238)
%245 = icmp eq i64 %244, 0
%246 = select i1 %245, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0)
br label %247
247: ; preds = %243, %239
%248 = phi i8* [ %242, %239 ], [ %246, %243 ]
%249 = tail call i64 @fwrite(i8* %248, i64 2, i64 1, i32* %22)
%250 = add nuw nsw i64 %225, 1
%251 = icmp eq i64 %250, %219
br i1 %251, label %252, label %224
252: ; preds = %247, %222
%253 = add nuw nsw i64 %223, 1
%254 = icmp eq i64 %253, %218
br i1 %254, label %255, label %222
255: ; preds = %252, %220
%256 = add nuw nsw i64 %221, 1
%257 = icmp eq i64 %256, %217
br i1 %257, label %262, label %220
258: ; preds = %161
%259 = tail call i32 @fputc(i32 10, i32* %22)
%260 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i64 22, i64 1, i32* %22)
%261 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i64 22, i64 1, i32* %22)
br label %262
262: ; preds = %255, %258, %207
%263 = tail call i64 @fclose(i32* %22)
%264 = icmp eq i64 %263, 0
br i1 %264, label %269, label %265
265: ; preds = %262
%266 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%267 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %266, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i8* %20)
%268 = call i32 @errhandler(i32 196, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.3, i64 0, i64 0), i8* %266)
br label %269
269: ; preds = %262, %265, %24
ret void
}