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

/* Variables and functions */
int /*<<< orphan*/ AdjacencyMatrix(int /*<<< orphan*/ *);
int /*<<< orphan*/ AdjacencyMatrix_createShortestPath();
int /*<<< orphan*/ AdjacencyMatrix_destructor();
int /*<<< orphan*/ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *fp_input = fopen(argv[1], "r");
  if (!AdjacencyMatrix(fp_input)) {
    fprintf(stderr, "Could not create adjacency matrix.\n"
                    "Program terminating.\n");
    fclose(fp_input);
    exit(1);
  }
  fclose(fp_input);
  time_t timeBegin;
  time(&timeBegin);
  AdjacencyMatrix_createShortestPath();
  time_t timeEnd;
  time(&timeEnd);
  printf("Elapsed: %lf seconds\n", difftime(timeEnd, timeBegin));
  AdjacencyMatrix_destructor();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <AdjacencyMatrix@plt>
cmp    $0x0,%eax
jne    1208 <main+0x68>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
lea    0xe12(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x1c(%rbp),%rdi
call   1080 <time@plt>
mov    $0x0,%al
call   1050 <AdjacencyMatrix_createShortestPath@plt>
lea    -0x20(%rbp),%rdi
call   1080 <time@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1060 <difftime@plt>
mov    %eax,%esi
lea    0xdfd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10c0 <AdjacencyMatrix_destructor@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rdi
lea    0xe50(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <AdjacencyMatrix@plt>
test   %eax,%eax
je     1211 <main+0x71>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xc(%rsp),%rdi
call   1080 <time@plt>
xor    %eax,%eax
call   1050 <AdjacencyMatrix_createShortestPath@plt>
lea    0x8(%rsp),%rdi
call   1080 <time@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1060 <difftime@plt>
lea    0xe40(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   10c0 <AdjacencyMatrix_destructor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
lea    0xde1(%rip),%rsi
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [57 x i8] c"Could not create adjacency matrix.\0AProgram terminating.\0A\00"
@.str.2 = [22 x i8] c"Elapsed: %lf seconds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = call i32 @AdjacencyMatrix(i32* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32*, i32** %6
%20 = call i32 @fclose(i32* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i32*, i32** %6
%24 = call i32 @fclose(i32* %23)
%25 = call i32 @time(i32* %7)
%26 = call i32 (...) @AdjacencyMatrix_createShortestPath()
%27 = call i32 @time(i32* %8)
%28 = load i32, i32* %8
%29 = load i32, i32* %7
%30 = call i32 @difftime(i32 %28, i32 %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = call i32 (...) @AdjacencyMatrix_destructor()
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [57 x i8] c"Could not create adjacency matrix.\0AProgram terminating.\0A\00"
@.str.2 = [22 x i8] c"Elapsed: %lf seconds\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @AdjacencyMatrix(i32* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @fclose(i32* %7)
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = tail call i32 @fclose(i32* %7)
%17 = bitcast i32* %3 to i8*
%18 = call i32 @time(i32* %3)
%19 = call i32 (...) @AdjacencyMatrix_createShortestPath()
%20 = bitcast i32* %4 to i8*
%21 = call i32 @time(i32* %4)
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = call i32 @difftime(i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @AdjacencyMatrix_destructor()
ret i32 0
}