#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*/ big_file(int);
int /*<<< orphan*/ concur();
int /*<<< orphan*/ dir_test(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int tv = 0;
  if (argc > 1) {
    if (*argv[1] == '1') {
      tv = 0x1;
    } else if (*argv[1] == '2') {
      tv = 0x2;
    } else if (*argv[1] == '3') {
      tv = 0x4;
    }
  } else {
    tv = (0x1 | 0x2 | 0x4);
  }
  if (tv & 0x1) {
    printf("[BIGFILE] : Run #1\n");
    big_file((270 * (2 * 512 + 1)));
    printf("[BIGFILE] : Run #2\n");
    big_file((270 * (2 * 512 + 1)));
  }
  if (tv & 0x2) {
    printf("[DIRTEST] : Run #1\n");
    dir_test(8);
    printf("[DIRTEST] : Run #2\n");
    dir_test(8);
  }
  if (tv & 0x4) {
    printf("[CONCUR]\n");
    concur();
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11d1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1187 <main+0x47>
movl   $0x1,-0x14(%rbp)
jmp    11cc <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    11a7 <main+0x67>
movl   $0x2,-0x14(%rbp)
jmp    11c7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x33,%eax
jne    11c2 <main+0x82>
movl   $0x4,-0x14(%rbp)
jmp    11c7 <main+0x87>
jmp    11cc <main+0x8c>
jmp    11d8 <main+0x98>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1213 <main+0xd3>
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4390e,%edi
call   1050 <big_file@plt>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4390e,%edi
call   1050 <big_file@plt>
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     124e <main+0x10e>
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <dir_test@plt>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <dir_test@plt>
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1270 <main+0x130>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <concur@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%ebx
cmp    $0x2,%edi
jl     1162 <main+0x22>
mov    0x8(%rsi),%rax
mov    (%rax),%al
cmp    $0x33,%al
je     1198 <main+0x58>
cmp    $0x32,%al
je     11af <main+0x6f>
mov    $0x1,%ebx
cmp    $0x31,%al
jne    11ab <main+0x6b>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4390e,%edi
call   1050 <big_file@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4390e,%edi
call   1050 <big_file@plt>
test   $0x2,%bl
jne    11b4 <main+0x74>
test   $0x4,%bl
je     11ab <main+0x6b>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <concur@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x2,%ebx
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <dir_test@plt>
lea    0xe4b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <dir_test@plt>
test   $0x4,%bl
jne    1198 <main+0x58>
jmp    11ab <main+0x6b>

LLVM IR (-O0):
@.str = [20 x i8] c"[BIGFILE] : Run\0A\00"
@.str.1 = [20 x i8] c"[BIGFILE] : Run\0A\00"
@.str.2 = [20 x i8] c"[DIRTEST] : Run\0A\00"
@.str.3 = [20 x i8] c"[DIRTEST] : Run\0A\00"
@.str.4 = [10 x i8] c"[CONCUR]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %36
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 49
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 1, i32* %6
br label %35
17: ; preds = %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 50
br i1 %23, label %24, label %25
24: ; preds = %17
store i32 2, i32* %6
br label %34
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 51
br i1 %31, label %32, label %33
32: ; preds = %25
store i32 4, i32* %6
br label %33
33: ; preds = %32, %25
br label %34
34: ; preds = %33, %24
br label %35
35: ; preds = %34, %16
br label %37
36: ; preds = %2
store i32 7, i32* %6
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %6
%39 = and i32 %38, 1
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%43 = call i32 @big_file(i32 276750)
%44 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%45 = call i32 @big_file(i32 276750)
br label %46
46: ; preds = %41, %37
%47 = load i32, i32* %6
%48 = and i32 %47, 2
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%52 = call i32 @dir_test(i32 8)
%53 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%54 = call i32 @dir_test(i32 8)
br label %55
55: ; preds = %50, %46
%56 = load i32, i32* %6
%57 = and i32 %56, 4
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%61 = call i32 (...) @concur()
br label %62
62: ; preds = %59, %55
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"[CONCUR]\00"
@str.5 = [19 x i8] c"[DIRTEST] : Run\00"
@str.6 = [19 x i8] c"[DIRTEST] : Run\00"
@str.7 = [19 x i8] c"[BIGFILE] : Run\00"
@str.8 = [19 x i8] c"[BIGFILE] : Run\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
switch i8 %7, label %29 [
i8 49, label %8
i8 50, label %16
i8 51, label %26
]
8: ; preds = %2, %4
%9 = phi i32 [ 1, %4 ], [ 7, %2 ]
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
%11 = tail call i32 @big_file(i32 276750)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0))
%13 = tail call i32 @big_file(i32 276750)
%14 = and i32 %9, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %4, %8
%17 = phi i32 [ %9, %8 ], [ 2, %4 ]
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%19 = tail call i32 @dir_test(i32 8)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0))
%21 = tail call i32 @dir_test(i32 8)
br label %22
22: ; preds = %16, %8
%23 = phi i32 [ %17, %16 ], [ %9, %8 ]
%24 = and i32 %23, 4
%25 = icmp eq i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %4, %22
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%28 = tail call i32 (...) @concur()
br label %29
29: ; preds = %4, %26, %22
ret i32 0
}