int main(int argc, char *argv[]) {
  int whichWay, useQA64;
  if (argc != 3)
    return 1;
  if (argv[1] == "\0")
    return 2;
  if (argv[2] == "\0")
    return 2;
  if (argv[3] == "\0")
    return 2;
  whichWay = atoi(argv[1]);
  char *data = strdup(argv[2]);
  if (argv[4] != "\0") {
    useQA64 = atoi(argv[3]);
  } else {
    useQA64 = 0;
  }
  char crypted = *((char *)crypter(whichWay, data, useQA64));
  printf("%s\n", crypted);
  crypted = "";
  data = "";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     116c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    126b <main+0x12b>
mov    -0x10(%rbp),%rax
lea    0xe89(%rip),%rcx
cmp    %rcx,0x8(%rax)
jne    118d <main+0x4d>
movl   $0x2,-0x4(%rbp)
jmp    126b <main+0x12b>
mov    -0x10(%rbp),%rax
lea    0xe68(%rip),%rcx
cmp    %rcx,0x10(%rax)
jne    11ae <main+0x6e>
movl   $0x2,-0x4(%rbp)
jmp    126b <main+0x12b>
mov    -0x10(%rbp),%rax
lea    0xe47(%rip),%rcx
cmp    %rcx,0x18(%rax)
jne    11cf <main+0x8f>
movl   $0x2,-0x4(%rbp)
jmp    126b <main+0x12b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
lea    0xe03(%rip),%rcx
cmp    %rcx,0x20(%rax)
je     121e <main+0xde>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1225 <main+0xe5>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1040 <crypter@plt>
cltq
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdaf(%rip),%rax
mov    %al,-0x21(%rbp)
lea    0xda5(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%ebp
cmp    $0x3,%edi
jne    11c6 <main+0x86>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    $0x2,%ebp
lea    0xe9b(%rip),%r12
cmp    %r12,%rdi
je     11c6 <main+0x86>
cmp    %r12,0x10(%rbx)
je     11c6 <main+0x86>
cmp    %r12,0x18(%rbx)
je     11c6 <main+0x86>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1060 <strdup@plt>
mov    %rax,%r15
mov    $0x0,%edx
cmp    %r12,0x20(%rbx)
je     11a6 <main+0x66>
mov    0x18(%rbx),%rdi
xor    %eax,%eax
call   1050 <atoi@plt>
mov    %eax,%edx
mov    %r14d,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <crypter@plt>
cltq
movsbl (%rax),%esi
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %61
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 2, i32* %3
br label %61
19: ; preds = %13
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 2, i32* %3
br label %61
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = icmp eq i8* %28, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 2, i32* %3
br label %61
31: ; preds = %25
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %34)
store i32 %35, i32* %6
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i8* @strdup(i8* %38)
store i8* %39, i8** %8
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 4
%42 = load i8*, i8** %41
%43 = icmp ne i8* %42, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %43, label %44, label %49
44: ; preds = %31
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 3
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %47)
store i32 %48, i32* %7
br label %50
49: ; preds = %31
store i32 0, i32* %7
br label %50
50: ; preds = %49, %44
%51 = load i32, i32* %6
%52 = load i8*, i8** %8
%53 = load i32, i32* %7
%54 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @crypter to i32 (i32, i8*, i32, ...)*)(i32 %51, i8* %52, i32 %53)
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to i8*
%57 = load i8, i8* %56
store i8 %57, i8* %9
%58 = load i8, i8* %9
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
store i8 ptrtoint ([1 x i8]* @.str.2 to i8), i8* %9
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %8
store i32 0, i32* %3
br label %61
61: ; preds = %50, %30, %24, %18, %12
%62 = load i32, i32* %3
ret i32 %62
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %7, label %34, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %11, label %34, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %15, label %34, label %16
16: ; preds = %12
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %6)
%18 = load i8*, i8** %9
%19 = tail call i8* @strdup(i8* %18)
%20 = getelementptr inbounds i8*, i8** %1, i64 4
%21 = load i8*, i8** %20
%22 = icmp eq i8* %21, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %22, label %26, label %23
23: ; preds = %16
%24 = load i8*, i8** %13
%25 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %24)
br label %26
26: ; preds = %16, %23
%27 = phi i32 [ %25, %23 ], [ 0, %16 ]
%28 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @crypter to i32 (i32, i8*, i32, ...)*)(i32 %17, i8* %19, i32 %27)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %12, %8, %4, %2, %26
%35 = phi i32 [ 0, %26 ], [ 1, %2 ], [ 2, %4 ], [ 2, %8 ], [ 2, %12 ]
ret i32 %35
}