#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*/ fnDecrypt(char *);
int /*<<< orphan*/ fnEncrypt(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char acMesg[50];
  printf("\nEnter your plain text in lower case\n");
  gets(acMesg);
  fnEncrypt(acMesg);
  printf("Encrypted Ciphertext\n");
  puts(acMesg);
  fnDecrypt(acMesg);
  printf("Decrypted Plaintext\n");
  puts(acMesg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1070 <fnEncrypt@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
call   1060 <fnDecrypt@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1060 <fnEncrypt@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <fnDecrypt@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0AEnter your plain text in lower case\0A\00"
@.str.1 = [22 x i8] c"Encrypted Ciphertext\0A\00"
@.str.2 = [21 x i8] c"Decrypted Plaintext\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @fnEncrypt(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%12 = call i32 @fnDecrypt(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"\0AEnter your plain text in lower case\00"
@str.3 = [21 x i8] c"Encrypted Ciphertext\00"
@str.4 = [20 x i8] c"Decrypted Plaintext\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @fnEncrypt(i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%7 = call i32 @puts(i8* %2)
%8 = call i32 @fnDecrypt(i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%10 = call i32 @puts(i8* %2)
ret i32 0
}