#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*/ Cal_EST();
int /*<<< orphan*/ Cal_LCT();
int /*<<< orphan*/ Cal_SLACK();
int /*<<< orphan*/ Cal_T_E_and_SD();
int /*<<< orphan*/ Read_Network(char *);
int /*<<< orphan*/ Top_Sort();
int /*<<< orphan*/ Write_Result(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("Usage : progname networkfile resfile\n");
    exit(0);
  }
  Read_Network(argv[1]);
  Top_Sort();
  Cal_T_E_and_SD();
  Cal_EST();
  Cal_LCT();
  Cal_SLACK();
  Write_Result(argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c3 <main+0x33>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <Read_Network@plt>
mov    $0x0,%al
call   1070 <Top_Sort@plt>
mov    $0x0,%al
call   1030 <Cal_T_E_and_SD@plt>
mov    $0x0,%al
call   10a0 <Cal_EST@plt>
mov    $0x0,%al
call   1050 <Cal_LCT@plt>
mov    $0x0,%al
call   1080 <Cal_SLACK@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <Write_Result@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jle    11d2 <main+0x42>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <Read_Network@plt>
xor    %eax,%eax
call   1070 <Top_Sort@plt>
xor    %eax,%eax
call   1030 <Cal_T_E_and_SD@plt>
xor    %eax,%eax
call   10a0 <Cal_EST@plt>
xor    %eax,%eax
call   1050 <Cal_LCT@plt>
xor    %eax,%eax
call   1080 <Cal_SLACK@plt>
mov    0x10(%rbx),%rdi
call   10b0 <Write_Result@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe27(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage : progname networkfile resfile\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @Read_Network(i8* %14)
%16 = call i32 (...) @Top_Sort()
%17 = call i32 (...) @Cal_T_E_and_SD()
%18 = call i32 (...) @Cal_EST()
%19 = call i32 (...) @Cal_LCT()
%20 = call i32 (...) @Cal_SLACK()
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @Write_Result(i8* %23)
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage : progname networkfile resfile\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @Read_Network(i8* %9)
%11 = tail call i32 (...) @Top_Sort()
%12 = tail call i32 (...) @Cal_T_E_and_SD()
%13 = tail call i32 (...) @Cal_EST()
%14 = tail call i32 (...) @Cal_LCT()
%15 = tail call i32 (...) @Cal_SLACK()
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @Write_Result(i8* %17)
ret i32 0
}