#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*/ ListAllTests();
int /*<<< orphan*/ RunAllTests(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc == 2) {
    if (!strcmp(argv[1], "help")) {
      printf("iwatch [help|all|list|<casename>]\n");
      return 0;
    } else if (!strcmp(argv[1], "all")) {
      RunAllTests(NULL);
      return 0;
    } else if (!strcmp(argv[1], "list")) {
      ListAllTests();
      return 0;
    } else {
      RunAllTests(argv[1]);
    }
  } else
    RunAllTests(NULL);
}


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   $0x2,-0x8(%rbp)
jne    1213 <main+0xd3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1195 <main+0x55>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    121c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe84(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11c7 <main+0x87>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <RunAllTests@plt>
movl   $0x0,-0x4(%rbp)
jmp    121c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe56(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11f7 <main+0xb7>
mov    $0x0,%al
call   1050 <ListAllTests@plt>
movl   $0x0,-0x4(%rbp)
jmp    121c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <RunAllTests@plt>
jmp    1209 <main+0xc9>
jmp    120e <main+0xce>
jmp    121c <main+0xdc>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <RunAllTests@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1188 <main+0x48>
mov    0x8(%rsi),%rbx
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1193 <main+0x53>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1188 <main+0x48>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11a1 <main+0x61>
mov    %rbx,%rdi
jmp    118a <main+0x4a>
xor    %edi,%edi
call   1040 <RunAllTests@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
jmp    118f <main+0x4f>
xor    %eax,%eax
call   1050 <ListAllTests@plt>
jmp    118f <main+0x4f>

LLVM IR (-O0):
@.str = [5 x i8] c"help\00"
@.str.1 = [35 x i8] c"iwatch [help|all|list|<casename>]\0A\00"
@.str.2 = [4 x i8] c"all\00"
@.str.3 = [5 x i8] c"list\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 eq i32 %6, 2
br i1 %7, label %8, label %40
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %42
16: ; preds = %8
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = call i32 @RunAllTests(i8* null)
store i32 0, i32* %3
br label %42
24: ; preds = %16
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %24
%31 = call i32 (...) @ListAllTests()
store i32 0, i32* %3
br label %42
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @RunAllTests(i8* %35)
br label %37
37: ; preds = %32
br label %38
38: ; preds = %37
br label %39
39: ; preds = %38
br label %42
40: ; preds = %2
%41 = call i32 @RunAllTests(i8* null)
br label %42
42: ; preds = %14, %22, %30, %40, %39
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str = [5 x i8] c"help\00"
@.str.2 = [4 x i8] c"all\00"
@.str.3 = [5 x i8] c"list\00"
@str = [34 x i8] c"iwatch [help|all|list|<casename>]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %25
11: ; preds = %4
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @RunAllTests(i8* null)
br label %25
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (...) @ListAllTests()
br label %25
21: ; preds = %16
%22 = tail call i32 @RunAllTests(i8* %6)
br label %25
23: ; preds = %2
%24 = tail call i32 @RunAllTests(i8* null)
br label %25
25: ; preds = %9, %14, %19, %23, %21
ret i32 0
}