#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*/ decrypt_aes(char *, char *, char *);
int /*<<< orphan*/ encrypt_aes(char *, char *, char *);
int /*<<< orphan*/ get_key(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char random_key[33];
  get_key(random_key);
  encrypt_aes("testenc.orig", "testenc.enc", random_key);
  printf("ENNNNCCCCRYPTED \n");
  decrypt_aes("testenc.enc", "testenc.dec", random_key);
  printf("DDDDDDEEEECCRPPPPPPTTTEED \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1060 <get_key@plt>
lea    -0x30(%rbp),%rdx
lea    0xea4(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <encrypt_aes@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdx
lea    0xe8e(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <decrypt_aes@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <get_key@plt>
lea    0xea7(%rip),%rdi
lea    0xead(%rip),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <encrypt_aes@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <decrypt_aes@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"testenc.orig\00"
@.str.1 = [12 x i8] c"testenc.enc\00"
@.str.2 = [18 x i8] c"ENNNNCCCCRYPTED \0A\00"
@.str.3 = [12 x i8] c"testenc.dec\00"
@.str.4 = [28 x i8] c"DDDDDDEEEECCRPPPPPPTTTEED \0A\00"
define i32 @main() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_key(i8* %2)
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%5 = call i32 @encrypt_aes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%8 = call i32 @decrypt_aes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"testenc.orig\00"
@.str.1 = [12 x i8] c"testenc.enc\00"
@.str.3 = [12 x i8] c"testenc.dec\00"
@str = [17 x i8] c"ENNNNCCCCRYPTED \00"
@str.5 = [27 x i8] c"DDDDDDEEEECCRPPPPPPTTTEED \00"
define i32 @main() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_key(i8* %2)
%4 = call i32 @encrypt_aes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%6 = call i32 @decrypt_aes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}