#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*/ add(char *, char *);
int /*<<< orphan*/ check();
int /*<<< orphan*/ help();
int /*<<< orphan*/ install();
int /*<<< orphan*/ license();
int /*<<< orphan*/ list();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rem(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    help();
  } else {
    switch (argv[1][1]) {
    case 'a':
      add(argv[2], argv[3]);
      break;
    case 'r':
      rem(argv[2]);
      break;
    case 'l':
      list();
      break;
    case 'h':
      help();
      break;
    case 'c':
      check();
      break;
    case 'i':
      install();
      break;
    case 'L':
      license();
      break;
    default:
      printf("\n Invalid Option, use -h for --help \n\n");
    }
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    11ac <main+0x2c>
mov    $0x0,%al
call   1090 <help@plt>
jmp    1257 <main+0xd7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x26,%eax
ja     1246 <main+0xc6>
mov    -0x18(%rbp),%rax
lea    0xe2b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <add@plt>
jmp    1252 <main+0xd2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <rem@plt>
jmp    1252 <main+0xd2>
mov    $0x0,%al
call   1060 <list@plt>
jmp    1252 <main+0xd2>
mov    $0x0,%al
call   1090 <help@plt>
jmp    1252 <main+0xd2>
mov    $0x0,%al
call   10a0 <check@plt>
jmp    1252 <main+0xd2>
mov    $0x0,%al
call   1050 <install@plt>
jmp    1252 <main+0xd2>
mov    $0x0,%al
call   1080 <license@plt>
jmp    1252 <main+0xd2>
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
jmp    1257 <main+0xd7>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1191 <main+0x11>
xor    %eax,%eax
call   1090 <help@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffb4,%eax
cmp    $0x26,%eax
ja     11ba <main+0x3a>
lea    0xe58(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <license@plt>
jmp    118d <main+0xd>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
jmp    118d <main+0xd>
mov    0x10(%rsi),%rdi
mov    0x18(%rsi),%rsi
call   1030 <add@plt>
jmp    118d <main+0xd>
xor    %eax,%eax
call   10a0 <check@plt>
jmp    118d <main+0xd>
xor    %eax,%eax
call   1060 <list@plt>
jmp    118d <main+0xd>
mov    0x10(%rsi),%rdi
call   1070 <rem@plt>
jmp    118d <main+0xd>
xor    %eax,%eax
call   1050 <install@plt>
jmp    118d <main+0xd>

LLVM IR (-O0):
@.str = [39 x i8] c"\0A Invalid Option, use -h for --help \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 %8, label %10
8: ; preds = %2
%9 = call i32 (...) @help()
br label %43
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %40 [
i32 97, label %17
i32 114, label %25
i32 108, label %30
i32 104, label %32
i32 99, label %34
i32 105, label %36
i32 76, label %38
]
17: ; preds = %10
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i32 @add(i8* %20, i8* %23)
br label %42
25: ; preds = %10
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @rem(i8* %28)
br label %42
30: ; preds = %10
%31 = call i32 (...) @list()
br label %42
32: ; preds = %10
%33 = call i32 (...) @help()
br label %42
34: ; preds = %10
%35 = call i32 (...) @check()
br label %42
36: ; preds = %10
%37 = call i32 (...) @install()
br label %42
38: ; preds = %10
%39 = call i32 (...) @license()
br label %42
40: ; preds = %10
%41 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %42
42: ; preds = %40, %38, %36, %34, %32, %30, %25, %17
br label %43
43: ; preds = %42, %8
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"\0A Invalid Option, use -h for --help \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @help()
br label %34
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %32 [
i32 97, label %12
i32 114, label %18
i32 108, label %22
i32 104, label %24
i32 99, label %26
i32 105, label %28
i32 76, label %30
]
12: ; preds = %6
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @add(i8* %14, i8* %16)
br label %34
18: ; preds = %6
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @rem(i8* %20)
br label %34
22: ; preds = %6
%23 = tail call i32 (...) @list()
br label %34
24: ; preds = %6
%25 = tail call i32 (...) @help()
br label %34
26: ; preds = %6
%27 = tail call i32 (...) @check()
br label %34
28: ; preds = %6
%29 = tail call i32 (...) @install()
br label %34
30: ; preds = %6
%31 = tail call i32 (...) @license()
br label %34
32: ; preds = %6
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %34
34: ; preds = %12, %18, %22, %24, %26, %28, %30, %32, %4
ret i32 0
}