#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*/ create_it();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ protect_it();
int /*<<< orphan*/ remove_it();
int /*<<< orphan*/ strcasecmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    if (!strcasecmp("create", argv[1]))
      create_it();
    if (!strcasecmp("remove", argv[1]))
      remove_it();
    if (!strcasecmp("protect", argv[1]))
      protect_it();
  }
  printf("Usage: %s  create | remove | protect\n", argv[0]);
  exit(-1);
}


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   $0x1,-0x8(%rbp)
jle    11f1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe71(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11a4 <main+0x44>
mov    $0x0,%al
call   1080 <create_it@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe54(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11c8 <main+0x68>
mov    $0x0,%al
call   1040 <remove_it@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe37(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11ec <main+0x8c>
mov    $0x0,%al
call   1060 <protect_it@plt>
jmp    11f1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x2,%edi
jl     11c6 <main+0x66>
mov    0x8(%r14),%rbx
lea    0xe89(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    118e <main+0x2e>
xor    %eax,%eax
call   1080 <create_it@plt>
mov    0x8(%r14),%rbx
lea    0xe72(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    11ac <main+0x4c>
xor    %eax,%eax
call   1040 <remove_it@plt>
mov    0x8(%r14),%rbx
lea    0xe5b(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    11c6 <main+0x66>
xor    %eax,%eax
call   1060 <protect_it@plt>
mov    (%r14),%rsi
lea    0xe46(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"create\00"
@.str.1 = [7 x i8] c"remove\00"
@.str.2 = [8 x i8] c"protect\00"
@.str.3 = [38 x i8] c"Usage: %s create | remove | protect\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 sgt i32 %6, 1
br i1 %7, label %8, label %33
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = call i32 (...) @create_it()
br label %16
16: ; preds = %14, %8
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = call i32 (...) @remove_it()
br label %24
24: ; preds = %22, %16
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcasecmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %24
%31 = call i32 (...) @protect_it()
br label %32
32: ; preds = %30, %24
br label %33
33: ; preds = %32, %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"create\00"
@.str.1 = [7 x i8] c"remove\00"
@.str.2 = [8 x i8] c"protect\00"
@.str.3 = [38 x i8] c"Usage: %s create | remove | protect\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %25
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 (...) @create_it()
%11 = load i8*, i8** %5
br label %12
12: ; preds = %9, %4
%13 = phi i8* [ %11, %9 ], [ %6, %4 ]
%14 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = tail call i32 (...) @remove_it()
%18 = load i8*, i8** %5
br label %19
19: ; preds = %16, %12
%20 = phi i8* [ %18, %16 ], [ %13, %12 ]
%21 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 (...) @protect_it()
br label %25
25: ; preds = %19, %23, %2
%26 = load i8*, i8** %1
%27 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %26)
%28 = tail call i32 @exit(i32 -1)
unreachable
}