#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*/ decrypt(int, char **);
int /*<<< orphan*/ encrypt();
int /*<<< orphan*/ generate();
int /*<<< orphan*/ printInfo();
scalar_t__ strcmp(char *, char *);
main(int argc, char *argv[]) {
  if (argc > 1 && strcmp(argv[1], "generate") == 0) {
    generate();
  } else if (argc > 1 && strcmp(argv[1], "encrypt") == 0) {
    encrypt();
  } else if (argc > 1 && strcmp(argv[1], "decrypt") == 0) {
    decrypt(argc, argv);
  } else {
    printInfo();
  }
}


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    119a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    119a <main+0x4a>
mov    $0x0,%al
call   1070 <generate@plt>
jmp    1218 <main+0xc8>
cmpl   $0x1,-0x8(%rbp)
jle    11ce <main+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe56(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ce <main+0x7e>
mov    $0x0,%al
call   1040 <encrypt@plt>
jmp    1213 <main+0xc3>
cmpl   $0x1,-0x8(%rbp)
jle    1207 <main+0xb7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1207 <main+0xb7>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <decrypt@plt>
jmp    120e <main+0xbe>
mov    $0x0,%al
call   1060 <printInfo@plt>
jmp    1213 <main+0xc3>
jmp    1218 <main+0xc8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     119c <main+0x4c>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe98(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11a5 <main+0x55>
mov    0x8(%rbx),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11ae <main+0x5e>
mov    0x8(%rbx),%rdi
lea    0xe7f(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11b7 <main+0x67>
xor    %eax,%eax
call   1060 <printInfo@plt>
jmp    11c1 <main+0x71>
xor    %eax,%eax
call   1070 <generate@plt>
jmp    11c1 <main+0x71>
xor    %eax,%eax
call   1040 <encrypt@plt>
jmp    11c1 <main+0x71>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <decrypt@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"generate\00"
@.str.1 = [8 x i8] c"encrypt\00"
@.str.2 = [8 x i8] c"decrypt\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 %16
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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @generate()
br label %44
16: ; preds = %8, %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 (...) @encrypt()
br label %43
27: ; preds = %19, %16
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 1
br i1 %29, label %30, label %40
30: ; preds = %27
%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 ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i32, i32* %4
%38 = load i8**, i8*** %5
%39 = call i32 @decrypt(i32 %37, i8** %38)
br label %42
40: ; preds = %30, %27
%41 = call i32 (...) @printInfo()
br label %42
42: ; preds = %40, %36
br label %43
43: ; preds = %42, %25
br label %44
44: ; preds = %43, %14
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@.str = [9 x i8] c"generate\00"
@.str.1 = [8 x i8] c"encrypt\00"
@.str.2 = [8 x i8] c"decrypt\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %23
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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @generate()
br label %25
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 (...) @encrypt()
br label %25
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @decrypt(i32 %0, i8** %1)
br label %25
23: ; preds = %2, %17
%24 = tail call i32 (...) @printInfo()
br label %25
25: ; preds = %15, %23, %21, %9
ret i32 0
}