#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 exportMain(int, char **);
int initMain(int, char **);
int runMain(int, char **);
int /*<<< orphan*/ showHelp();
int statMain(int, char **);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3)
    showHelp();
  if (strcmp(argv[1], "init") == 0) {
    return initMain(argc, argv);
  }
  if (strcmp(argv[1], "export") == 0) {
    return exportMain(argc, argv);
  }
  if (strcmp(argv[1], "run") == 0) {
    return runMain(argc, argv);
  }
  if (strcmp(argv[1], "stat") == 0) {
    return statMain(argc, argv);
  }
  showHelp();
  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    1187 <main+0x27>
mov    $0x0,%al
call   1030 <showHelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b9 <main+0x59>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <initMain@plt>
mov    %eax,-0x4(%rbp)
jmp    125d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11eb <main+0x8b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <exportMain@plt>
mov    %eax,-0x4(%rbp)
jmp    125d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe12(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    121d <main+0xbd>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <runMain@plt>
mov    %eax,-0x4(%rbp)
jmp    125d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    124f <main+0xef>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <statMain@plt>
mov    %eax,-0x4(%rbp)
jmp    125d <main+0xfd>
mov    $0x0,%al
call   1030 <showHelp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jg     1174 <main+0x14>
xor    %eax,%eax
call   1030 <showHelp@plt>
mov    0x8(%rbx),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d8 <main+0x78>
mov    0x8(%rbx),%rdi
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e8 <main+0x88>
mov    0x8(%rbx),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11f8 <main+0x98>
mov    0x8(%rbx),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1208 <main+0xa8>
xor    %eax,%eax
call   1030 <showHelp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <initMain@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <exportMain@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <runMain@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <statMain@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"init\00"
@.str.1 = [7 x i8] c"export\00"
@.str.2 = [4 x i8] c"run\00"
@.str.3 = [5 x i8] c"stat\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 %10
8: ; preds = %2
%9 = call i32 (...) @showHelp()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @initMain(i32 %17, i8** %18)
store i32 %19, i32* %3
br label %52
20: ; preds = %10
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @exportMain(i32 %27, i8** %28)
store i32 %29, i32* %3
br label %52
30: ; preds = %20
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i32, i32* %4
%38 = load i8**, i8*** %5
%39 = call i32 @runMain(i32 %37, i8** %38)
store i32 %39, i32* %3
br label %52
40: ; preds = %30
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %40
%47 = load i32, i32* %4
%48 = load i8**, i8*** %5
%49 = call i32 @statMain(i32 %47, i8** %48)
store i32 %49, i32* %3
br label %52
50: ; preds = %40
%51 = call i32 (...) @showHelp()
store i32 0, i32* %3
br label %52
52: ; preds = %50, %46, %36, %26, %16
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str = [5 x i8] c"init\00"
@.str.1 = [7 x i8] c"export\00"
@.str.2 = [4 x i8] c"run\00"
@.str.3 = [5 x i8] c"stat\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @showHelp()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @initMain(i32 %0, i8** %1)
br label %33
13: ; preds = %6
%14 = load i8*, i8** %7
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 @exportMain(i32 %0, i8** %1)
br label %33
19: ; preds = %13
%20 = load i8*, i8** %7
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 @runMain(i32 %0, i8** %1)
br label %33
25: ; preds = %19
%26 = load i8*, i8** %7
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 @statMain(i32 %0, i8** %1)
br label %33
31: ; preds = %25
%32 = tail call i32 (...) @showHelp()
br label %33
33: ; preds = %31, %29, %23, %17, %11
%34 = phi i32 [ %12, %11 ], [ %18, %17 ], [ %24, %23 ], [ %30, %29 ], [ 0, %31 ]
ret i32 %34
}