#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*/ R_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errhandler(int, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_double(char *, char *, double *);
int /*<<< orphan*/ read_int(char *, char *, int *);
int **read_pgm(char *, int *, int *);
int /*<<< orphan*/ read_string(char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int readParameters(int *rotate_pgm_coordinates, int *obstacle_start,
                   int *obstacle_end, int ***pgm_data, double *density_ref,
                   double *density_in, int *boundaries, int *length,
                   double *tau, double *velocity_wall, int *timesteps,
                   int *timesteps_per_plotting, int argc, char *argv[]) {
  double *velocity_wall_1, *velocity_wall_2, *velocity_wall_3;
  int *xlength, *ylength, *zlength, *boundary_bottom, *boundary_top,
      *boundary_back, *boundary_front, *boundary_left, *boundary_right, x, y;
  char pgm_file_name[50], pgm_file_name_full[60] = "", file_name[50] = "";
  strcat(file_name, "data/");
  strcat(file_name, argv[1]);
  strcat(file_name, ".dat");
  printf("The data will be read from: %s\n", file_name);
  if (argc < 2)
    errhandler(
        17,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/heads/master/tum/"
        "computational-fluid-dynamics/ws3/initLB.c",
        "Not enough arguments. At least a path to init file is required.");
  if (access(file_name, R_OK) != 0)
    errhandler(19,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/"
               "heads/master/tum/computational-fluid-dynamics/ws3/initLB.c",
               "Provided file path either doesn't exist or can not be read.");
  read_int(file_name, "*rotate_pgm_coordinates", &(*rotate_pgm_coordinates));
  read_string(file_name, "pgm_file_name", (pgm_file_name));
  strcat(pgm_file_name_full, "data/");
  strcat(pgm_file_name_full, pgm_file_name);
  strcat(pgm_file_name_full, ".pgm");
  printf("PGM data will be read from: %s\n", pgm_file_name_full);
  if (*rotate_pgm_coordinates) {
    xlength = &length[1];
    ylength = &length[0];
  } else {
    xlength = &length[0];
    ylength = &length[1];
  }
  zlength = &length[2];
  *pgm_data = read_pgm(pgm_file_name_full, xlength, ylength);
  for (x = 1; x <= *xlength; x++) {
    for (y = 1; y <= *ylength; y++) {
      if ((*pgm_data)[x][y] == 2) {
        if (!((*pgm_data)[x + 1][y] == 2 || (*pgm_data)[x - 1][y] == 2 ||
              (*pgm_data)[x][y + 1] == 2 || (*pgm_data)[x][y - 1] == 2) &&
            ((*pgm_data)[x + 1][y + 1] == 2 || (*pgm_data)[x + 1][y - 1] == 2 ||
             (*pgm_data)[x - 1][y + 1] == 2 ||
             (*pgm_data)[x - 1][y - 1] == 2)) {
          printf("Problem with cell (%i,%i)", x, y);
          errhandler(
              53,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/heads/"
              "master/tum/computational-fluid-dynamics/ws3/initLB.c",
              "There some cells which are connected only with edges.");
        }
      }
    }
  }
  printf("PGM data is checked. Everything is fine!\n");
  read_int(file_name, "*zlength", &(*zlength));
  printf("xlength       = %i\n", *xlength);
  printf("ylength       = %i\n", *ylength);
  read_int(file_name, "*obstacle_start", &(*obstacle_start));
  read_int(file_name, "*obstacle_end", &(*obstacle_end));
  if (*obstacle_start > *zlength || *obstacle_start < 1)
    errhandler(65,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/"
               "heads/master/tum/computational-fluid-dynamics/ws3/initLB.c",
               "Obstacle start is outside of domain");
  if (*obstacle_end > *zlength || *obstacle_end < 1)
    errhandler(67,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/"
               "heads/master/tum/computational-fluid-dynamics/ws3/initLB.c",
               "Obstacle end is outside of domain");
  if (*obstacle_start > *obstacle_end)
    errhandler(69,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/"
               "heads/master/tum/computational-fluid-dynamics/ws3/initLB.c",
               "Wrong obstacle geometry: start > end");
  read_double(file_name, "*density_ref", &(*density_ref));
  read_double(file_name, "*density_in", &(*density_in));
  read_double(file_name, "*tau", &(*tau));
  boundary_bottom = &boundaries[0];
  boundary_top = &boundaries[1];
  boundary_back = &boundaries[2];
  boundary_front = &boundaries[3];
  boundary_left = &boundaries[4];
  boundary_right = &boundaries[5];
  read_int(file_name, "*boundary_bottom", &(*boundary_bottom));
  read_int(file_name, "*boundary_top", &(*boundary_top));
  read_int(file_name, "*boundary_back", &(*boundary_back));
  read_int(file_name, "*boundary_front", &(*boundary_front));
  read_int(file_name, "*boundary_left", &(*boundary_left));
  read_int(file_name, "*boundary_right", &(*boundary_right));
  velocity_wall_1 = &velocity_wall[0];
  velocity_wall_2 = &velocity_wall[1];
  velocity_wall_3 = &velocity_wall[2];
  read_double(file_name, "*velocity_wall_1", &(*velocity_wall_1));
  read_double(file_name, "*velocity_wall_2", &(*velocity_wall_2));
  read_double(file_name, "*velocity_wall_3", &(*velocity_wall_3));
  read_int(file_name, "*timesteps", &(*timesteps));
  read_int(file_name, "*timesteps_per_plotting", &(*timesteps_per_plotting));
  return 1;
}


x86 assembly (clang, -O0):
<readParameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x3c,%edx
call   1060 <memset@plt>
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1060 <memset@plt>
lea    -0x150(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x150(%rbp),%rdi
mov    0x48(%rbp),%rax
mov    0x8(%rax),%rsi
call   10a0 <strcat@plt>
lea    -0x150(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x150(%rbp),%rsi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x2,0x40(%rbp)
jge    1269 <readParameters+0xd9>
mov    $0x11,%edi
lea    0xdce(%rip),%rsi
lea    0xe77(%rip),%rdx
call   1030 <errhandler@plt>
lea    -0x150(%rbp),%rdi
mov    0x2d69(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
cmp    $0x0,%rax
je     12a0 <readParameters+0x110>
mov    $0x13,%edi
lea    0xd97(%rip),%rsi
lea    0xe80(%rip),%rdx
call   1030 <errhandler@plt>
lea    -0x150(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   10b0 <read_string@plt>
lea    -0x110(%rbp),%rdi
lea    0xd21(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x110(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1345 <readParameters+0x1b5>
mov    0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x50(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    1359 <readParameters+0x1c9>
mov    0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
mov    0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   1040 <read_pgm@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    -0x50(%rbp),%rcx
cmp    (%rcx),%eax
jg     159b <readParameters+0x40b>
movl   $0x1,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    -0x58(%rbp),%rcx
cmp    (%rcx),%eax
jg     1582 <readParameters+0x3f2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x98(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    1569 <readParameters+0x3d9>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x98(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1564 <readParameters+0x3d4>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x98(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1564 <readParameters+0x3d4>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1564 <readParameters+0x3d4>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1564 <readParameters+0x3d4>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1532 <readParameters+0x3a2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1532 <readParameters+0x3a2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
je     1532 <readParameters+0x3a2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    1564 <readParameters+0x3d4>
mov    -0x94(%rbp),%esi
mov    -0x98(%rbp),%edx
lea    0xc5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x35,%edi
lea    0xad3(%rip),%rsi
lea    0xc5d(%rip),%rdx
call   1030 <errhandler@plt>
jmp    1569 <readParameters+0x3d9>
jmp    156e <readParameters+0x3de>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    13a9 <readParameters+0x219>
jmp    1587 <readParameters+0x3f7>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    138d <readParameters+0x1fd>
lea    0xc50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x60(%rbp),%rdx
lea    0xc61(%rip),%rsi
call   1070 <read_int@plt>
mov    -0x50(%rbp),%rax
mov    (%rax),%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xc53(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xc4c(%rip),%rsi
call   1070 <read_int@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x60(%rbp),%rcx
cmp    (%rcx),%eax
jg     1635 <readParameters+0x4a5>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jge    164d <readParameters+0x4bd>
mov    $0x41,%edi
lea    0x9ea(%rip),%rsi
lea    0xc23(%rip),%rdx
call   1030 <errhandler@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x60(%rbp),%rcx
cmp    (%rcx),%eax
jg     166c <readParameters+0x4dc>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jge    1684 <readParameters+0x4f4>
mov    $0x43,%edi
lea    0x9b3(%rip),%rsi
lea    0xc10(%rip),%rdx
call   1030 <errhandler@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    16ae <readParameters+0x51e>
mov    $0x45,%edi
lea    0x989(%rip),%rsi
lea    0xc08(%rip),%rdx
call   1030 <errhandler@plt>
lea    -0x150(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xc16(%rip),%rsi
call   1090 <read_double@plt>
lea    -0x150(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xc0c(%rip),%rsi
call   1090 <read_double@plt>
lea    -0x150(%rbp),%rdi
mov    0x20(%rbp),%rdx
lea    0xc01(%rip),%rsi
call   1090 <read_double@plt>
mov    0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x70(%rbp)
mov    0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x78(%rbp)
mov    0x10(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x80(%rbp)
mov    0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x88(%rbp)
mov    0x10(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x90(%rbp)
lea    -0x150(%rbp),%rdi
mov    -0x68(%rbp),%rdx
lea    0xba5(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x70(%rbp),%rdx
lea    0xb9f(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x78(%rbp),%rdx
lea    0xb96(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x80(%rbp),%rdx
lea    0xb8e(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x88(%rbp),%rdx
lea    0xb84(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    -0x90(%rbp),%rdx
lea    0xb79(%rip),%rsi
call   1070 <read_int@plt>
mov    0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    0x28(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x48(%rbp)
lea    -0x150(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xb52(%rip),%rsi
call   1090 <read_double@plt>
lea    -0x150(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xb4c(%rip),%rsi
call   1090 <read_double@plt>
lea    -0x150(%rbp),%rdi
mov    -0x48(%rbp),%rdx
lea    0xb46(%rip),%rsi
call   1090 <read_double@plt>
lea    -0x150(%rbp),%rdi
mov    0x30(%rbp),%rdx
lea    0xb40(%rip),%rsi
call   1070 <read_int@plt>
lea    -0x150(%rbp),%rdi
mov    0x38(%rbp),%rdx
lea    0xb34(%rip),%rsi
call   1070 <read_int@plt>
mov    $0x1,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readParameters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x20(%rsp)
mov    %rcx,%rbx
mov    %rdx,0x10(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,%r14
mov    0x150(%rsp),%r15d
mov    0x158(%rsp),%r12
xorps  %xmm0,%xmm0
movups %xmm0,0x9c(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movw   $0x0,0x60(%rsp)
lea    0xdf8(%rip),%rsi
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <strcat@plt>
mov    0x8(%r12),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xddd(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xdd3(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%r15d
jg     1260 <readParameters+0xd0>
lea    0xddc(%rip),%rsi
lea    0xe85(%rip),%rdx
mov    $0x11,%edi
call   1040 <errhandler@plt>
mov    0x128(%rsp),%r12
mov    0x2d71(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdi
call   1080 <access@plt>
test   %rax,%rax
je     1298 <readParameters+0x108>
lea    0xda4(%rip),%rsi
lea    0xe8d(%rip),%rdx
mov    $0x13,%edi
call   1040 <errhandler@plt>
lea    0xeb8(%rip),%rsi
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rdx
call   1070 <read_int@plt>
lea    0xeb9(%rip),%rsi
lea    0xb0(%rsp),%r15
mov    %rbp,%rdi
mov    %r15,%rdx
call   10b0 <read_string@plt>
lea    0xd30(%rip),%rsi
lea    0x70(%rsp),%r13
mov    %r13,%rdi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10a0 <strcat@plt>
lea    0xe8e(%rip),%rsi
mov    %r13,%rdi
call   10a0 <strcat@plt>
lea    0xe84(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x4(%r12),%r15
xor    %ebp,%ebp
cmpl   $0x0,(%r14)
mov    %r12,%rdx
cmove  %r15,%rdx
setne  %bpl
cmove  %r12,%r15
lea    0x8(%r12),%rax
mov    %rax,0x8(%rsp)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rdx,(%rsp)
call   1050 <read_pgm@plt>
mov    %rax,(%rbx)
mov    (%r12,%rbp,4),%ecx
test   %ecx,%ecx
jle    1433 <readParameters+0x2a3>
mov    (%rsp),%rax
mov    (%rax),%eax
mov    $0x1,%r12d
jmp    1372 <readParameters+0x1e2>
nopl   0x0(%rax,%rax,1)
mov    (%r15),%ecx
movslq %ecx,%rdx
cmp    %rdx,%r12
mov    %r13,%r12
jge    1433 <readParameters+0x2a3>
lea    0x1(%r12),%r13
test   %eax,%eax
jle    1363 <readParameters+0x1d3>
mov    %r13d,%ebp
xor    %r14d,%r14d
jmp    13cc <readParameters+0x23c>
lea    0x1(%r14),%edx
lea    0xe14(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x35,%edi
lea    0xc87(%rip),%rsi
lea    0xe11(%rip),%rdx
call   1040 <errhandler@plt>
mov    (%rsp),%rax
mov    (%rax),%eax
cs nopw 0x0(%rax,%rax,1)
movslq %eax,%rcx
add    $0x1,%r14
cmp    %rcx,%r14
jge    1360 <readParameters+0x1d0>
mov    (%rbx),%rcx
mov    (%rcx,%r12,8),%rsi
cmpl   $0x2,0x4(%rsi,%r14,4)
jne    13c0 <readParameters+0x230>
mov    (%rcx,%rbp,8),%rdx
cmpl   $0x2,0x4(%rdx,%r14,4)
je     13c0 <readParameters+0x230>
mov    -0x8(%rcx,%r12,8),%rcx
cmpl   $0x2,0x4(%rcx,%r14,4)
je     13c0 <readParameters+0x230>
cmpl   $0x2,0x8(%rsi,%r14,4)
je     13c0 <readParameters+0x230>
cmpl   $0x2,(%rsi,%r14,4)
je     13c0 <readParameters+0x230>
cmpl   $0x2,0x8(%rdx,%r14,4)
je     1383 <readParameters+0x1f3>
cmpl   $0x2,(%rdx,%r14,4)
je     1383 <readParameters+0x1f3>
cmpl   $0x2,0x8(%rcx,%r14,4)
je     1383 <readParameters+0x1f3>
cmpl   $0x2,(%rcx,%r14,4)
je     1383 <readParameters+0x1f3>
jmp    13c0 <readParameters+0x230>
lea    0xf43(%rip),%rdi
call   1030 <puts@plt>
lea    0xdac(%rip),%rsi
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    0x8(%rsp),%r14
mov    %r14,%rdx
call   1070 <read_int@plt>
mov    (%r15),%esi
lea    0xd96(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
lea    0xd96(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd9c(%rip),%rsi
mov    %rbp,%rdi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
call   1070 <read_int@plt>
lea    0xd95(%rip),%rsi
mov    %rbp,%rdi
mov    0x10(%rsp),%rbp
mov    %rbp,%rdx
call   1070 <read_int@plt>
mov    (%rbx),%eax
test   %eax,%eax
jle    14bb <readParameters+0x32b>
mov    (%r14),%ecx
cmp    %ecx,%eax
jle    14d6 <readParameters+0x346>
lea    0xb69(%rip),%rsi
lea    0xd78(%rip),%rdx
mov    $0x41,%edi
call   1040 <errhandler@plt>
mov    (%r14),%ecx
mov    0x0(%rbp),%eax
test   %eax,%eax
jle    14e1 <readParameters+0x351>
cmp    %ecx,%eax
jle    14fc <readParameters+0x36c>
lea    0xb43(%rip),%rsi
lea    0xd76(%rip),%rdx
mov    $0x43,%edi
call   1040 <errhandler@plt>
mov    0x0(%rbp),%eax
mov    0x130(%rsp),%r13
mov    0x120(%rsp),%rbp
cmp    %eax,(%rbx)
jle    1528 <readParameters+0x398>
lea    0xb14(%rip),%rsi
lea    0xd69(%rip),%rdx
mov    $0x45,%edi
call   1040 <errhandler@plt>
lea    0xd7d(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    0x20(%rsp),%rdx
call   1090 <read_double@plt>
lea    0xd71(%rip),%rsi
mov    %rbx,%rdi
mov    0x28(%rsp),%rdx
call   1090 <read_double@plt>
lea    0xd69(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
call   1090 <read_double@plt>
lea    0x4(%rbp),%r15
lea    0x8(%rbp),%r12
lea    0xc(%rbp),%r13
lea    0x10(%rbp),%r14
lea    0x14(%rbp),%rax
mov    %rax,(%rsp)
lea    0xd44(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1070 <read_int@plt>
lea    0xd43(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
call   1070 <read_int@plt>
lea    0xd3f(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1070 <read_int@plt>
lea    0xd3c(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
call   1070 <read_int@plt>
lea    0xd3a(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1070 <read_int@plt>
lea    0xd37(%rip),%rsi
mov    %rbx,%rdi
mov    (%rsp),%rdx
call   1070 <read_int@plt>
mov    0x138(%rsp),%rdx
lea    0x8(%rdx),%rbp
lea    0x10(%rdx),%r14
lea    0xd24(%rip),%rsi
mov    %rbx,%rdi
call   1090 <read_double@plt>
lea    0xd26(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1090 <read_double@plt>
lea    0xd25(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1090 <read_double@plt>
lea    0xd24(%rip),%rsi
mov    %rbx,%rdi
mov    0x140(%rsp),%rdx
call   1070 <read_int@plt>
lea    0xd18(%rip),%rsi
mov    %rbx,%rdi
mov    0x148(%rsp),%rdx
call   1070 <read_int@plt>
mov    $0x1,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"data/\00"
@.str.1 = [5 x i8] c".dat\00"
@.str.2 = [32 x i8] c"The data will be read from: %s\0A\00"
@.str.3 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/heads/master/tum/computational-fluid-dynamics/ws3/initLB.c\00"
@.str.4 = [64 x i8] c"Not enough arguments. At least a path to init file is required.\00"
@R_OK = global i32 0
@.str.5 = [60 x i8] c"Provided file path either doesn't exist or can not be read.\00"
@.str.6 = [24 x i8] c"*rotate_pgm_coordinates\00"
@.str.7 = [14 x i8] c"pgm_file_name\00"
@.str.8 = [5 x i8] c".pgm\00"
@.str.9 = [32 x i8] c"PGM data will be read from: %s\0A\00"
@.str.10 = [26 x i8] c"Problem with cell (%i,%i)\00"
@.str.11 = [54 x i8] c"There some cells which are connected only with edges.\00"
@.str.12 = [42 x i8] c"PGM data is checked. Everything is fine!\0A\00"
@.str.13 = [9 x i8] c"*zlength\00"
@.str.14 = [20 x i8] c"xlength = %i\0A\00"
@.str.15 = [20 x i8] c"ylength = %i\0A\00"
@.str.16 = [16 x i8] c"*obstacle_start\00"
@.str.17 = [14 x i8] c"*obstacle_end\00"
@.str.18 = [36 x i8] c"Obstacle start is outside of domain\00"
@.str.19 = [34 x i8] c"Obstacle end is outside of domain\00"
@.str.20 = [37 x i8] c"Wrong obstacle geometry: start > end\00"
@.str.21 = [13 x i8] c"*density_ref\00"
@.str.22 = [12 x i8] c"*density_in\00"
@.str.23 = [5 x i8] c"*tau\00"
@.str.24 = [17 x i8] c"*boundary_bottom\00"
@.str.25 = [14 x i8] c"*boundary_top\00"
@.str.26 = [15 x i8] c"*boundary_back\00"
@.str.27 = [16 x i8] c"*boundary_front\00"
@.str.28 = [15 x i8] c"*boundary_left\00"
@.str.29 = [16 x i8] c"*boundary_right\00"
@.str.30 = [17 x i8] c"*velocity_wall_1\00"
@.str.31 = [17 x i8] c"*velocity_wall_2\00"
@.str.32 = [17 x i8] c"*velocity_wall_3\00"
@.str.33 = [11 x i8] c"*timesteps\00"
@.str.34 = [24 x i8] c"*timesteps_per_plotting\00"
define i32 @readParameters(i32* %0, i32* %1, i32* %2, i32*** %3, double* %4, double* %5, i32* %6, i32* %7, double* %8, double* %9, i32* %10, i32* %11, i32 %12, i8** %13) {
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32***
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca double*
%24 = alloca double*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32
%28 = alloca i8**
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca i32*
%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 [50 x i8]
%44 = alloca [60 x i8]
%45 = alloca [50 x i8]
store i32* %0, i32** %15
store i32* %1, i32** %16
store i32* %2, i32** %17
store i32*** %3, i32**** %18
store double* %4, double** %19
store double* %5, double** %20
store i32* %6, i32** %21
store i32* %7, i32** %22
store double* %8, double** %23
store double* %9, double** %24
store i32* %10, i32** %25
store i32* %11, i32** %26
store i32 %12, i32* %27
store i8** %13, i8*** %28
%46 = bitcast [60 x i8]* %44 to i8*
%47 = bitcast [50 x i8]* %45 to i8*
%48 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%50 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%51 = load i8**, i8*** %28
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @strcat(i8* %50, i8* %53)
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%56 = call i32 @strcat(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%57 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %57)
%59 = load i32, i32* %27
%60 = icmp slt i32 %59, 2
br i1 %60, label %61, label %63
61: ; preds = %14
%62 = call i32 @errhandler(i32 17, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
br label %63
63: ; preds = %61, %14
%64 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%65 = load i32, i32* @R_OK
%66 = call i64 @access(i8* %64, i32 %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %63
%69 = call i32 @errhandler(i32 19, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
br label %70
70: ; preds = %68, %63
%71 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%72 = load i32*, i32** %15
%73 = call i32 @read_int(i8* %71, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32* %72)
%74 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%75 = getelementptr inbounds [50 x i8], [50 x i8]* %43, i64 0, i64 0
%76 = call i32 @read_string(i8* %74, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %75)
%77 = getelementptr inbounds [60 x i8], [60 x i8]* %44, i64 0, i64 0
%78 = call i32 @strcat(i8* %77, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%79 = getelementptr inbounds [60 x i8], [60 x i8]* %44, i64 0, i64 0
%80 = getelementptr inbounds [50 x i8], [50 x i8]* %43, i64 0, i64 0
%81 = call i32 @strcat(i8* %79, i8* %80)
%82 = getelementptr inbounds [60 x i8], [60 x i8]* %44, i64 0, i64 0
%83 = call i32 @strcat(i8* %82, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%84 = getelementptr inbounds [60 x i8], [60 x i8]* %44, i64 0, i64 0
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %84)
%86 = load i32*, i32** %15
%87 = load i32, i32* %86
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %94
89: ; preds = %70
%90 = load i32*, i32** %22
%91 = getelementptr inbounds i32, i32* %90, i64 1
store i32* %91, i32** %32
%92 = load i32*, i32** %22
%93 = getelementptr inbounds i32, i32* %92, i64 0
store i32* %93, i32** %33
br label %99
94: ; preds = %70
%95 = load i32*, i32** %22
%96 = getelementptr inbounds i32, i32* %95, i64 0
store i32* %96, i32** %32
%97 = load i32*, i32** %22
%98 = getelementptr inbounds i32, i32* %97, i64 1
store i32* %98, i32** %33
br label %99
99: ; preds = %94, %89
%100 = load i32*, i32** %22
%101 = getelementptr inbounds i32, i32* %100, i64 2
store i32* %101, i32** %34
%102 = getelementptr inbounds [60 x i8], [60 x i8]* %44, i64 0, i64 0
%103 = load i32*, i32** %32
%104 = load i32*, i32** %33
%105 = call i32** @read_pgm(i8* %102, i32* %103, i32* %104)
%106 = load i32***, i32**** %18
store i32** %105, i32*** %106
store i32 1, i32* %41
br label %107
107: ; preds = %249, %99
%108 = load i32, i32* %41
%109 = load i32*, i32** %32
%110 = load i32, i32* %109
%111 = icmp sle i32 %108, %110
br i1 %111, label %112, label %252
112: ; preds = %107
store i32 1, i32* %42
br label %113
113: ; preds = %245, %112
%114 = load i32, i32* %42
%115 = load i32*, i32** %33
%116 = load i32, i32* %115
%117 = icmp sle i32 %114, %116
br i1 %117, label %118, label %248
118: ; preds = %113
%119 = load i32***, i32**** %18
%120 = load i32**, i32*** %119
%121 = load i32, i32* %41
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i32*, i32** %120, i64 %122
%124 = load i32*, i32** %123
%125 = load i32, i32* %42
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i32, i32* %124, i64 %126
%128 = load i32, i32* %127
%129 = icmp eq i32 %128, 2
br i1 %129, label %130, label %244
130: ; preds = %118
%131 = load i32***, i32**** %18
%132 = load i32**, i32*** %131
%133 = load i32, i32* %41
%134 = add nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i32*, i32** %132, i64 %135
%137 = load i32*, i32** %136
%138 = load i32, i32* %42
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %137, i64 %139
%141 = load i32, i32* %140
%142 = icmp eq i32 %141, 2
br i1 %142, label %243, label %143
143: ; preds = %130
%144 = load i32***, i32**** %18
%145 = load i32**, i32*** %144
%146 = load i32, i32* %41
%147 = sub nsw i32 %146, 1
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i32*, i32** %145, i64 %148
%150 = load i32*, i32** %149
%151 = load i32, i32* %42
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32, i32* %150, i64 %152
%154 = load i32, i32* %153
%155 = icmp eq i32 %154, 2
br i1 %155, label %243, label %156
156: ; preds = %143
%157 = load i32***, i32**** %18
%158 = load i32**, i32*** %157
%159 = load i32, i32* %41
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i32*, i32** %158, i64 %160
%162 = load i32*, i32** %161
%163 = load i32, i32* %42
%164 = add nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i32, i32* %162, i64 %165
%167 = load i32, i32* %166
%168 = icmp eq i32 %167, 2
br i1 %168, label %243, label %169
169: ; preds = %156
%170 = load i32***, i32**** %18
%171 = load i32**, i32*** %170
%172 = load i32, i32* %41
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i32*, i32** %171, i64 %173
%175 = load i32*, i32** %174
%176 = load i32, i32* %42
%177 = sub nsw i32 %176, 1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i32, i32* %175, i64 %178
%180 = load i32, i32* %179
%181 = icmp eq i32 %180, 2
br i1 %181, label %243, label %182
182: ; preds = %169
%183 = load i32***, i32**** %18
%184 = load i32**, i32*** %183
%185 = load i32, i32* %41
%186 = add nsw i32 %185, 1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i32*, i32** %184, i64 %187
%189 = load i32*, i32** %188
%190 = load i32, i32* %42
%191 = add nsw i32 %190, 1
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i32, i32* %189, i64 %192
%194 = load i32, i32* %193
%195 = icmp eq i32 %194, 2
br i1 %195, label %238, label %196
196: ; preds = %182
%197 = load i32***, i32**** %18
%198 = load i32**, i32*** %197
%199 = load i32, i32* %41
%200 = add nsw i32 %199, 1
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i32*, i32** %198, i64 %201
%203 = load i32*, i32** %202
%204 = load i32, i32* %42
%205 = sub nsw i32 %204, 1
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i32, i32* %203, i64 %206
%208 = load i32, i32* %207
%209 = icmp eq i32 %208, 2
br i1 %209, label %238, label %210
210: ; preds = %196
%211 = load i32***, i32**** %18
%212 = load i32**, i32*** %211
%213 = load i32, i32* %41
%214 = sub nsw i32 %213, 1
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i32*, i32** %212, i64 %215
%217 = load i32*, i32** %216
%218 = load i32, i32* %42
%219 = add nsw i32 %218, 1
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i32, i32* %217, i64 %220
%222 = load i32, i32* %221
%223 = icmp eq i32 %222, 2
br i1 %223, label %238, label %224
224: ; preds = %210
%225 = load i32***, i32**** %18
%226 = load i32**, i32*** %225
%227 = load i32, i32* %41
%228 = sub nsw i32 %227, 1
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i32*, i32** %226, i64 %229
%231 = load i32*, i32** %230
%232 = load i32, i32* %42
%233 = sub nsw i32 %232, 1
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %231, i64 %234
%236 = load i32, i32* %235
%237 = icmp eq i32 %236, 2
br i1 %237, label %238, label %243
238: ; preds = %224, %210, %196, %182
%239 = load i32, i32* %41
%240 = load i32, i32* %42
%241 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %239, i32 %240)
%242 = call i32 @errhandler(i32 53, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
br label %243
243: ; preds = %238, %224, %169, %156, %143, %130
br label %244
244: ; preds = %243, %118
br label %245
245: ; preds = %244
%246 = load i32, i32* %42
%247 = add nsw i32 %246, 1
store i32 %247, i32* %42
br label %113
248: ; preds = %113
br label %249
249: ; preds = %248
%250 = load i32, i32* %41
%251 = add nsw i32 %250, 1
store i32 %251, i32* %41
br label %107
252: ; preds = %107
%253 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0))
%254 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%255 = load i32*, i32** %34
%256 = call i32 @read_int(i8* %254, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32* %255)
%257 = load i32*, i32** %32
%258 = load i32, i32* %257
%259 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %258)
%260 = load i32*, i32** %33
%261 = load i32, i32* %260
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %261)
%263 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%264 = load i32*, i32** %16
%265 = call i32 @read_int(i8* %263, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32* %264)
%266 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%267 = load i32*, i32** %17
%268 = call i32 @read_int(i8* %266, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32* %267)
%269 = load i32*, i32** %16
%270 = load i32, i32* %269
%271 = load i32*, i32** %34
%272 = load i32, i32* %271
%273 = icmp sgt i32 %270, %272
br i1 %273, label %278, label %274
274: ; preds = %252
%275 = load i32*, i32** %16
%276 = load i32, i32* %275
%277 = icmp slt i32 %276, 1
br i1 %277, label %278, label %280
278: ; preds = %274, %252
%279 = call i32 @errhandler(i32 65, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
br label %280
280: ; preds = %278, %274
%281 = load i32*, i32** %17
%282 = load i32, i32* %281
%283 = load i32*, i32** %34
%284 = load i32, i32* %283
%285 = icmp sgt i32 %282, %284
br i1 %285, label %290, label %286
286: ; preds = %280
%287 = load i32*, i32** %17
%288 = load i32, i32* %287
%289 = icmp slt i32 %288, 1
br i1 %289, label %290, label %292
290: ; preds = %286, %280
%291 = call i32 @errhandler(i32 67, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
br label %292
292: ; preds = %290, %286
%293 = load i32*, i32** %16
%294 = load i32, i32* %293
%295 = load i32*, i32** %17
%296 = load i32, i32* %295
%297 = icmp sgt i32 %294, %296
br i1 %297, label %298, label %300
298: ; preds = %292
%299 = call i32 @errhandler(i32 69, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.20, i64 0, i64 0))
br label %300
300: ; preds = %298, %292
%301 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%302 = load double*, double** %19
%303 = call i32 @read_double(i8* %301, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), double* %302)
%304 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%305 = load double*, double** %20
%306 = call i32 @read_double(i8* %304, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), double* %305)
%307 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%308 = load double*, double** %23
%309 = call i32 @read_double(i8* %307, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), double* %308)
%310 = load i32*, i32** %21
%311 = getelementptr inbounds i32, i32* %310, i64 0
store i32* %311, i32** %35
%312 = load i32*, i32** %21
%313 = getelementptr inbounds i32, i32* %312, i64 1
store i32* %313, i32** %36
%314 = load i32*, i32** %21
%315 = getelementptr inbounds i32, i32* %314, i64 2
store i32* %315, i32** %37
%316 = load i32*, i32** %21
%317 = getelementptr inbounds i32, i32* %316, i64 3
store i32* %317, i32** %38
%318 = load i32*, i32** %21
%319 = getelementptr inbounds i32, i32* %318, i64 4
store i32* %319, i32** %39
%320 = load i32*, i32** %21
%321 = getelementptr inbounds i32, i32* %320, i64 5
store i32* %321, i32** %40
%322 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%323 = load i32*, i32** %35
%324 = call i32 @read_int(i8* %322, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i32* %323)
%325 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%326 = load i32*, i32** %36
%327 = call i32 @read_int(i8* %325, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i32* %326)
%328 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%329 = load i32*, i32** %37
%330 = call i32 @read_int(i8* %328, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0), i32* %329)
%331 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%332 = load i32*, i32** %38
%333 = call i32 @read_int(i8* %331, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0), i32* %332)
%334 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%335 = load i32*, i32** %39
%336 = call i32 @read_int(i8* %334, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i64 0, i64 0), i32* %335)
%337 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%338 = load i32*, i32** %40
%339 = call i32 @read_int(i8* %337, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0), i32* %338)
%340 = load double*, double** %24
%341 = getelementptr inbounds double, double* %340, i64 0
store double* %341, double** %29
%342 = load double*, double** %24
%343 = getelementptr inbounds double, double* %342, i64 1
store double* %343, double** %30
%344 = load double*, double** %24
%345 = getelementptr inbounds double, double* %344, i64 2
store double* %345, double** %31
%346 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%347 = load double*, double** %29
%348 = call i32 @read_double(i8* %346, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.30, i64 0, i64 0), double* %347)
%349 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%350 = load double*, double** %30
%351 = call i32 @read_double(i8* %349, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.31, i64 0, i64 0), double* %350)
%352 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%353 = load double*, double** %31
%354 = call i32 @read_double(i8* %352, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.32, i64 0, i64 0), double* %353)
%355 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%356 = load i32*, i32** %25
%357 = call i32 @read_int(i8* %355, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.33, i64 0, i64 0), i32* %356)
%358 = getelementptr inbounds [50 x i8], [50 x i8]* %45, i64 0, i64 0
%359 = load i32*, i32** %26
%360 = call i32 @read_int(i8* %358, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.34, i64 0, i64 0), i32* %359)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"data/\00"
@.str.1 = [5 x i8] c".dat\00"
@.str.2 = [32 x i8] c"The data will be read from: %s\0A\00"
@.str.3 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nyxcalamity/classwork/refs/heads/master/tum/computational-fluid-dynamics/ws3/initLB.c\00"
@.str.4 = [64 x i8] c"Not enough arguments. At least a path to init file is required.\00"
@R_OK = global i32 0
@.str.5 = [60 x i8] c"Provided file path either doesn't exist or can not be read.\00"
@.str.6 = [24 x i8] c"*rotate_pgm_coordinates\00"
@.str.7 = [14 x i8] c"pgm_file_name\00"
@.str.8 = [5 x i8] c".pgm\00"
@.str.9 = [32 x i8] c"PGM data will be read from: %s\0A\00"
@.str.10 = [26 x i8] c"Problem with cell (%i,%i)\00"
@.str.11 = [54 x i8] c"There some cells which are connected only with edges.\00"
@.str.13 = [9 x i8] c"*zlength\00"
@.str.14 = [20 x i8] c"xlength = %i\0A\00"
@.str.15 = [20 x i8] c"ylength = %i\0A\00"
@.str.16 = [16 x i8] c"*obstacle_start\00"
@.str.17 = [14 x i8] c"*obstacle_end\00"
@.str.18 = [36 x i8] c"Obstacle start is outside of domain\00"
@.str.19 = [34 x i8] c"Obstacle end is outside of domain\00"
@.str.20 = [37 x i8] c"Wrong obstacle geometry: start > end\00"
@.str.21 = [13 x i8] c"*density_ref\00"
@.str.22 = [12 x i8] c"*density_in\00"
@.str.23 = [5 x i8] c"*tau\00"
@.str.24 = [17 x i8] c"*boundary_bottom\00"
@.str.25 = [14 x i8] c"*boundary_top\00"
@.str.26 = [15 x i8] c"*boundary_back\00"
@.str.27 = [16 x i8] c"*boundary_front\00"
@.str.28 = [15 x i8] c"*boundary_left\00"
@.str.29 = [16 x i8] c"*boundary_right\00"
@.str.30 = [17 x i8] c"*velocity_wall_1\00"
@.str.31 = [17 x i8] c"*velocity_wall_2\00"
@.str.32 = [17 x i8] c"*velocity_wall_3\00"
@.str.33 = [11 x i8] c"*timesteps\00"
@.str.34 = [24 x i8] c"*timesteps_per_plotting\00"
@str = [41 x i8] c"PGM data is checked. Everything is fine!\00"
define i32 @readParameters(i32* %0, i32* %1, i32* %2, i32*** nocapture %3, double* %4, double* %5, i32* %6, i32* %7, double* %8, double* %9, i32* %10, i32* %11, i32 %12, i8** nocapture %13) {
%15 = alloca [50 x i8]
%16 = alloca [60 x i8]
%17 = alloca [50 x i8]
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %15, i64 0, i64 0
%19 = getelementptr inbounds [60 x i8], [60 x i8]* %16, i64 0, i64 0
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %17, i64 0, i64 0
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%22 = getelementptr inbounds i8*, i8** %13, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strcat(i8* %20, i8* %23)
%25 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%27 = icmp slt i32 %12, 2
br i1 %27, label %28, label %30
28: ; preds = %14
%29 = call i32 @errhandler(i32 17, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %28, %14
%31 = load i32, i32* @R_OK
%32 = call i64 @access(i8* %20, i32 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = call i32 @errhandler(i32 19, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
br label %36
36: ; preds = %34, %30
%37 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32* %0)
%38 = call i32 @read_string(i8* %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %18)
%39 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%40 = call i32 @strcat(i8* %19, i8* %18)
%41 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %19)
%43 = load i32, i32* %0
%44 = icmp eq i32 %43, 0
%45 = getelementptr inbounds i32, i32* %7, i64 1
%46 = select i1 %44, i32* %45, i32* %7
%47 = select i1 %44, i32* %7, i32* %45
%48 = getelementptr inbounds i32, i32* %7, i64 2
%49 = call i32** @read_pgm(i8* %19, i32* %47, i32* %46)
store i32** %49, i32*** %3
%50 = load i32, i32* %47
%51 = icmp slt i32 %50, 1
br i1 %51, label %131, label %52
52: ; preds = %36
%53 = load i32, i32* %46
br label %54
54: ; preds = %52, %125
%55 = phi i32 [ %50, %52 ], [ %126, %125 ]
%56 = phi i32 [ %53, %52 ], [ %127, %125 ]
%57 = phi i32 [ %53, %52 ], [ %128, %125 ]
%58 = phi i64 [ 1, %52 ], [ %60, %125 ]
%59 = icmp slt i32 %57, 1
%60 = add nuw nsw i64 %58, 1
br i1 %59, label %125, label %61
61: ; preds = %54
%62 = and i64 %60, 4294967295
%63 = add nsw i64 %58, -1
%64 = trunc i64 %58 to i32
br label %65
65: ; preds = %61, %118
%66 = phi i32 [ %56, %61 ], [ %119, %118 ]
%67 = phi i64 [ 1, %61 ], [ %120, %118 ]
%68 = load i32**, i32*** %3
%69 = getelementptr inbounds i32*, i32** %68, i64 %58
%70 = load i32*, i32** %69
%71 = getelementptr inbounds i32, i32* %70, i64 %67
%72 = load i32, i32* %71
%73 = icmp eq i32 %72, 2
br i1 %73, label %74, label %118
74: ; preds = %65
%75 = getelementptr inbounds i32*, i32** %68, i64 %62
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 %67
%78 = load i32, i32* %77
%79 = icmp eq i32 %78, 2
br i1 %79, label %118, label %80
80: ; preds = %74
%81 = getelementptr inbounds i32*, i32** %68, i64 %63
%82 = load i32*, i32** %81
%83 = getelementptr inbounds i32, i32* %82, i64 %67
%84 = load i32, i32* %83
%85 = icmp eq i32 %84, 2
br i1 %85, label %118, label %86
86: ; preds = %80
%87 = add nuw i64 %67, 1
%88 = and i64 %87, 4294967295
%89 = getelementptr inbounds i32, i32* %70, i64 %88
%90 = load i32, i32* %89
%91 = icmp eq i32 %90, 2
br i1 %91, label %118, label %92
92: ; preds = %86
%93 = add nsw i64 %67, -1
%94 = getelementptr inbounds i32, i32* %70, i64 %93
%95 = load i32, i32* %94
%96 = icmp eq i32 %95, 2
br i1 %96, label %118, label %97
97: ; preds = %92
%98 = getelementptr inbounds i32, i32* %76, i64 %88
%99 = load i32, i32* %98
%100 = icmp eq i32 %99, 2
br i1 %100, label %113, label %101
101: ; preds = %97
%102 = getelementptr inbounds i32, i32* %76, i64 %93
%103 = load i32, i32* %102
%104 = icmp eq i32 %103, 2
br i1 %104, label %113, label %105
105: ; preds = %101
%106 = getelementptr inbounds i32, i32* %82, i64 %88
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, 2
br i1 %108, label %113, label %109
109: ; preds = %105
%110 = getelementptr inbounds i32, i32* %82, i64 %93
%111 = load i32, i32* %110
%112 = icmp eq i32 %111, 2
br i1 %112, label %113, label %118
113: ; preds = %109, %105, %101, %97
%114 = trunc i64 %67 to i32
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %64, i32 %114)
%116 = call i32 @errhandler(i32 53, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%117 = load i32, i32* %46
br label %118
118: ; preds = %65, %113, %109, %92, %86, %80, %74
%119 = phi i32 [ %66, %65 ], [ %117, %113 ], [ %66, %109 ], [ %66, %92 ], [ %66, %86 ], [ %66, %80 ], [ %66, %74 ]
%120 = add nuw nsw i64 %67, 1
%121 = sext i32 %119 to i64
%122 = icmp slt i64 %67, %121
br i1 %122, label %65, label %123
123: ; preds = %118
%124 = load i32, i32* %47
br label %125
125: ; preds = %54, %123
%126 = phi i32 [ %124, %123 ], [ %55, %54 ]
%127 = phi i32 [ %119, %123 ], [ %56, %54 ]
%128 = phi i32 [ %119, %123 ], [ %57, %54 ]
%129 = sext i32 %126 to i64
%130 = icmp slt i64 %58, %129
br i1 %130, label %54, label %131
131: ; preds = %125, %36
%132 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%133 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32* %48)
%134 = load i32, i32* %47
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %134)
%136 = load i32, i32* %46
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %136)
%138 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32* %1)
%139 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32* %2)
%140 = load i32, i32* %1
%141 = load i32, i32* %48
%142 = icmp sgt i32 %140, %141
%143 = icmp slt i32 %140, 1
%144 = or i1 %143, %142
br i1 %144, label %145, label %148
145: ; preds = %131
%146 = call i32 @errhandler(i32 65, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%147 = load i32, i32* %48
br label %148
148: ; preds = %131, %145
%149 = phi i32 [ %141, %131 ], [ %147, %145 ]
%150 = load i32, i32* %2
%151 = icmp sgt i32 %150, %149
%152 = icmp slt i32 %150, 1
%153 = or i1 %152, %151
br i1 %153, label %154, label %157
154: ; preds = %148
%155 = call i32 @errhandler(i32 67, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
%156 = load i32, i32* %2
br label %157
157: ; preds = %148, %154
%158 = phi i32 [ %150, %148 ], [ %156, %154 ]
%159 = load i32, i32* %1
%160 = icmp sgt i32 %159, %158
br i1 %160, label %161, label %163
161: ; preds = %157
%162 = call i32 @errhandler(i32 69, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.20, i64 0, i64 0))
br label %163
163: ; preds = %161, %157
%164 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), double* %4)
%165 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), double* %5)
%166 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), double* %8)
%167 = getelementptr inbounds i32, i32* %6, i64 1
%168 = getelementptr inbounds i32, i32* %6, i64 2
%169 = getelementptr inbounds i32, i32* %6, i64 3
%170 = getelementptr inbounds i32, i32* %6, i64 4
%171 = getelementptr inbounds i32, i32* %6, i64 5
%172 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i32* %6)
%173 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i32* %167)
%174 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0), i32* %168)
%175 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0), i32* %169)
%176 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i64 0, i64 0), i32* %170)
%177 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i64 0, i64 0), i32* %171)
%178 = getelementptr inbounds double, double* %9, i64 1
%179 = getelementptr inbounds double, double* %9, i64 2
%180 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.30, i64 0, i64 0), double* %9)
%181 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.31, i64 0, i64 0), double* %178)
%182 = call i32 @read_double(i8* %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.32, i64 0, i64 0), double* %179)
%183 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.33, i64 0, i64 0), i32* %10)
%184 = call i32 @read_int(i8* %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.34, i64 0, i64 0), i32* %11)
ret i32 1
}