#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ enc_dec(int, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char const *);
char *strdup(char const *);
int main() {
  uint32_t key = 0xdeadbeef;
  char *cipher_text;
  const char *plain_text =
      "This a cipher test; Let's hope Bob and Alice can communicate!";
  printf("Plain text: \"%s\"\n", plain_text);
  cipher_text = strdup(plain_text);
  enc_dec(key, cipher_text);
  printf("Cipher Text: \"%s\"\n", cipher_text);
  enc_dec(key, cipher_text);
  printf("Dectypted cipher Text: \"%s\"\n", cipher_text);
  free(cipher_text);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xdeadbeef,-0x8(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <enc_dec@plt>
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <enc_dec@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef6(%rip),%rdi
lea    0xeb1(%rip),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    $0xdeadbeef,%edi
mov    %rax,%rsi
call   1050 <enc_dec@plt>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0xdeadbeef,%edi
mov    %rbx,%rsi
call   1050 <enc_dec@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"This a cipher test; Let's hope Bob and Alice can communicate!\00"
@.str.1 = [18 x i8] c"Plain text: \22%s\22\0A\00"
@.str.2 = [19 x i8] c"Cipher Text: \22%s\22\0A\00"
@.str.3 = [29 x i8] c"Dectypted cipher Text: \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i32 -559038737, i32* %2
store i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %3
%9 = load i32, i32* %2
%10 = load i8*, i8** %3
%11 = call i32 @enc_dec(i32 %9, i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %2
%15 = load i8*, i8** %3
%16 = call i32 @enc_dec(i32 %14, i8* %15)
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i8*, i8** %3
%20 = call i32 @free(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"This a cipher test; Let's hope Bob and Alice can communicate!\00"
@.str.1 = [18 x i8] c"Plain text: \22%s\22\0A\00"
@.str.2 = [19 x i8] c"Cipher Text: \22%s\22\0A\00"
@.str.3 = [29 x i8] c"Dectypted cipher Text: \22%s\22\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(62) i8* @strdup(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @enc_dec(i32 -559038737, i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%5 = tail call i32 @enc_dec(i32 -559038737, i8* %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = tail call i32 @free(i8* %2)
ret i32 0
}