#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*/ printIntro();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setup();
int /*<<< orphan*/ testCalcCrcFullMap();
int /*<<< orphan*/ testCalcCrcZeros();
int /*<<< orphan*/ testIncrFile(char *);
int main(int argc, char *argv[]) {
  printIntro();
  setup();
  if (argc == 2) {
    testIncrFile(argv[1]);
  } else {
    testCalcCrcZeros();
    testCalcCrcFullMap();
  }
  printf("Done.\n");
  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)
mov    $0x0,%al
call   1040 <printIntro@plt>
mov    $0x0,%al
call   1080 <setup@plt>
cmpl   $0x2,-0x8(%rbp)
jne    11a0 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <testIncrFile@plt>
jmp    11ae <main+0x4e>
mov    $0x0,%al
call   1050 <testCalcCrcZeros@plt>
mov    $0x0,%al
call   1070 <testCalcCrcFullMap@plt>
lea    0xe4b(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <printIntro@plt>
xor    %eax,%eax
call   1080 <setup@plt>
cmp    $0x2,%ebp
jne    1186 <main+0x26>
mov    0x8(%rbx),%rdi
call   1030 <testIncrFile@plt>
jmp    1194 <main+0x34>
xor    %eax,%eax
call   1060 <testCalcCrcZeros@plt>
xor    %eax,%eax
call   1070 <testCalcCrcFullMap@plt>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Done.\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 = call i32 (...) @printIntro()
%7 = call i32 (...) @setup()
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @testIncrFile(i8* %13)
br label %18
15: ; preds = %2
%16 = call i32 (...) @testCalcCrcZeros()
%17 = call i32 (...) @testCalcCrcFullMap()
br label %18
18: ; preds = %15, %10
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Done.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @printIntro()
%4 = tail call i32 (...) @setup()
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @testIncrFile(i8* %8)
br label %13
10: ; preds = %2
%11 = tail call i32 (...) @testCalcCrcZeros()
%12 = tail call i32 (...) @testCalcCrcFullMap()
br label %13
13: ; preds = %10, %6
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}