#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_SUCCESS;
int /*<<< orphan*/ addProfanity(char *);
int /*<<< orphan*/ addProfanityWord(char *);
int /*<<< orphan*/ getProfanity(char *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ initProfanity();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ remProfanity(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc == 1) {
    help();
  } else {
    if (argc == 2) {
      if (strcmp(argv[1], "get") == 0) {
        getProfanity("all");
      } else if (strcmp(argv[1], "rem") == 0) {
        remProfanity("all");
      } else if (strcmp(argv[1], "init") == 0) {
        initProfanity();
      } else if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "-help") == 0) {
        help();
      } else {
        printf("\"%s\" is not a valid operator when using one argument.\n",
               argv[1]);
      }
    } else {
      char *word = argv[2];
      if (strcmp(argv[1], "add") == 0) {
        addProfanity(word);
      } else if (strcmp(argv[1], "addWord") == 0) {
        addProfanityWord(word);
      } else if (strcmp(argv[1], "get") == 0) {
        getProfanity(word);
      } else if (strcmp(argv[1], "rem") == 0) {
        remProfanity(word);
      } else {
        printf("\"%s\" is not a valid operator for this program.\n", argv[1]);
      }
    }
  }
  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   $0x1,-0x8(%rbp)
jne    11ac <main+0x2c>
mov    $0x0,%al
call   1090 <help@plt>
jmp    1397 <main+0x217>
cmpl   $0x2,-0x8(%rbp)
jne    12ae <main+0x12e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11e5 <main+0x65>
lea    0xe29(%rip),%rdi
call   1060 <getProfanity@plt>
jmp    12a9 <main+0x129>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe14(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1214 <main+0x94>
lea    0xdfa(%rip),%rdi
call   1080 <remProfanity@plt>
jmp    12a4 <main+0x124>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    123e <main+0xbe>
mov    $0x0,%al
call   1070 <initProfanity@plt>
jmp    129f <main+0x11f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     127a <main+0xfa>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1286 <main+0x106>
mov    $0x0,%al
call   1090 <help@plt>
jmp    129a <main+0x11a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd85(%rip),%rdi
call   1030 <printf@plt>
jmp    129f <main+0x11f>
jmp    12a4 <main+0x124>
jmp    12a9 <main+0x129>
jmp    1392 <main+0x212>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd88(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12e6 <main+0x166>
mov    -0x18(%rbp),%rdi
call   10a0 <addProfanity@plt>
jmp    138d <main+0x20d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd60(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1312 <main+0x192>
mov    -0x18(%rbp),%rdi
call   1040 <addProfanityWord@plt>
jmp    1388 <main+0x208>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcdf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    133e <main+0x1be>
mov    -0x18(%rbp),%rdi
call   1060 <getProfanity@plt>
jmp    1383 <main+0x203>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcbb(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    136a <main+0x1ea>
mov    -0x18(%rbp),%rdi
call   1080 <remProfanity@plt>
jmp    137e <main+0x1fe>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xce4(%rip),%rdi
call   1030 <printf@plt>
jmp    1383 <main+0x203>
jmp    1388 <main+0x208>
jmp    138d <main+0x20d>
jmp    1392 <main+0x212>
jmp    1397 <main+0x217>
mov    0x2c42(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
je     11a1 <main+0x21>
cmp    $0x1,%edi
jne    1227 <main+0xa7>
xor    %eax,%eax
call   1090 <help@plt>
jmp    12d7 <main+0x157>
mov    0x8(%rbx),%rdi
lea    0xe54(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1291 <main+0x111>
mov    0x8(%rbx),%rdi
lea    0xe43(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12a9 <main+0x129>
mov    0x8(%rbx),%rdi
lea    0xe2e(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12bc <main+0x13c>
mov    0x8(%rbx),%rdi
lea    0xe1a(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1195 <main+0x15>
mov    0x8(%rbx),%rdi
lea    0xe08(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1195 <main+0x15>
mov    0x8(%rbx),%rsi
lea    0xdf5(%rip),%rdi
jmp    128a <main+0x10a>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%r14
lea    0xe1b(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     129f <main+0x11f>
mov    0x8(%rbx),%rdi
lea    0xe0a(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12b2 <main+0x132>
mov    0x8(%rbx),%rdi
lea    0xda0(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c5 <main+0x145>
mov    0x8(%rbx),%rdi
lea    0xd93(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12cf <main+0x14f>
mov    0x8(%rbx),%rsi
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
jmp    12d7 <main+0x157>
lea    0xd6c(%rip),%rdi
call   1060 <getProfanity@plt>
jmp    12d7 <main+0x157>
mov    %r14,%rdi
call   10a0 <addProfanity@plt>
jmp    12d7 <main+0x157>
lea    0xd54(%rip),%rdi
jmp    12d2 <main+0x152>
mov    %r14,%rdi
call   1040 <addProfanityWord@plt>
jmp    12d7 <main+0x157>
xor    %eax,%eax
call   1070 <initProfanity@plt>
jmp    12d7 <main+0x157>
mov    %r14,%rdi
call   1060 <getProfanity@plt>
jmp    12d7 <main+0x157>
mov    %r14,%rdi
call   1080 <remProfanity@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"all\00"
@.str.2 = [4 x i8] c"rem\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [6 x i8] c"-help\00"
@.str.6 = [55 x i8] c"\22%s\22 is not a valid operator when using one argument.\0A\00"
@.str.7 = [4 x i8] c"add\00"
@.str.8 = [8 x i8] c"addWord\00"
@.str.9 = [48 x i8] c"\22%s\22 is not a valid operator for this program.\0A\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 eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @help()
br label %110
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %61
14: ; preds = %11
%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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 @getProfanity(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %60
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 ([4 x i8], [4 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 @remProfanity(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %59
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 ([5 x i8], [5 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 (...) @initProfanity()
br label %58
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 ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %38
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %44, %38
%51 = call i32 (...) @help()
br label %57
52: ; preds = %44
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %52, %50
br label %58
58: ; preds = %57, %36
br label %59
59: ; preds = %58, %28
br label %60
60: ; preds = %59, %20
br label %109
61: ; preds = %11
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 2
%64 = load i8*, i8** %63
store i8* %64, i8** %6
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %61
%71 = load i8*, i8** %6
%72 = call i32 @addProfanity(i8* %71)
br label %108
73: ; preds = %61
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %73
%80 = load i8*, i8** %6
%81 = call i32 @addProfanityWord(i8* %80)
br label %107
82: ; preds = %73
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 1
%85 = load i8*, i8** %84
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %82
%89 = load i8*, i8** %6
%90 = call i32 @getProfanity(i8* %89)
br label %106
91: ; preds = %82
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %91
%98 = load i8*, i8** %6
%99 = call i32 @remProfanity(i8* %98)
br label %105
100: ; preds = %91
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = load i8*, i8** %102
%104 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0), i8* %103)
br label %105
105: ; preds = %100, %97
br label %106
106: ; preds = %105, %88
br label %107
107: ; preds = %106, %79
br label %108
108: ; preds = %107, %70
br label %109
109: ; preds = %108, %60
br label %110
110: ; preds = %109, %9
%111 = load i32, i32* @EXIT_SUCCESS
ret i32 %111
}

LLVM IR (-O2):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"all\00"
@.str.2 = [4 x i8] c"rem\00"
@.str.3 = [5 x i8] c"init\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [6 x i8] c"-help\00"
@.str.6 = [55 x i8] c"\22%s\22 is not a valid operator when using one argument.\0A\00"
@.str.7 = [4 x i8] c"add\00"
@.str.8 = [8 x i8] c"addWord\00"
@.str.9 = [48 x i8] c"\22%s\22 is not a valid operator for this program.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %37 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 (...) @help()
br label %67
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @getProfanity(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %67
12: ; preds = %5
%13 = load i8*, i8** %6
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 @remProfanity(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %67
18: ; preds = %12
%19 = load i8*, i8** %6
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 (...) @initProfanity()
br label %67
24: ; preds = %18
%25 = load i8*, i8** %6
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8*, i8** %6
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28, %24
%33 = tail call i32 (...) @help()
br label %67
34: ; preds = %28
%35 = load i8*, i8** %6
%36 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), i8* %35)
br label %67
37: ; preds = %2
%38 = getelementptr inbounds i8*, i8** %1, i64 2
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8*, i8** %1, i64 1
%41 = load i8*, i8** %40
%42 = tail call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %37
%45 = tail call i32 @addProfanity(i8* %39)
br label %67
46: ; preds = %37
%47 = load i8*, i8** %40
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = tail call i32 @addProfanityWord(i8* %39)
br label %67
52: ; preds = %46
%53 = load i8*, i8** %40
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = tail call i32 @getProfanity(i8* %39)
br label %67
58: ; preds = %52
%59 = load i8*, i8** %40
%60 = tail call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = tail call i32 @remProfanity(i8* %39)
br label %67
64: ; preds = %58
%65 = load i8*, i8** %40
%66 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0), i8* %65)
br label %67
67: ; preds = %44, %56, %64, %62, %50, %16, %32, %34, %22, %10, %3
%68 = load i32, i32* @EXIT_SUCCESS
ret i32 %68
}