#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ add(int, char **);
int /*<<< orphan*/ create(int, char **);
int /*<<< orphan*/ help();
int /*<<< orphan*/ set(int, char **);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    help();
    return (EXIT_FAILURE);
  }
  char *cmd = argv[1];
  if (!strcmp(cmd, "create")) {
    create(argc, argv);
  } else if (!strcmp(cmd, "add")) {
    add(argc, argv);
  } else if (!strcmp(cmd, "set")) {
    set(argc, argv);
  } else
    help();
  return (EXIT_SUCCESS);
}


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    1188 <main+0x38>
mov    $0x0,%al
call   1060 <help@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122f <main+0xdf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11be <main+0x6e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <create@plt>
jmp    1223 <main+0xd3>
mov    -0x18(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11e8 <main+0x98>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <add@plt>
jmp    121e <main+0xce>
mov    -0x18(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1212 <main+0xc2>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <set@plt>
jmp    1219 <main+0xc9>
mov    $0x0,%al
call   1060 <help@plt>
jmp    121e <main+0xce>
jmp    1223 <main+0xd3>
mov    0x2dae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jg     1169 <main+0x19>
xor    %eax,%eax
call   1060 <help@plt>
mov    0x2e79(%rip),%rax
jmp    11dd <main+0x8d>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b4 <main+0x64>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11c0 <main+0x70>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11cc <main+0x7c>
xor    %eax,%eax
call   1060 <help@plt>
jmp    11d6 <main+0x86>
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <create@plt>
jmp    11d6 <main+0x86>
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <add@plt>
jmp    11d6 <main+0x86>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <set@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [7 x i8] c"create\00"
@.str.1 = [4 x i8] c"add\00"
@.str.2 = [4 x i8] c"set\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (...) @help()
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %45
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %12
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @create(i32 %20, i8** %21)
br label %43
23: ; preds = %12
%24 = load i8*, i8** %6
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i32, i32* %4
%29 = load i8**, i8*** %5
%30 = call i32 @add(i32 %28, i8** %29)
br label %42
31: ; preds = %23
%32 = load i8*, i8** %6
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %31
%36 = load i32, i32* %4
%37 = load i8**, i8*** %5
%38 = call i32 @set(i32 %36, i8** %37)
br label %41
39: ; preds = %31
%40 = call i32 (...) @help()
br label %41
41: ; preds = %39, %35
br label %42
42: ; preds = %41, %27
br label %43
43: ; preds = %42, %19
%44 = load i32, i32* @EXIT_SUCCESS
store i32 %44, i32* %3
br label %45
45: ; preds = %43, %9
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [7 x i8] c"create\00"
@.str.1 = [4 x i8] c"add\00"
@.str.2 = [4 x i8] c"set\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @help()
br label %25
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @create(i32 %0, i8** %1)
br label %25
13: ; preds = %6
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @add(i32 %0, i8** %1)
br label %25
18: ; preds = %13
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @set(i32 %0, i8** %1)
br label %25
23: ; preds = %18
%24 = tail call i32 (...) @help()
br label %25
25: ; preds = %11, %21, %23, %16, %4
%26 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %16 ], [ @EXIT_SUCCESS, %23 ], [ @EXIT_SUCCESS, %21 ], [ @EXIT_SUCCESS, %11 ]
%27 = load i32, i32* %26
ret i32 %27
}