#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char **argv) {
  FILE *file;
  char buffer[160];
  int grafo[80][80], i, j;
  file = fopen("test.txt", "r");
  for (i = 0; (i < 80) && (!feof(file)); i++) {
    fgets(buffer, 160, file);
    for (j = 0; j < 80; j++)
      grafo[i][j] = buffer[j * 2] == '1';
  }
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x64d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x64c4(%rbp)
xor    %eax,%eax
cmpl   $0x50,-0x64c4(%rbp)
mov    %al,-0x64c9(%rbp)
jge    11a6 <main+0x66>
mov    -0x18(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x64c9(%rbp)
mov    -0x64c9(%rbp),%al
test   $0x1,%al
jne    11b9 <main+0x79>
jmp    1252 <main+0x112>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xa0,%esi
call   1040 <fgets@plt>
movl   $0x0,-0x64c8(%rbp)
cmpl   $0x50,-0x64c8(%rbp)
jge    1239 <main+0xf9>
mov    -0x64c8(%rbp),%eax
shl    $0x1,%eax
cltq
movsbl -0xc0(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
movslq -0x64c4(%rbp),%rcx
lea    -0x64c0(%rbp),%rax
imul   $0x140,%rcx,%rcx
add    %rcx,%rax
movslq -0x64c8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x64c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64c8(%rbp)
jmp    11d8 <main+0x98>
jmp    123e <main+0xfe>
mov    -0x64c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64c4(%rbp)
jmp    117a <main+0x3a>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x64d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
lea    0xeae(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    $0x50,%ebp
mov    %rsp,%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1191 <main+0x51>
mov    %r14,%rdi
mov    $0xa0,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x30>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [160 x i8]
%8 = alloca [80 x [80 x i32]]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %6
store i32 0, i32* %9
br label %12
12: ; preds = %48, %2
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 80
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32*, i32** %6
%17 = call i32 @feof(i32* %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br label %20
20: ; preds = %15, %12
%21 = phi i1 [ false, %12 ], [ %19, %15 ]
br i1 %21, label %22, label %51
22: ; preds = %20
%23 = getelementptr inbounds [160 x i8], [160 x i8]* %7, i64 0, i64 0
%24 = load i32*, i32** %6
%25 = call i32 @fgets(i8* %23, i32 160, i32* %24)
store i32 0, i32* %10
br label %26
26: ; preds = %44, %22
%27 = load i32, i32* %10
%28 = icmp slt i32 %27, 80
br i1 %28, label %29, label %47
29: ; preds = %26
%30 = load i32, i32* %10
%31 = mul nsw i32 %30, 2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [160 x i8], [160 x i8]* %7, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 49
%37 = zext i1 %36 to i32
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [80 x [80 x i32]], [80 x [80 x i32]]* %8, i64 0, i64 %39
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [80 x i32], [80 x i32]* %40, i64 0, i64 %42
store i32 %37, i32* %43
br label %44
44: ; preds = %29
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
store i32 %46, i32* %10
br label %26
47: ; preds = %26
br label %48
48: ; preds = %47
%49 = load i32, i32* %9
%50 = add nsw i32 %49, 1
store i32 %50, i32* %9
br label %12
51: ; preds = %20
%52 = load i32*, i32** %6
%53 = call i32 @fclose(i32* %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [160 x i8]
%4 = getelementptr inbounds [160 x i8], [160 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %2, %10
%7 = phi i32 [ 0, %2 ], [ %12, %10 ]
%8 = call i32 @feof(i32* %5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = call i32 @fgets(i8* %4, i32 160, i32* %5)
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, 80
br i1 %13, label %14, label %6
14: ; preds = %10, %6
%15 = call i32 @fclose(i32* %5)
ret i32 0
}