#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*/ displayUsage();
int /*<<< orphan*/ printf(char *, char *);
int sendAlert(char *);
int sendHideAll();
int sendShowAll();
int sendStop();
int sendToggleAll();
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2 || strcmp(argv[1], "-h") == 0 ||
      strcmp(argv[1], "--help") == 0) {
    displayUsage();
    return 0;
  }
  if (strcmp(argv[1], "hide-all") == 0) {
    return sendHideAll();
  }
  if (strcmp(argv[1], "show-all") == 0) {
    return sendShowAll();
  }
  if (strcmp(argv[1], "alert") == 0) {
    return sendAlert(argc >= 3 ? argv[2] : NULL);
  }
  if (strcmp(argv[1], "stop") == 0) {
    return sendStop();
  }
  if (strcmp(argv[1], "toggle-all") == 0) {
    return sendToggleAll();
  }
  printf("There is no command called \"%s\"\n\n", argv[1]);
  displayUsage();
  return 1;
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     11dc <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe51(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11dc <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe36(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ef <main+0x6f>
mov    $0x0,%al
call   1080 <displayUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    121c <main+0x9c>
mov    $0x0,%al
call   10a0 <sendHideAll@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1249 <main+0xc9>
mov    $0x0,%al
call   1030 <sendShowAll@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    129e <main+0x11e>
cmpl   $0x3,-0x8(%rbp)
jl     1282 <main+0x102>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    128d <main+0x10d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    128d <main+0x10d>
mov    -0x18(%rbp),%rdi
call   1040 <sendAlert@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd75(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12cb <main+0x14b>
mov    $0x0,%al
call   1070 <sendStop@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd4d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12f8 <main+0x178>
mov    $0x0,%al
call   1090 <sendToggleAll@plt>
mov    %eax,-0x4(%rbp)
jmp    131a <main+0x19a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd2b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <displayUsage@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     124e <main+0xce>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe64(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     124e <main+0xce>
mov    0x8(%rbx),%rdi
lea    0xe4e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     124e <main+0xce>
mov    0x8(%rbx),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1260 <main+0xe0>
mov    0x8(%rbx),%rdi
lea    0xe2c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     126d <main+0xed>
mov    0x8(%rbx),%rdi
lea    0xe20(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     127a <main+0xfa>
mov    0x8(%rbx),%rdi
lea    0xe11(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1285 <main+0x105>
mov    0x8(%rbx),%rdi
lea    0xe01(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     129f <main+0x11f>
mov    0x8(%rbx),%rsi
lea    0xdf7(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <displayUsage@plt>
mov    $0x1,%ebx
jmp    1257 <main+0xd7>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <displayUsage@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10a0 <sendHideAll@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sendShowAll@plt>
cmp    $0x3,%ebp
jb     1292 <main+0x112>
mov    0x10(%rbx),%rdi
jmp    1294 <main+0x114>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <sendStop@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sendAlert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1090 <sendToggleAll@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [9 x i8] c"hide-all\00"
@.str.3 = [9 x i8] c"show-all\00"
@.str.4 = [6 x i8] c"alert\00"
@.str.5 = [5 x i8] c"stop\00"
@.str.6 = [11 x i8] c"toggle-all\00"
@.str.7 = [34 x i8] c"There is no command called \22%s\22\0A\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, 2
br i1 %7, label %20, label %8
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14, %8, %2
%21 = call i32 (...) @displayUsage()
store i32 0, i32* %3
br label %77
22: ; preds = %14
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 (...) @sendHideAll()
store i32 %29, i32* %3
br label %77
30: ; preds = %22
%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 ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 (...) @sendShowAll()
store i32 %37, i32* %3
br label %77
38: ; preds = %30
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %55
44: ; preds = %38
%45 = load i32, i32* %4
%46 = icmp sge i32 %45, 3
br i1 %46, label %47, label %51
47: ; preds = %44
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
br label %52
51: ; preds = %44
br label %52
52: ; preds = %51, %47
%53 = phi i8* [ %50, %47 ], [ null, %51 ]
%54 = call i32 @sendAlert(i8* %53)
store i32 %54, i32* %3
br label %77
55: ; preds = %38
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %55
%62 = call i32 (...) @sendStop()
store i32 %62, i32* %3
br label %77
63: ; preds = %55
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = load i8*, i8** %65
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %63
%70 = call i32 (...) @sendToggleAll()
store i32 %70, i32* %3
br label %77
71: ; preds = %63
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 1
%74 = load i8*, i8** %73
%75 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %74)
%76 = call i32 (...) @displayUsage()
store i32 1, i32* %3
br label %77
77: ; preds = %71, %69, %61, %52, %36, %28, %20
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [9 x i8] c"hide-all\00"
@.str.3 = [9 x i8] c"show-all\00"
@.str.4 = [6 x i8] c"alert\00"
@.str.5 = [5 x i8] c"stop\00"
@.str.6 = [11 x i8] c"toggle-all\00"
@.str.7 = [34 x i8] c"There is no command called \22%s\22\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = load i8*, i8** %5
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9, %4, %2
%14 = tail call i32 (...) @displayUsage()
br label %55
15: ; preds = %9
%16 = load i8*, i8** %5
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 (...) @sendHideAll()
br label %55
21: ; preds = %15
%22 = load i8*, i8** %5
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = tail call i32 (...) @sendShowAll()
br label %55
27: ; preds = %21
%28 = load i8*, i8** %5
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %27
%32 = icmp ugt i32 %0, 2
br i1 %32, label %33, label %36
33: ; preds = %31
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
br label %36
36: ; preds = %31, %33
%37 = phi i8* [ %35, %33 ], [ null, %31 ]
%38 = tail call i32 @sendAlert(i8* %37)
br label %55
39: ; preds = %27
%40 = load i8*, i8** %5
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 (...) @sendStop()
br label %55
45: ; preds = %39
%46 = load i8*, i8** %5
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 (...) @sendToggleAll()
br label %55
51: ; preds = %45
%52 = load i8*, i8** %5
%53 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %52)
%54 = tail call i32 (...) @displayUsage()
br label %55
55: ; preds = %51, %49, %43, %36, %25, %19, %13
%56 = phi i32 [ 0, %13 ], [ %20, %19 ], [ %26, %25 ], [ %38, %36 ], [ %44, %43 ], [ %50, %49 ], [ 1, %51 ]
ret i32 %56
}