#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 */
typedef int /*<<< orphan*/ temp;

/* Variables and functions */
int /*<<< orphan*/ cenitPolarCrypt(char *);
int /*<<< orphan*/ clearStdIn();
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ gerigoncioCrypt(char *);
int /*<<< orphan*/ murcielagoCrypt(char *);
int /*<<< orphan*/ numericCrypt(char *);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printMenu();
int /*<<< orphan*/ printf(char *, ...);
int questionMenuOption();
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int inputOption = 0;
  char temp[1024];
  do {
    printf("Encriptador\n");
    printf("===========\n\n");
    printMenu();
    inputOption = questionMenuOption();
    if (0 == inputOption) {
      break;
    }
    printf("Ingrese cadena a encriptar (max:  %d): ", 1024 - 1);
    clearStdIn();
    fgets(temp, sizeof(temp), stdin);
    switch (inputOption) {
    case 1:
      cenitPolarCrypt(temp);
      break;
    case 2:
      murcielagoCrypt(temp);
      break;
    case 3:
      numericCrypt(temp);
      break;
    case 4:
      gerigoncioCrypt(temp);
      break;
    }
    printf("\n\nMensaje encriptado: %s\n\n", temp);
    pause();
  } while (0 != inputOption);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <printMenu@plt>
mov    $0x0,%al
call   1060 <questionMenuOption@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    11fd <main+0x5d>
jmp    12d0 <main+0x130>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x429(%rbp)
mov    $0x3ff,%esi
call   1050 <printf@plt>
mov    -0x429(%rbp),%al
call   10c0 <clearStdIn@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edx
lea    -0x420(%rbp),%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x428(%rbp)
sub    $0x3,%eax
ja     12a9 <main+0x109>
mov    -0x428(%rbp),%rax
lea    0xd9f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x420(%rbp),%rdi
call   10b0 <cenitPolarCrypt@plt>
jmp    12a9 <main+0x109>
lea    -0x420(%rbp),%rdi
call   1080 <murcielagoCrypt@plt>
jmp    12a9 <main+0x109>
lea    -0x420(%rbp),%rdi
call   1030 <numericCrypt@plt>
jmp    12a9 <main+0x109>
lea    -0x420(%rbp),%rdi
call   1040 <gerigoncioCrypt@plt>
lea    -0x420(%rbp),%rsi
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <pause@plt>
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    11c0 <main+0x20>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <printMenu@plt>
xor    %eax,%eax
call   1070 <questionMenuOption@plt>
test   %eax,%eax
je     12dd <main+0x12d>
mov    %eax,%ebp
mov    %rsp,%rbx
lea    0xe3d(%rip),%r15
lea    0xe51(%rip),%r12
lea    0xe56(%rip),%r13
lea    0xdf0(%rip),%r14
jmp    1268 <main+0xb8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <gerigoncioCrypt@plt>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10a0 <pause@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <printMenu@plt>
xor    %eax,%eax
call   1070 <questionMenuOption@plt>
mov    %eax,%ebp
test   %eax,%eax
je     12dd <main+0x12d>
lea    0xda1(%rip),%rdi
mov    $0x3ff,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10d0 <clearStdIn@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1080 <fgets@plt>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1230 <main+0x80>
movslq (%r14,%rbp,4),%rax
add    %r14,%rax
jmp    *%rax
mov    %rbx,%rdi
call   10c0 <cenitPolarCrypt@plt>
jmp    1230 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <murcielagoCrypt@plt>
jmp    1230 <main+0x80>
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <numericCrypt@plt>
jmp    1230 <main+0x80>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Encriptador\0A\00"
@.str.1 = [14 x i8] c"===========\0A\0A\00"
@.str.2 = [40 x i8] c"Ingrese cadena a encriptar (max: %d): \00"
@stdin = global i32 0
@.str.3 = [27 x i8] c"\0A\0AMensaje encriptado: %s\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %39, %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @printMenu()
%12 = call i32 (...) @questionMenuOption()
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp eq i32 0, %13
br i1 %14, label %15, label %16
15: ; preds = %8
br label %42
16: ; preds = %8
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 1023)
%18 = call i32 (...) @clearStdIn()
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%20 = load i32, i32* @stdin
%21 = call i32 @fgets(i8* %19, i32 1024, i32 %20)
%22 = load i32, i32* %6
switch i32 %22, label %35 [
i32 1, label %23
i32 2, label %26
i32 3, label %29
i32 4, label %32
]
23: ; preds = %16
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%25 = call i32 @cenitPolarCrypt(i8* %24)
br label %35
26: ; preds = %16
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%28 = call i32 @murcielagoCrypt(i8* %27)
br label %35
29: ; preds = %16
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%31 = call i32 @numericCrypt(i8* %30)
br label %35
32: ; preds = %16
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%34 = call i32 @gerigoncioCrypt(i8* %33)
br label %35
35: ; preds = %16, %32, %29, %26, %23
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = call i32 (...) @pause()
br label %39
39: ; preds = %35
%40 = load i32, i32* %6
%41 = icmp ne i32 0, %40
br i1 %41, label %8, label %42
42: ; preds = %39, %15
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [40 x i8] c"Ingrese cadena a encriptar (max: %d): \00"
@stdin = global i32 0
@.str.3 = [27 x i8] c"\0A\0AMensaje encriptado: %s\0A\0A\00"
@str = [12 x i8] c"Encriptador\00"
@str.4 = [13 x i8] c"===========\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%7 = call i32 (...) @printMenu()
%8 = call i32 (...) @questionMenuOption()
%9 = icmp eq i32 %8, 0
br i1 %9, label %32, label %10
10: ; preds = %2, %24
%11 = phi i32 [ %30, %24 ], [ %8, %2 ]
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 1023)
%13 = call i32 (...) @clearStdIn()
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %4, i32 1024, i32 %14)
switch i32 %11, label %24 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %22
]
16: ; preds = %10
%17 = call i32 @cenitPolarCrypt(i8* %4)
br label %24
18: ; preds = %10
%19 = call i32 @murcielagoCrypt(i8* %4)
br label %24
20: ; preds = %10
%21 = call i32 @numericCrypt(i8* %4)
br label %24
22: ; preds = %10
%23 = call i32 @gerigoncioCrypt(i8* %4)
br label %24
24: ; preds = %10, %22, %20, %18, %16
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%26 = call i32 (...) @pause()
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%29 = call i32 (...) @printMenu()
%30 = call i32 (...) @questionMenuOption()
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %10
32: ; preds = %24, %2
ret i32 0
}