#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*/ desencripta(char *);
int /*<<< orphan*/ encripta(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char frase[20];
  printf("\nDigite a frase a ser encriptada:");
  scanf("%s", frase);
  encripta(frase);
  printf("\nDigite a frase a ser desencriptada:");
  scanf("%s", frase);
  desencripta(frase);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <encripta@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <desencripta@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb8(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <encripta@plt>
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1060 <desencripta@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"\0ADigite a frase a ser encriptada:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [37 x i8] c"\0ADigite a frase a ser desencriptada:\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @encripta(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%12 = call i32 @desencripta(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0ADigite a frase a ser encriptada:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [37 x i8] c"\0ADigite a frase a ser desencriptada:\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @encripta(i8* %2)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i32 @desencripta(i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}