#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*/ saved_iv;
typedef int /*<<< orphan*/ rkey;
typedef int /*<<< orphan*/ plaintext;
typedef int /*<<< orphan*/ iv;
typedef int /*<<< orphan*/ ciphertext;
typedef int /*<<< orphan*/ checktext;
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int AES_BLOCK_SIZE;
int /*<<< orphan*/ AES_DECRYPT;
int /*<<< orphan*/ AES_ENCRYPT;
int /*<<< orphan*/ AES_cbc_encrypt(unsigned char *, unsigned char *, int,
                                   int /*<<< orphan*/ *, unsigned char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ AES_set_decrypt_key(unsigned char *, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ AES_set_encrypt_key(unsigned char *, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ RAND_pseudo_bytes(unsigned char *, int);
int /*<<< orphan*/ hexdump(int /*<<< orphan*/, char *, unsigned char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  unsigned char rkey[16];
  AES_KEY key;
  unsigned char plaintext[AES_BLOCK_SIZE * 4];
  unsigned char ciphertext[AES_BLOCK_SIZE * 4];
  unsigned char checktext[AES_BLOCK_SIZE * 4];
  unsigned char iv[AES_BLOCK_SIZE * 4];
  unsigned char saved_iv[AES_BLOCK_SIZE * 4];
  int nr_of_bits = 0;
  int nr_of_bytes = 0;
  memset(plaintext, 0, sizeof plaintext);
  memset(ciphertext, 0, sizeof ciphertext);
  memset(checktext, 0, sizeof checktext);
  RAND_pseudo_bytes(rkey, sizeof rkey);
  RAND_pseudo_bytes(plaintext, sizeof plaintext);
  RAND_pseudo_bytes(saved_iv, sizeof saved_iv);
  hexdump(stdout, "== rkey ==", rkey, sizeof(rkey));
  hexdump(stdout, "== iv ==", saved_iv, sizeof(saved_iv));
  printf("\n");
  hexdump(stdout, "== plaintext ==", plaintext, sizeof(plaintext));
  printf("\n");
  memcpy(iv, saved_iv, sizeof(iv));
  nr_of_bits = 8 * sizeof(rkey);
  AES_set_encrypt_key(rkey, nr_of_bits, &key);
  nr_of_bytes = sizeof(plaintext);
  AES_cbc_encrypt(plaintext, ciphertext, nr_of_bytes, &key, iv, AES_ENCRYPT);
  hexdump(stdout, "== ciphertext ==", ciphertext, sizeof(ciphertext));
  printf("\n");
  memcpy(iv, saved_iv, sizeof(iv));
  nr_of_bytes = 8 * sizeof(rkey);
  AES_set_decrypt_key(rkey, nr_of_bits, &key);
  nr_of_bytes = sizeof(ciphertext) / 2;
  AES_cbc_encrypt(ciphertext, checktext, nr_of_bytes, &key, iv, AES_DECRYPT);
  AES_cbc_encrypt(ciphertext + nr_of_bytes, checktext + nr_of_bytes,
                  nr_of_bytes, &key, iv, AES_DECRYPT);
  hexdump(stdout, "== checktext ==", checktext, sizeof(checktext));
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e48(%rip),%rcx
mov    (%rcx),%eax
shl    $0x2,%eax
mov    %rax,-0xa0(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rdi
sub    %rdx,%rdi
mov    %rdi,-0xa8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    (%rcx),%edx
shl    $0x2,%edx
mov    %rdx,-0x88(%rbp)
mov    %rdx,%r8
add    $0xf,%r8
and    $0xfffffffffffffff0,%r8
mov    %rsp,%rsi
sub    %r8,%rsi
mov    %rsi,-0x80(%rbp)
mov    %rsi,%rsp
mov    %rdx,-0x40(%rbp)
mov    (%rcx),%edx
shl    $0x2,%edx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%r8
add    $0xf,%r8
and    $0xfffffffffffffff0,%r8
mov    %rsp,%rsi
sub    %r8,%rsi
mov    %rsi,-0x70(%rbp)
mov    %rsi,%rsp
mov    %rdx,-0x48(%rbp)
mov    (%rcx),%edx
shl    $0x2,%edx
mov    %rdx,-0x90(%rbp)
mov    %rdx,%r8
add    $0xf,%r8
and    $0xfffffffffffffff0,%r8
mov    %rsp,%rsi
sub    %r8,%rsi
mov    %rsi,-0x78(%rbp)
mov    %rsi,%rsp
mov    %rdx,-0x50(%rbp)
mov    (%rcx),%ecx
shl    $0x2,%ecx
mov    %rcx,-0xb0(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x98(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x80(%rbp),%rdi
mov    -0x88(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%rax
mov    %eax,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    -0x98(%rbp),%rdi
mov    -0xb0(%rbp),%rax
mov    %eax,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rdx
lea    0xd06(%rip),%rsi
mov    $0x10,%ecx
call   1080 <hexdump@plt>
mov    -0x98(%rbp),%rdx
mov    -0xb0(%rbp),%rax
mov    0x2caf(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    0xce7(%rip),%rsi
call   1080 <hexdump@plt>
lea    0xce4(%rip),%rdi
call   1040 <printf@plt>
mov    -0xa8(%rbp),%rdx
mov    -0xa0(%rbp),%rax
mov    0x2c7e(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    0xcc1(%rip),%rsi
call   1080 <hexdump@plt>
lea    0xcb3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x98(%rbp),%rsi
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%rax
mov    %eax,%edx
call   1070 <memcpy@plt>
movl   $0x80,-0x5c(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x5c(%rbp),%esi
lea    -0x24(%rbp),%rdx
call   1030 <AES_set_encrypt_key@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x78(%rbp),%r8
mov    -0xa0(%rbp),%rax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%edx
mov    0x2c17(%rip),%rax
mov    (%rax),%r9d
lea    -0x24(%rbp),%rcx
call   1060 <AES_cbc_encrypt@plt>
mov    -0x80(%rbp),%rdx
mov    -0x88(%rbp),%rax
mov    0x2bf1(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    0xc44(%rip),%rsi
call   1080 <hexdump@plt>
lea    0xc26(%rip),%rdi
call   1040 <printf@plt>
mov    -0x98(%rbp),%rsi
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%rax
mov    %eax,%edx
call   1070 <memcpy@plt>
movl   $0x80,-0x60(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x5c(%rbp),%esi
lea    -0x24(%rbp),%rdx
call   10a0 <AES_set_decrypt_key@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%r8
mov    -0x70(%rbp),%rsi
mov    -0x88(%rbp),%rax
shr    $0x1,%rax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%edx
mov    0x2b99(%rip),%rax
mov    (%rax),%r9d
lea    -0x24(%rbp),%rcx
call   1060 <AES_cbc_encrypt@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%r8
mov    -0x70(%rbp),%rsi
movslq -0x60(%rbp),%rax
add    %rax,%rdi
movslq -0x60(%rbp),%rax
add    %rax,%rsi
mov    -0x60(%rbp),%edx
mov    0x2b69(%rip),%rax
mov    (%rax),%r9d
lea    -0x24(%rbp),%rcx
call   1060 <AES_cbc_encrypt@plt>
mov    -0x70(%rbp),%rdx
mov    -0x68(%rbp),%rax
mov    0x2b36(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    0xb9a(%rip),%rsi
call   1080 <hexdump@plt>
lea    0xb6b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsp,-0x70(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%r14d
shl    $0x2,%r14d
mov    %rsp,%rsi
lea    0xf(%r14),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rsi,%rdi
mov    %rsi,-0x38(%rbp)
mov    (%rax),%r13d
shl    $0x2,%r13d
mov    %rsp,%r15
lea    0xf(%r13),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,-0x68(%rbp)
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
xor    %esi,%esi
mov    %r14d,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1050 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x10,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    -0x38(%rbp),%rbx
mov    %rbx,%rdi
mov    %r14,-0x58(%rbp)
mov    %r14d,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    %r12,%rdi
mov    %r13d,%esi
call   1090 <RAND_pseudo_bytes@plt>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
lea    0xdaa(%rip),%rsi
lea    -0x50(%rbp),%rdx
mov    $0x10,%ecx
call   1080 <hexdump@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0xd97(%rip),%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
call   1080 <hexdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1080 <hexdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x60(%rbp),%r14
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1070 <memcpy@plt>
lea    -0x2c(%rbp),%rbx
lea    -0x50(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    0x2cf4(%rip),%rax
mov    (%rax),%r9d
mov    -0x38(%rbp),%rdi
mov    %r15,%rsi
mov    -0x58(%rbp),%rdx
mov    %rbx,%rcx
mov    %r14,%r8
call   1060 <AES_cbc_encrypt@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
lea    0xd1f(%rip),%rsi
mov    %r15,%rdx
mov    %r13d,%ecx
call   1080 <hexdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1070 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   10a0 <AES_set_decrypt_key@plt>
mov    %r13d,%ebx
shr    %ebx
mov    0x2c9b(%rip),%rax
mov    (%rax),%r9d
mov    %r15,%rdi
mov    -0x68(%rbp),%r12
mov    %r12,%rsi
mov    %ebx,%edx
lea    -0x2c(%rbp),%rcx
mov    %r14,%r8
call   1060 <AES_cbc_encrypt@plt>
add    %rbx,%r15
lea    (%r12,%rbx,1),%rsi
mov    0x2c72(%rip),%rax
mov    (%rax),%r9d
mov    %r15,%rdi
mov    %ebx,%edx
lea    -0x2c(%rbp),%rcx
mov    %r14,%r8
call   1060 <AES_cbc_encrypt@plt>
mov    0x2c3f(%rip),%rax
mov    (%rax),%edi
lea    0xca3(%rip),%rsi
mov    %r12,%rdx
mov    %r13d,%ecx
call   1080 <hexdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x70(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@AES_BLOCK_SIZE = global i32 0
@stdout = global i32 0
@.str = [11 x i8] c"== rkey ==\00"
@.str.1 = [9 x i8] c"== iv ==\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [16 x i8] c"== plaintext ==\00"
@AES_ENCRYPT = global i32 0
@.str.4 = [17 x i8] c"== ciphertext ==\00"
@AES_DECRYPT = global i32 0
@.str.5 = [16 x i8] c"== checktext ==\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* @AES_BLOCK_SIZE
%17 = mul nsw i32 %16, 4
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %8
%20 = alloca i8, i64 %18
store i64 %18, i64* %9
%21 = load i32, i32* @AES_BLOCK_SIZE
%22 = mul nsw i32 %21, 4
%23 = zext i32 %22 to i64
%24 = alloca i8, i64 %23
store i64 %23, i64* %10
%25 = load i32, i32* @AES_BLOCK_SIZE
%26 = mul nsw i32 %25, 4
%27 = zext i32 %26 to i64
%28 = alloca i8, i64 %27
store i64 %27, i64* %11
%29 = load i32, i32* @AES_BLOCK_SIZE
%30 = mul nsw i32 %29, 4
%31 = zext i32 %30 to i64
%32 = alloca i8, i64 %31
store i64 %31, i64* %12
%33 = load i32, i32* @AES_BLOCK_SIZE
%34 = mul nsw i32 %33, 4
%35 = zext i32 %34 to i64
%36 = alloca i8, i64 %35
store i64 %35, i64* %13
store i32 0, i32* %14
store i32 0, i32* %15
%37 = trunc i64 %18 to i32
%38 = call i32 @memset(i8* %20, i32 0, i32 %37)
%39 = trunc i64 %23 to i32
%40 = call i32 @memset(i8* %24, i32 0, i32 %39)
%41 = trunc i64 %27 to i32
%42 = call i32 @memset(i8* %28, i32 0, i32 %41)
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%44 = call i32 @RAND_pseudo_bytes(i8* %43, i32 16)
%45 = trunc i64 %18 to i32
%46 = call i32 @RAND_pseudo_bytes(i8* %20, i32 %45)
%47 = trunc i64 %35 to i32
%48 = call i32 @RAND_pseudo_bytes(i8* %36, i32 %47)
%49 = load i32, i32* @stdout
%50 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%51 = call i32 @hexdump(i32 %49, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %50, i32 16)
%52 = load i32, i32* @stdout
%53 = trunc i64 %35 to i32
%54 = call i32 @hexdump(i32 %52, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %36, i32 %53)
%55 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @stdout
%57 = trunc i64 %18 to i32
%58 = call i32 @hexdump(i32 %56, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %20, i32 %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%60 = trunc i64 %31 to i32
%61 = call i32 @memcpy(i8* %32, i8* %36, i32 %60)
store i32 128, i32* %14
%62 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%63 = load i32, i32* %14
%64 = call i32 @AES_set_encrypt_key(i8* %62, i32 %63, i32* %7)
%65 = trunc i64 %18 to i32
store i32 %65, i32* %15
%66 = load i32, i32* %15
%67 = load i32, i32* @AES_ENCRYPT
%68 = call i32 @AES_cbc_encrypt(i8* %20, i8* %24, i32 %66, i32* %7, i8* %32, i32 %67)
%69 = load i32, i32* @stdout
%70 = trunc i64 %23 to i32
%71 = call i32 @hexdump(i32 %69, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %24, i32 %70)
%72 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%73 = trunc i64 %31 to i32
%74 = call i32 @memcpy(i8* %32, i8* %36, i32 %73)
store i32 128, i32* %15
%75 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%76 = load i32, i32* %14
%77 = call i32 @AES_set_decrypt_key(i8* %75, i32 %76, i32* %7)
%78 = udiv i64 %23, 2
%79 = trunc i64 %78 to i32
store i32 %79, i32* %15
%80 = load i32, i32* %15
%81 = load i32, i32* @AES_DECRYPT
%82 = call i32 @AES_cbc_encrypt(i8* %24, i8* %28, i32 %80, i32* %7, i8* %32, i32 %81)
%83 = load i32, i32* %15
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %24, i64 %84
%86 = load i32, i32* %15
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %28, i64 %87
%89 = load i32, i32* %15
%90 = load i32, i32* @AES_DECRYPT
%91 = call i32 @AES_cbc_encrypt(i8* %85, i8* %88, i32 %89, i32* %7, i8* %32, i32 %90)
%92 = load i32, i32* @stdout
%93 = trunc i64 %27 to i32
%94 = call i32 @hexdump(i32 %92, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %28, i32 %93)
%95 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
%96 = load i8*, i8** %8
%97 = load i32, i32* %3
ret i32 %97
}

LLVM IR (-O2):
@AES_BLOCK_SIZE = global i32 0
@stdout = global i32 0
@.str = [11 x i8] c"== rkey ==\00"
@.str.1 = [9 x i8] c"== iv ==\00"
@.str.3 = [16 x i8] c"== plaintext ==\00"
@AES_ENCRYPT = global i32 0
@.str.4 = [17 x i8] c"== ciphertext ==\00"
@AES_DECRYPT = global i32 0
@.str.5 = [16 x i8] c"== checktext ==\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* @AES_BLOCK_SIZE
%8 = shl nsw i32 %7, 2
%9 = zext i32 %8 to i64
%10 = tail call i8* @llvm.stacksave()
%11 = alloca i8, i64 %9
%12 = load i32, i32* @AES_BLOCK_SIZE
%13 = shl nsw i32 %12, 2
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
%16 = alloca i8, i64 %14
%17 = alloca i8, i64 %14
%18 = alloca i8, i64 %14
%19 = call i32 @memset(i8* %11, i32 0, i32 %8)
%20 = call i32 @memset(i8* %15, i32 0, i32 %13)
%21 = call i32 @memset(i8* %16, i32 0, i32 %13)
%22 = call i32 @RAND_pseudo_bytes(i8* %5, i32 16)
%23 = call i32 @RAND_pseudo_bytes(i8* %11, i32 %8)
%24 = call i32 @RAND_pseudo_bytes(i8* %18, i32 %13)
%25 = load i32, i32* @stdout
%26 = call i32 @hexdump(i32 %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i32 16)
%27 = load i32, i32* @stdout
%28 = call i32 @hexdump(i32 %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %13)
%29 = call i32 @putchar(i32 10)
%30 = load i32, i32* @stdout
%31 = call i32 @hexdump(i32 %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %11, i32 %8)
%32 = call i32 @putchar(i32 10)
%33 = call i32 @memcpy(i8* %17, i8* %18, i32 %13)
%34 = call i32 @AES_set_encrypt_key(i8* %5, i32 128, i32* %4)
%35 = load i32, i32* @AES_ENCRYPT
%36 = call i32 @AES_cbc_encrypt(i8* %11, i8* %15, i32 %8, i32* %4, i8* %17, i32 %35)
%37 = load i32, i32* @stdout
%38 = call i32 @hexdump(i32 %37, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %15, i32 %13)
%39 = call i32 @putchar(i32 10)
%40 = call i32 @memcpy(i8* %17, i8* %18, i32 %13)
%41 = call i32 @AES_set_decrypt_key(i8* %5, i32 128, i32* %4)
%42 = lshr exact i32 %13, 1
%43 = load i32, i32* @AES_DECRYPT
%44 = call i32 @AES_cbc_encrypt(i8* %15, i8* %16, i32 %42, i32* %4, i8* %17, i32 %43)
%45 = zext i32 %42 to i64
%46 = getelementptr inbounds i8, i8* %15, i64 %45
%47 = getelementptr inbounds i8, i8* %16, i64 %45
%48 = load i32, i32* @AES_DECRYPT
%49 = call i32 @AES_cbc_encrypt(i8* %46, i8* %47, i32 %42, i32* %4, i8* %17, i32 %48)
%50 = load i32, i32* @stdout
%51 = call i32 @hexdump(i32 %50, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %16, i32 %13)
%52 = call i32 @putchar(i32 10)
ret i32 0
}