#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 EOF;
int /*<<< orphan*/ errhandler(int, char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int **imatrix(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ sscanf(char *, char *, int *, ...);
int **read_pgm(const char *filename) {
  FILE *input = NULL;
  char line[1024];
  int levels;
  int xsize, ysize;
  int i1, j1;
  int **pic = NULL;
  if ((input = fopen(filename, "rb")) == 0) {
    char szBuff[80];
    sprintf(szBuff, "Can not read file %s!", filename);
    errhandler(701,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/"
               "master/Backup/FinalProjectBackup/helper.c",
               szBuff);
  }
  if (fread(line, 1, 3, input) != 3) {
    fclose(input);
    errhandler(708,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/"
               "master/Backup/FinalProjectBackup/helper.c",
               "Error: Wrong Magic field!");
  }
  do
    fgets(line, sizeof line, input);
  while (*line == '#');
  sscanf(line, "%d %d\n", &xsize, &ysize);
  printf("Image set size: %d x %d\n", xsize, ysize);
  fgets(line, sizeof line, input);
  sscanf(line, "%d\n", &levels);
  pic = imatrix(0, xsize - 1, 0, ysize - 1);
  printf("Image initialised...\n");
  for (j1 = 0; j1 <= ysize - 1; j1++) {
    for (i1 = 0; i1 <= xsize - 1; i1++) {
      int byte;
      fscanf(input, "%d", &byte);
      if (byte == EOF) {
        fclose(input);
        errhandler(740,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/"
                   "master/Backup/FinalProjectBackup/helper.c",
                   "Read failed");
      } else {
        pic[i1][j1] = byte;
      }
    }
  }
  fclose(input);
  return pic;
}


x86 assembly (clang, -O0):
<read_pgm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x430(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe33(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    120f <read_pgm+0x6f>
lea    -0x480(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe11(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x480(%rbp),%rdx
mov    $0x2bd,%edi
lea    0xe0f(%rip),%rsi
call   1050 <errhandler@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <fread@plt>
cmp    $0x3,%eax
je     1253 <read_pgm+0xb3>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
mov    $0x2c4,%edi
lea    0xdd2(%rip),%rsi
lea    0xe68(%rip),%rdx
call   1050 <errhandler@plt>
jmp    1258 <read_pgm+0xb8>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   1090 <fgets@plt>
movsbl -0x410(%rbp),%eax
cmp    $0x23,%eax
je     1258 <read_pgm+0xb8>
lea    -0x410(%rbp),%rdi
lea    0xe45(%rip),%rsi
lea    -0x418(%rbp),%rdx
lea    -0x41c(%rbp),%rcx
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    -0x418(%rbp),%esi
mov    -0x41c(%rbp),%edx
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   1090 <fgets@plt>
lea    -0x410(%rbp),%rdi
lea    0xdf6(%rip),%rsi
lea    -0x414(%rbp),%rdx
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    -0x418(%rbp),%esi
sub    $0x1,%esi
mov    -0x41c(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1030 <imatrix@plt>
mov    %rax,-0x430(%rbp)
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x424(%rbp)
mov    -0x424(%rbp),%eax
mov    -0x41c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1403 <read_pgm+0x263>
movl   $0x0,-0x420(%rbp)
mov    -0x420(%rbp),%eax
mov    -0x418(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     13ea <read_pgm+0x24a>
mov    -0x10(%rbp),%rdi
lea    0xd9e(%rip),%rsi
lea    -0x484(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x484(%rbp),%eax
mov    0x2c67(%rip),%rcx
cmp    (%rcx),%eax
jne    13af <read_pgm+0x20f>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
mov    $0x2e4,%edi
lea    0xc7b(%rip),%rsi
lea    0xd64(%rip),%rdx
call   1050 <errhandler@plt>
jmp    13d1 <read_pgm+0x231>
mov    -0x484(%rbp),%edx
mov    -0x430(%rbp),%rax
movslq -0x420(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x424(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13d6 <read_pgm+0x236>
mov    -0x420(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x420(%rbp)
jmp    1346 <read_pgm+0x1a6>
jmp    13ef <read_pgm+0x24f>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    1325 <read_pgm+0x185>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x430(%rbp),%rax
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pgm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rdi,%rbp
lea    0xe35(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1203 <read_pgm+0x53>
lea    0xe24(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rdx
call   10d0 <sprintf@plt>
lea    0xe23(%rip),%rsi
mov    $0x2bd,%edi
mov    %r14,%rdx
call   1060 <errhandler@plt>
lea    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    $0x3,%eax
je     123f <read_pgm+0x8f>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0xdeb(%rip),%rsi
lea    0xe81(%rip),%rdx
mov    $0x2c4,%edi
call   1060 <errhandler@plt>
lea    0x20(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   10a0 <fgets@plt>
cmpb   $0x23,0x20(%rsp)
je     1250 <read_pgm+0xa0>
lea    0xe62(%rip),%rsi
lea    0x20(%rsp),%rbp
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rbp,%rdi
xor    %eax,%eax
call   10b0 <sscanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   10a0 <fgets@plt>
lea    0xe1f(%rip),%rsi
lea    0x1c(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   10b0 <sscanf@plt>
mov    0x8(%rsp),%esi
add    $0xffffffff,%esi
mov    0x4(%rsp),%ecx
add    $0xffffffff,%ecx
xor    %edi,%edi
xor    %edx,%edx
call   1030 <imatrix@plt>
mov    %rax,0x10(%rsp)
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    1394 <read_pgm+0x1e4>
mov    0x8(%rsp),%eax
xor    %r13d,%r13d
lea    0xdeb(%rip),%r15
lea    0xc(%rsp),%r12
mov    0x2cd7(%rip),%rbp
jmp    1330 <read_pgm+0x180>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rsp),%ecx
add    $0x1,%r13
movslq %ecx,%rdx
cmp    %rdx,%r13
jge    1394 <read_pgm+0x1e4>
test   %eax,%eax
jle    1324 <read_pgm+0x174>
xor    %r14d,%r14d
jmp    135b <read_pgm+0x1ab>
nopl   0x0(%rax)
mov    0x10(%rsp),%rcx
mov    (%rcx,%r14,8),%rcx
mov    %eax,(%rcx,%r13,4)
add    $0x1,%r14
movslq 0x8(%rsp),%rax
cmp    %rax,%r14
jge    1320 <read_pgm+0x170>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1090 <fscanf@plt>
mov    0xc(%rsp),%eax
cmp    0x0(%rbp),%eax
jne    1340 <read_pgm+0x190>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    $0x2e4,%edi
lea    0xc93(%rip),%rsi
lea    0xd66(%rip),%rdx
call   1060 <errhandler@plt>
jmp    134d <read_pgm+0x19d>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    0x10(%rsp),%rax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [22 x i8] c"Can not read file %s!\00"
@.str.2 = [157 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/Backup/FinalProjectBackup/helper.c\00"
@.str.3 = [26 x i8] c"Error: Wrong Magic field!\00"
@.str.4 = [7 x i8] c"%d %d\0A\00"
@.str.5 = [25 x i8] c"Image set size: %d x %d\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [22 x i8] c"Image initialised...\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@EOF = global i32 0
@.str.9 = [12 x i8] c"Read failed\00"
define i32** @read_pgm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32**
%11 = alloca [80 x i8]
%12 = alloca i32
store i8* %0, i8** %2
store i32* null, i32** %3
store i32** null, i32*** %10
%13 = load i8*, i8** %2
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %3
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %22
16: ; preds = %1
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%18 = load i8*, i8** %2
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%21 = call i32 @errhandler(i32 701, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %16, %1
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%24 = load i32*, i32** %3
%25 = call i32 @fread(i8* %23, i32 1, i32 3, i32* %24)
%26 = icmp ne i32 %25, 3
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = call i32 @fclose(i32* %28)
%30 = call i32 @errhandler(i32 708, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %27, %22
br label %32
32: ; preds = %36, %31
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%34 = load i32*, i32** %3
%35 = call i32 @fgets(i8* %33, i32 1024, i32* %34)
br label %36
36: ; preds = %32
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 35
br i1 %40, label %32, label %41
41: ; preds = %36
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%43 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7)
%44 = load i32, i32* %6
%45 = load i32, i32* %7
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %44, i32 %45)
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%48 = load i32*, i32** %3
%49 = call i32 @fgets(i8* %47, i32 1024, i32* %48)
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%51 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%52 = load i32, i32* %6
%53 = sub nsw i32 %52, 1
%54 = load i32, i32* %7
%55 = sub nsw i32 %54, 1
%56 = call i32** @imatrix(i32 0, i32 %53, i32 0, i32 %55)
store i32** %56, i32*** %10
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %9
br label %58
58: ; preds = %94, %41
%59 = load i32, i32* %9
%60 = load i32, i32* %7
%61 = sub nsw i32 %60, 1
%62 = icmp sle i32 %59, %61
br i1 %62, label %63, label %97
63: ; preds = %58
store i32 0, i32* %8
br label %64
64: ; preds = %90, %63
%65 = load i32, i32* %8
%66 = load i32, i32* %6
%67 = sub nsw i32 %66, 1
%68 = icmp sle i32 %65, %67
br i1 %68, label %69, label %93
69: ; preds = %64
%70 = load i32*, i32** %3
%71 = call i32 @fscanf(i32* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %12)
%72 = load i32, i32* %12
%73 = load i32, i32* @EOF
%74 = icmp eq i32 %72, %73
br i1 %74, label %75, label %79
75: ; preds = %69
%76 = load i32*, i32** %3
%77 = call i32 @fclose(i32* %76)
%78 = call i32 @errhandler(i32 740, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %89
79: ; preds = %69
%80 = load i32, i32* %12
%81 = load i32**, i32*** %10
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i32*, i32** %81, i64 %83
%85 = load i32*, i32** %84
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i32, i32* %85, i64 %87
store i32 %80, i32* %88
br label %89
89: ; preds = %79, %75
br label %90
90: ; preds = %89
%91 = load i32, i32* %8
%92 = add nsw i32 %91, 1
store i32 %92, i32* %8
br label %64
93: ; preds = %64
br label %94
94: ; preds = %93
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 1
store i32 %96, i32* %9
br label %58
97: ; preds = %58
%98 = load i32*, i32** %3
%99 = call i32 @fclose(i32* %98)
%100 = load i32**, i32*** %10
ret i32** %100
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [22 x i8] c"Can not read file %s!\00"
@.str.2 = [157 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/Backup/FinalProjectBackup/helper.c\00"
@.str.3 = [26 x i8] c"Error: Wrong Magic field!\00"
@.str.4 = [7 x i8] c"%d %d\0A\00"
@.str.5 = [25 x i8] c"Image set size: %d x %d\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@EOF = global i32 0
@.str.9 = [12 x i8] c"Read failed\00"
@str = [21 x i8] c"Image initialised...\00"
define i32** @read_pgm(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [80 x i8]
%7 = alloca i32
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%16 = call i32 @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%17 = call i32 @errhandler(i32 701, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %18
18: ; preds = %14, %1
%19 = call i32 @fread(i8* %8, i32 1, i32 3, i32* %12)
%20 = icmp eq i32 %19, 3
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = call i32 @fclose(i32* %12)
%23 = call i32 @errhandler(i32 708, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %25
%26 = call i32 @fgets(i8* %8, i32 1024, i32* %12)
%27 = load i8, i8* %8
%28 = icmp eq i8 %27, 35
br i1 %28, label %25, label %29
29: ; preds = %25
%30 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5)
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %31, i32 %32)
%34 = call i32 @fgets(i8* %8, i32 1024, i32* %12)
%35 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%36 = load i32, i32* %4
%37 = add nsw i32 %36, -1
%38 = load i32, i32* %5
%39 = add nsw i32 %38, -1
%40 = call i32** @imatrix(i32 0, i32 %37, i32 0, i32 %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%42 = load i32, i32* %5
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %78
44: ; preds = %29
%45 = bitcast i32* %7 to i8*
%46 = load i32, i32* %4
br label %47
47: ; preds = %44, %72
%48 = phi i32 [ %42, %44 ], [ %73, %72 ]
%49 = phi i32 [ %46, %44 ], [ %74, %72 ]
%50 = phi i64 [ 0, %44 ], [ %75, %72 ]
%51 = icmp sgt i32 %49, 0
br i1 %51, label %52, label %72
52: ; preds = %47, %65
%53 = phi i64 [ %66, %65 ], [ 0, %47 ]
%54 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %7)
%55 = load i32, i32* %7
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = call i32 @fclose(i32* %12)
%60 = call i32 @errhandler(i32 740, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %65
61: ; preds = %52
%62 = getelementptr inbounds i32*, i32** %40, i64 %53
%63 = load i32*, i32** %62
%64 = getelementptr inbounds i32, i32* %63, i64 %50
store i32 %55, i32* %64
br label %65
65: ; preds = %61, %58
%66 = add nuw nsw i64 %53, 1
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = icmp slt i64 %66, %68
br i1 %69, label %52, label %70
70: ; preds = %65
%71 = load i32, i32* %5
br label %72
72: ; preds = %70, %47
%73 = phi i32 [ %71, %70 ], [ %48, %47 ]
%74 = phi i32 [ %67, %70 ], [ %49, %47 ]
%75 = add nuw nsw i64 %50, 1
%76 = sext i32 %73 to i64
%77 = icmp slt i64 %75, %76
br i1 %77, label %47, label %78
78: ; preds = %72, %29
%79 = call i32 @fclose(i32* %12)
ret i32** %40
}