#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  FILE *workFile;
  workFile = fopen("./work.txt", "r");
  if (!workFile) {
    puts("Error opening file!");
    exit(-1);
  }
  int numberOfDays = 0;
  int numberOfJobsInDay[30] = {0};
  int numberOfTerminatedJobsInDay[30] = {0};
  char jobWithMostWorkers[100] = "";
  int maxNumOfWorkers = 0;
  for (;;) {
    char name[100];
    if (fscanf(workFile, "%99s", name) < 1) {
      break;
    }
    int totalNumOfWorkers = 0;
    for (int day = 0;; ++day) {
      int numberOfWorkers;
      fscanf(workFile, "%d", &numberOfWorkers);
      if (numberOfWorkers == -1) {
        ++numberOfTerminatedJobsInDay[day - 1];
        break;
      }
      if (day + 1 > numberOfDays) {
        numberOfDays = day + 1;
      }
      if (numberOfWorkers) {
        totalNumOfWorkers += numberOfWorkers;
        ++numberOfJobsInDay[day];
      }
    }
    if (totalNumOfWorkers > maxNumOfWorkers) {
      maxNumOfWorkers = totalNumOfWorkers;
      strcpy(jobWithMostWorkers, name);
    }
  }
  fclose(workFile);
  int dayWithMostJobs = 0;
  int dayWithMostTerminations = 0;
  for (int day = 1; day < numberOfDays; ++day) {
    if (numberOfJobsInDay[day] > numberOfJobsInDay[dayWithMostJobs]) {
      dayWithMostJobs = day;
    }
    if (numberOfTerminatedJobsInDay[day] >
        numberOfTerminatedJobsInDay[dayWithMostTerminations]) {
      dayWithMostTerminations = day;
    }
  }
  printf("Dia com mais tarefas: %d\n", dayWithMostJobs + 1);
  printf("Dia com mais tarefas acabadas: %d\n", dayWithMostTerminations + 1);
  printf("Tarefa com mais trabalhadores: %s\n", jobWithMostWorkers);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
lea    0xe6b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11ca <main+0x4a>
lea    0xe52(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x78,%edx
call   1070 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x78,%edx
call   1070 <memset@plt>
lea    -0x180(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1070 <memset@plt>
movl   $0x0,-0x184(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1f0(%rbp),%rdx
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1080 <fscanf@plt>
cmp    $0x1,%eax
jge    123b <main+0xbb>
jmp    133a <main+0x1ba>
movl   $0x0,-0x1f4(%rbp)
movl   $0x0,-0x1f8(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdcc(%rip),%rsi
lea    -0x1fc(%rbp),%rdx
mov    $0x0,%al
call   1080 <fscanf@plt>
cmpl   $0xffffffff,-0x1fc(%rbp)
jne    1296 <main+0x116>
mov    -0x1f8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x110(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x110(%rbp,%rax,4)
jmp    1304 <main+0x184>
mov    -0x1f8(%rbp),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jle    12b4 <main+0x134>
mov    -0x1f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x1fc(%rbp)
je     12eb <main+0x16b>
mov    -0x1fc(%rbp),%eax
add    -0x1f4(%rbp),%eax
mov    %eax,-0x1f4(%rbp)
movslq -0x1f8(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
jmp    12f0 <main+0x170>
mov    -0x1f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f8(%rbp)
jmp    124f <main+0xcf>
mov    -0x1f4(%rbp),%eax
cmp    -0x184(%rbp),%eax
jle    1335 <main+0x1b5>
mov    -0x1f4(%rbp),%eax
mov    %eax,-0x184(%rbp)
lea    -0x180(%rbp),%rdi
lea    -0x1f0(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1214 <main+0x94>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x200(%rbp)
movl   $0x0,-0x204(%rbp)
movl   $0x1,-0x208(%rbp)
mov    -0x208(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13e5 <main+0x265>
movslq -0x208(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x200(%rbp),%rcx
cmp    -0x90(%rbp,%rcx,4),%eax
jle    139e <main+0x21e>
mov    -0x208(%rbp),%eax
mov    %eax,-0x200(%rbp)
movslq -0x208(%rbp),%rax
mov    -0x110(%rbp,%rax,4),%eax
movslq -0x204(%rbp),%rcx
cmp    -0x110(%rbp,%rcx,4),%eax
jle    13cc <main+0x24c>
mov    -0x208(%rbp),%eax
mov    %eax,-0x204(%rbp)
jmp    13d1 <main+0x251>
mov    -0x208(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x208(%rbp)
jmp    1361 <main+0x1e1>
mov    -0x200(%rbp),%esi
add    $0x1,%esi
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x204(%rbp),%esi
add    $0x1,%esi
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x180(%rbp),%rsi
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
lea    0xe78(%rip),%rdi
lea    0xe7c(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     14a6 <main+0x336>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movq   $0x0,0x100(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x80(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movl   $0x0,0x170(%rsp)
lea    0xdc9(%rip),%rsi
lea    0x180(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
test   %eax,%eax
jle    13d0 <main+0x260>
lea    0xdad(%rip),%r14
lea    0xc(%rsp),%r15
movl   $0x0,0x8(%rsp)
xor    %r12d,%r12d
jmp    12b1 <main+0x141>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xd87(%rip),%rsi
lea    0x180(%rsp),%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
test   %eax,%eax
jle    1369 <main+0x1f9>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
je     1320 <main+0x1b0>
xor    %ecx,%ecx
xor    %r13d,%r13d
jmp    12fc <main+0x18c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0xc(%rsp),%eax
mov    %rbp,%rcx
cmp    $0xffffffff,%eax
je     1322 <main+0x1b2>
movslq %r12d,%r12
lea    0x1(%rcx),%rbp
cmp    %r12,%rcx
cmovge %ebp,%r12d
test   %eax,%eax
je     12e0 <main+0x170>
add    %eax,%r13d
addl   $0x1,0x90(%rsp,%rcx,4)
01
jmp    12e0 <main+0x170>
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
shl    $0x20,%rbp
movabs $0xffffffff00000000,%rax
ff ff ff
add    %rax,%rbp
sar    $0x1e,%rbp
addl   $0x1,0x10(%rsp,%rbp,1)
cmp    0x8(%rsp),%r13d
jle    1290 <main+0x120>
lea    0x110(%rsp),%rdi
lea    0x180(%rsp),%rsi
call   1030 <strcpy@plt>
mov    %r13d,%eax
mov    %r13d,0x8(%rsp)
jmp    1290 <main+0x120>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    $0x1,%esi
mov    $0x1,%r14d
cmp    $0x2,%r12d
jl     13e3 <main+0x273>
mov    %r12d,%r8d
add    $0xffffffffffffffff,%r8
cmp    $0x2,%r12d
jne    142c <main+0x2bc>
xor    %r14d,%r14d
mov    $0x1,%eax
xor    %esi,%esi
test   $0x1,%r8b
je     13c7 <main+0x257>
mov    0x90(%rsp,%rax,4),%ecx
movslq %esi,%rsi
cmp    0x90(%rsp,%rsi,4),%ecx
cmovg  %eax,%esi
mov    0x10(%rsp,%rax,4),%ecx
movslq %r14d,%r14
cmp    0x10(%rsp,%r14,4),%ecx
cmovg  %eax,%r14d
add    $0x1,%esi
add    $0x1,%r14d
jmp    13e3 <main+0x273>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    $0x1,%esi
mov    $0x1,%r14d
lea    0xc3f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc4b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc5d(%rip),%rdi
lea    0x110(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r8,%r9
and    $0xfffffffffffffffe,%r9
xor    %r14d,%r14d
mov    $0x1,%eax
xor    %esi,%esi
jmp    144d <main+0x2dd>
nop
add    $0x2,%rax
cmp    %r9,%rbx
je     139d <main+0x22d>
movslq %esi,%rbp
mov    0x90(%rsp,%rax,4),%ebx
mov    %eax,%edi
cmp    0x90(%rsp,%rbp,4),%ebx
jg     1464 <main+0x2f4>
mov    %esi,%edi
movslq %r14d,%rsi
mov    0x10(%rsp,%rax,4),%ebx
mov    %eax,%ebp
cmp    0x10(%rsp,%rsi,4),%ebx
jg     1476 <main+0x306>
mov    %r14d,%ebp
mov    0x94(%rsp,%rax,4),%ecx
movslq %edi,%rdx
lea    0x1(%rax),%rbx
mov    %ebx,%esi
cmp    0x90(%rsp,%rdx,4),%ecx
jg     1491 <main+0x321>
mov    %edi,%esi
mov    0x14(%rsp,%rax,4),%ecx
movslq %ebp,%rdx
mov    %ebx,%r14d
cmp    0x10(%rsp,%rdx,4),%ecx
jg     1440 <main+0x2d0>
mov    %ebp,%r14d
jmp    1440 <main+0x2d0>
lea    0xb60(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"./work.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"Error opening file!\00"
@.str.3 = [5 x i8] c"%99s\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [26 x i8] c"Dia com mais tarefas: %d\0A\00"
@.str.6 = [35 x i8] c"Dia com mais tarefas acabadas: %d\0A\00"
@.str.7 = [35 x i8] c"Tarefa com mais trabalhadores: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [30 x i32]
%5 = alloca [30 x i32]
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca [100 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %1
%15 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %15, i32** %2
%16 = load i32*, i32** %2
%17 = icmp ne i32* %16, null
br i1 %17, label %21, label %18
18: ; preds = %0
%19 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %0
store i32 0, i32* %3
%22 = bitcast [30 x i32]* %4 to i8*
%23 = bitcast [30 x i32]* %5 to i8*
%24 = bitcast [100 x i8]* %6 to i8*
store i32 0, i32* %7
br label %25
25: ; preds = %77, %21
%26 = load i32*, i32** %2
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%28 = call i32 (i32*, i8*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = icmp slt i32 %28, 1
br i1 %29, label %30, label %31
30: ; preds = %25
br label %78
31: ; preds = %25
store i32 0, i32* %9
store i32 0, i32* %10
br label %32
32: ; preds = %65, %31
%33 = load i32*, i32** %2
%34 = call i32 (i32*, i8*, ...) @fscanf(i32* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %11)
%35 = load i32, i32* %11
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %44
37: ; preds = %32
%38 = load i32, i32* %10
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
br label %68
44: ; preds = %32
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
%47 = load i32, i32* %3
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = load i32, i32* %10
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
br label %52
52: ; preds = %49, %44
%53 = load i32, i32* %11
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %64
55: ; preds = %52
%56 = load i32, i32* %11
%57 = load i32, i32* %9
%58 = add nsw i32 %57, %56
store i32 %58, i32* %9
%59 = load i32, i32* %10
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 1
store i32 %63, i32* %61
br label %64
64: ; preds = %55, %52
br label %65
65: ; preds = %64
%66 = load i32, i32* %10
%67 = add nsw i32 %66, 1
store i32 %67, i32* %10
br label %32
68: ; preds = %37
%69 = load i32, i32* %9
%70 = load i32, i32* %7
%71 = icmp sgt i32 %69, %70
br i1 %71, label %72, label %77
72: ; preds = %68
%73 = load i32, i32* %9
store i32 %73, i32* %7
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%76 = call i32 @strcpy(i8* %74, i8* %75)
br label %77
77: ; preds = %72, %68
br label %25
78: ; preds = %30
%79 = load i32*, i32** %2
%80 = call i32 @fclose(i32* %79)
store i32 0, i32* %12
store i32 0, i32* %13
store i32 1, i32* %14
br label %81
81: ; preds = %110, %78
%82 = load i32, i32* %14
%83 = load i32, i32* %3
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %113
85: ; preds = %81
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 %87
%89 = load i32, i32* %88
%90 = load i32, i32* %12
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = icmp sgt i32 %89, %93
br i1 %94, label %95, label %97
95: ; preds = %85
%96 = load i32, i32* %14
store i32 %96, i32* %12
br label %97
97: ; preds = %95, %85
%98 = load i32, i32* %14
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = load i32, i32* %13
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = icmp sgt i32 %101, %105
br i1 %106, label %107, label %109
107: ; preds = %97
%108 = load i32, i32* %14
store i32 %108, i32* %13
br label %109
109: ; preds = %107, %97
br label %110
110: ; preds = %109
%111 = load i32, i32* %14
%112 = add nsw i32 %111, 1
store i32 %112, i32* %14
br label %81
113: ; preds = %81
%114 = load i32, i32* %12
%115 = add nsw i32 %114, 1
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %115)
%117 = load i32, i32* %13
%118 = add nsw i32 %117, 1
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %118)
%120 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* %120)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./work.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"Error opening file!\00"
@.str.3 = [5 x i8] c"%99s\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [26 x i8] c"Dia com mais tarefas: %d\0A\00"
@.str.6 = [35 x i8] c"Dia com mais tarefas acabadas: %d\0A\00"
@.str.7 = [35 x i8] c"Tarefa com mais trabalhadores: %s\0A\00"
define i32 @main() {
%1 = alloca [30 x i32]
%2 = alloca [30 x i32]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %0
%12 = bitcast [30 x i32]* %1 to i8*
%13 = bitcast [30 x i32]* %2 to i8*
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%16 = call i32 (i32*, i8*, ...) @fscanf(i32* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @fclose(i32* %6)
br label %104
20: ; preds = %11
%21 = bitcast i32* %5 to i8*
br label %22
22: ; preds = %20, %62
%23 = phi i32 [ 0, %20 ], [ %63, %62 ]
%24 = phi i32 [ 0, %20 ], [ %50, %62 ]
%25 = call i32 (i32*, i8*, ...) @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, -1
br i1 %27, label %49, label %28
28: ; preds = %22, %44
%29 = phi i64 [ %35, %44 ], [ 0, %22 ]
%30 = phi i32 [ %47, %44 ], [ %26, %22 ]
%31 = phi i32 [ %45, %44 ], [ 0, %22 ]
%32 = phi i32 [ %37, %44 ], [ %24, %22 ]
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %29, %33
%35 = add nuw i64 %29, 1
%36 = trunc i64 %35 to i32
%37 = select i1 %34, i32 %32, i32 %36
%38 = icmp eq i32 %30, 0
br i1 %38, label %44, label %39
39: ; preds = %28
%40 = add nsw i32 %30, %31
%41 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %29
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
br label %44
44: ; preds = %28, %39
%45 = phi i32 [ %31, %28 ], [ %40, %39 ]
%46 = call i32 (i32*, i8*, ...) @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%47 = load i32, i32* %5
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %28
49: ; preds = %44, %22
%50 = phi i32 [ %24, %22 ], [ %37, %44 ]
%51 = phi i32 [ 0, %22 ], [ %45, %44 ]
%52 = phi i64 [ 0, %22 ], [ %35, %44 ]
%53 = shl i64 %52, 32
%54 = add i64 %53, -4294967296
%55 = ashr exact i64 %54, 32
%56 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = add nsw i32 %57, 1
store i32 %58, i32* %56
%59 = icmp sgt i32 %51, %23
br i1 %59, label %60, label %62
60: ; preds = %49
%61 = call i32 @strcpy(i8* %14, i8* %15)
br label %62
62: ; preds = %49, %60
%63 = phi i32 [ %51, %60 ], [ %23, %49 ]
%64 = call i32 (i32*, i8*, ...) @fscanf(i32* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%65 = icmp slt i32 %64, 1
br i1 %65, label %66, label %22
66: ; preds = %62
%67 = call i32 @fclose(i32* %6)
%68 = icmp sgt i32 %50, 1
br i1 %68, label %69, label %104
69: ; preds = %66
%70 = zext i32 %50 to i64
%71 = add nsw i64 %70, -1
%72 = and i64 %71, 1
%73 = icmp eq i32 %50, 2
br i1 %73, label %76, label %74
74: ; preds = %69
%75 = and i64 %71, -2
br label %110
76: ; preds = %110, %69
%77 = phi i32 [ undef, %69 ], [ %138, %110 ]
%78 = phi i32 [ undef, %69 ], [ %145, %110 ]
%79 = phi i64 [ 1, %69 ], [ %146, %110 ]
%80 = phi i32 [ 0, %69 ], [ %145, %110 ]
%81 = phi i32 [ 0, %69 ], [ %138, %110 ]
%82 = icmp eq i64 %72, 0
br i1 %82, label %99, label %83
83: ; preds = %76
%84 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %79
%85 = load i32, i32* %84
%86 = sext i32 %81 to i64
%87 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = icmp sgt i32 %85, %88
%90 = trunc i64 %79 to i32
%91 = select i1 %89, i32 %90, i32 %81
%92 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %79
%93 = load i32, i32* %92
%94 = sext i32 %80 to i64
%95 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = icmp sgt i32 %93, %96
%98 = select i1 %97, i32 %90, i32 %80
br label %99
99: ; preds = %76, %83
%100 = phi i32 [ %77, %76 ], [ %91, %83 ]
%101 = phi i32 [ %78, %76 ], [ %98, %83 ]
%102 = add i32 %100, 1
%103 = add i32 %101, 1
br label %104
104: ; preds = %18, %99, %66
%105 = phi i32 [ 1, %66 ], [ %102, %99 ], [ 1, %18 ]
%106 = phi i32 [ 1, %66 ], [ %103, %99 ], [ 1, %18 ]
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %105)
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %106)
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* %14)
ret i32 0
110: ; preds = %110, %74
%111 = phi i64 [ 1, %74 ], [ %146, %110 ]
%112 = phi i32 [ 0, %74 ], [ %145, %110 ]
%113 = phi i32 [ 0, %74 ], [ %138, %110 ]
%114 = phi i64 [ 0, %74 ], [ %147, %110 ]
%115 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %111
%116 = load i32, i32* %115
%117 = sext i32 %113 to i64
%118 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = icmp sgt i32 %116, %119
%121 = trunc i64 %111 to i32
%122 = select i1 %120, i32 %121, i32 %113
%123 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %111
%124 = load i32, i32* %123
%125 = sext i32 %112 to i64
%126 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %125
%127 = load i32, i32* %126
%128 = icmp sgt i32 %124, %127
%129 = select i1 %128, i32 %121, i32 %112
%130 = add nuw nsw i64 %111, 1
%131 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %130
%132 = load i32, i32* %131
%133 = sext i32 %122 to i64
%134 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %133
%135 = load i32, i32* %134
%136 = icmp sgt i32 %132, %135
%137 = trunc i64 %130 to i32
%138 = select i1 %136, i32 %137, i32 %122
%139 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %130
%140 = load i32, i32* %139
%141 = sext i32 %129 to i64
%142 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %141
%143 = load i32, i32* %142
%144 = icmp sgt i32 %140, %143
%145 = select i1 %144, i32 %137, i32 %129
%146 = add nuw nsw i64 %111, 2
%147 = add i64 %114, 2
%148 = icmp eq i64 %147, %75
br i1 %148, label %76, label %110
}