#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 uint8_t;
typedef int uint32_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ block;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AES_Decrypt(int *, int *, int);
int /*<<< orphan*/ AES_Done();
int /*<<< orphan*/ AES_Encrypt_all(int *, int *, int, int);
int AES_ExpandKey(int *, int);
int /*<<< orphan*/ AES_Init();
int /*<<< orphan*/ AES_Verify(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i;
  int read_count;
  uint8_t block[16];
  uint8_t key[16 * (14 + 1)];
  int keyLen = 16;
  struct timeval time_start_1;
  struct timeval time_end_1;
  double time_diff_1;
  struct timeval time_start_2;
  struct timeval time_end_2;
  double time_diff_2;
  FILE *output_file_decryption;
  FILE *input_file = fopen(argv[1], "rb");
  FILE *input_file_2 = fopen(argv[1], "rb");
  FILE *output_file_encryption =
      fopen("test_files/output/output_file_encryption", "wb");
  if (input_file == NULL) {
    fprintf(stderr, "Open input file error!\n");
    exit(EXIT_FAILURE);
  }
  if (output_file_encryption == NULL) {
    fprintf(stderr, "Open output file error!\n");
    exit(EXIT_FAILURE);
  }
  AES_Init();
  for (i = 0; i < keyLen; i++) {
    key[i] = i;
  }
  int expandKeyLen = AES_ExpandKey(key, keyLen);
  uint32_t BLOCK_count = 0;
  uint32_t last_BLOCK_size = 0;
  gettimeofday(&time_start_2, NULL);
  read_count = fread(block, sizeof(uint8_t), sizeof(block), input_file_2);
  while (read_count > 0) {
    if (read_count == 16) {
      BLOCK_count++;
    } else {
      last_BLOCK_size = read_count;
    }
    read_count = fread(block, sizeof(uint8_t), sizeof(block), input_file_2);
  }
  fclose(input_file_2);
  uint32_t file_size = sizeof(uint8_t) * (BLOCK_count * 16 + last_BLOCK_size);
  printf("file size:%u bytes\n", file_size);
  uint8_t *inputs = (uint8_t *)malloc(file_size);
  read_count = fread(inputs, sizeof(uint8_t), file_size, input_file);
  fclose(input_file);
  gettimeofday(&time_start_1, NULL);
  AES_Encrypt_all(inputs, key, expandKeyLen, BLOCK_count);
  gettimeofday(&time_end_1, NULL);
  gettimeofday(&time_end_2, NULL);
  time_diff_1 = (1000000.0 * (double)(time_end_1.tv_sec - time_start_1.tv_sec) +
                 (double)(time_end_1.tv_usec - time_start_1.tv_usec)) /
                1000000.0;
  time_diff_2 = (1000000.0 * (double)(time_end_2.tv_sec - time_start_2.tv_sec) +
                 (double)(time_end_2.tv_usec - time_start_2.tv_usec)) /
                1000000.0;
  printf("\x1B[33m"
         "Encrpytion without disk I/O takes: %lf secs\n"
         "\x1B[0m",
         time_diff_1);
  printf("\x1B[33m"
         "Encrpytion with    disk I/O takes: %lf secs\n"
         "\x1B[0m",
         time_diff_2);
  printf("\x1B[33m"
         "disk I/O takes: %lf secs(with - without)\n"
         "\x1B[0m",
         time_diff_2 - time_diff_1);
  printf("===============================================\n");
  printf("DO NOT do Parallelization for Decryption,this process is for "
         "Verification\n");
  printf("Decrypting for Verification...please wait\n");
  fwrite(inputs, sizeof(uint8_t), file_size, output_file_encryption);
  fclose(output_file_encryption);
  output_file_encryption =
      fopen("test_files/output/output_file_encryption", "rb");
  if (output_file_encryption == NULL) {
    fprintf(stderr, "Open output file error!\n");
    exit(EXIT_FAILURE);
  }
  output_file_decryption =
      fopen("test_files/output/output_file_decryption", "wb");
  if (output_file_decryption == NULL) {
    fprintf(stderr, "Open output file error!\n");
    exit(EXIT_FAILURE);
  }
  read_count =
      fread(block, sizeof(uint8_t), sizeof(block), output_file_encryption);
  while (read_count > 0) {
    if (read_count == 16) {
      AES_Decrypt(block, key, expandKeyLen);
    }
    fwrite(block, sizeof(uint8_t), read_count, output_file_decryption);
    read_count =
        fread(block, sizeof(uint8_t), sizeof(block), output_file_encryption);
  }
  fclose(output_file_decryption);
  fclose(output_file_encryption);
  output_file_decryption =
      fopen("test_files/output/output_file_decryption", "rb");
  input_file = fopen(argv[1], "rb");
  AES_Verify(input_file, output_file_decryption);
  AES_Done();
  fclose(input_file);
  fclose(output_file_decryption);
  free(inputs);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x10,-0x424(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd6(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x488(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdbb(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x490(%rbp)
lea    0xdab(%rip),%rdi
lea    0xdcd(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x498(%rbp)
cmpq   $0x0,-0x488(%rbp)
jne    12a4 <main+0xa4>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xda6(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
cmpq   $0x0,-0x498(%rbp)
jne    12d5 <main+0xd5>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    $0x0,%al
call   1080 <AES_Init@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x424(%rbp),%eax
jge    130e <main+0x10e>
mov    -0x14(%rbp),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x420(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12e3 <main+0xe3>
lea    -0x420(%rbp),%rdi
mov    -0x424(%rbp),%esi
call   1100 <AES_ExpandKey@plt>
mov    %eax,-0x49c(%rbp)
movl   $0x0,-0x4a0(%rbp)
movl   $0x0,-0x4a4(%rbp)
lea    -0x460(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
lea    -0x60(%rbp),%rdi
mov    -0x490(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1040 <fread@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    13ba <main+0x1ba>
cmpl   $0x10,-0x18(%rbp)
jne    138f <main+0x18f>
mov    -0x4a0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4a0(%rbp)
jmp    1398 <main+0x198>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4a4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x490(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1040 <fread@plt>
mov    %eax,-0x18(%rbp)
jmp    1367 <main+0x167>
mov    -0x490(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x4a0(%rbp),%eax
shl    $0x4,%eax
add    -0x4a4(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,-0x4a8(%rbp)
mov    -0x4a8(%rbp),%esi
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4a8(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x4b0(%rbp)
mov    -0x4b0(%rbp),%rdi
mov    -0x4a8(%rbp),%edx
mov    -0x488(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fread@plt>
mov    %eax,-0x18(%rbp)
mov    -0x488(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x438(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x4b0(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x49c(%rbp),%edx
mov    -0x4a0(%rbp),%ecx
call   10b0 <AES_Encrypt_all@plt>
lea    -0x448(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
lea    -0x470(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x440(%rbp),%rax
sub    -0x430(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    -0x448(%rbp),%rax
sub    -0x438(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0xb4f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xb3f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x450(%rbp)
ff
mov    -0x468(%rbp),%rax
sub    -0x458(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    -0x470(%rbp),%rax
sub    -0x460(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0xb05(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xaf5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x478(%rbp)
ff
movsd  -0x450(%rbp),%xmm0
ff
lea    0xb56(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  -0x478(%rbp),%xmm0
ff
lea    0xb76(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  -0x478(%rbp),%xmm0
ff
subsd  -0x450(%rbp),%xmm0
ff
lea    0xb8e(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xbb3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4b0(%rbp),%rdi
mov    -0x4a8(%rbp),%edx
mov    -0x498(%rbp),%rcx
mov    $0x4,%esi
call   1120 <fwrite@plt>
mov    -0x498(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xa4f(%rip),%rdi
lea    0xa45(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x498(%rbp)
cmpq   $0x0,-0x498(%rbp)
jne    1600 <main+0x400>
mov    0x29fc(%rip),%rax
mov    (%rax),%edi
lea    0xa62(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x29df(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    0xbbb(%rip),%rdi
lea    0xa26(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x480(%rbp)
cmpq   $0x0,-0x480(%rbp)
jne    164b <main+0x44b>
mov    0x29b1(%rip),%rax
mov    (%rax),%edi
lea    0xa17(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2994(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    -0x60(%rbp),%rdi
mov    -0x498(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1040 <fread@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    16cc <main+0x4cc>
cmpl   $0x10,-0x18(%rbp)
jne    1692 <main+0x492>
lea    -0x60(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x49c(%rbp),%edx
call   10e0 <AES_Decrypt@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x480(%rbp),%rcx
mov    $0x4,%esi
call   1120 <fwrite@plt>
lea    -0x60(%rbp),%rdi
mov    -0x498(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1040 <fread@plt>
mov    %eax,-0x18(%rbp)
jmp    1668 <main+0x468>
mov    -0x480(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x498(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xad7(%rip),%rdi
lea    0x916(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x480(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x8fb(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x488(%rbp)
mov    -0x488(%rbp),%rdi
mov    -0x480(%rbp),%rsi
call   1060 <AES_Verify@plt>
mov    $0x0,%al
call   10d0 <AES_Done@plt>
mov    -0x488(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x480(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x4b0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x4b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x468,%rsp
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe19(%rip),%rbx
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%r13
mov    0x8(%rbp),%rdi
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%rbx
lea    0xdfb(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   1100 <fopen@plt>
test   %r13,%r13
je     15f3 <main+0x3e3>
mov    %rbp,0x8(%rsp)
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     15e1 <main+0x3d1>
xor    %r14d,%r14d
xor    %eax,%eax
call   1090 <AES_Init@plt>
movaps 0xd77(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xd78(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xd79(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xd7a(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
lea    0xa0(%rsp),%rdi
mov    $0x10,%esi
call   1110 <AES_ExpandKey@plt>
mov    %eax,%r15d
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
lea    0x60(%rsp),%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
mov    $0x0,%ebp
test   %eax,%eax
jle    1337 <main+0x127>
xor    %ebp,%ebp
lea    0x60(%rsp),%r12
xor    %r14d,%r14d
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0x10,%eax
sete   %cl
cmovne %eax,%ebp
add    %ecx,%r14d
mov    %r12,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
test   %eax,%eax
jg     1310 <main+0x100>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %r14d,%ebx
shl    $0x4,%ebx
add    %ebp,%ebx
shl    $0x2,%ebx
lea    0xd57(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebx,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x4,%esi
mov    %ebx,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
lea    0xa0(%rsp),%rsi
mov    %rbp,%rdi
mov    %r15d,%edx
mov    %r14d,%ecx
call   10c0 <AES_Encrypt_all@plt>
lea    0x40(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
lea    0x20(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x40(%rsp),%rax
mov    0x48(%rsp),%rcx
sub    0x58(%rsp),%rcx
cvtsi2sd %rcx,%xmm2
sub    0x50(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xc5f(%rip),%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
mov    0x20(%rsp),%rax
mov    0x28(%rsp),%rcx
sub    0x38(%rsp),%rcx
cvtsi2sd %rcx,%xmm3
sub    0x30(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
divsd  %xmm1,%xmm3
movsd  %xmm3,(%rsp)
lea    0xc90(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xcb4(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
movsd  (%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
lea    0xccc(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd1a(%rip),%rdi
call   1040 <puts@plt>
lea    0xd3e(%rip),%rdi
call   1040 <puts@plt>
lea    0xd7c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %ebx,%edx
mov    0x18(%rsp),%rbx
mov    %rbx,%rcx
call   1130 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
lea    0xb9e(%rip),%rdi
lea    0xb94(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     15e1 <main+0x3d1>
mov    %rax,%r14
mov    %rbp,(%rsp)
lea    0xc8b(%rip),%rdi
lea    0xb9d(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     15e1 <main+0x3d1>
mov    %rax,%rbp
lea    0x60(%rsp),%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
test   %eax,%eax
jle    1565 <main+0x355>
mov    %eax,%r12d
lea    0x60(%rsp),%rbx
lea    0xa0(%rsp),%r13
jmp    154f <main+0x33f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1130 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
mov    %eax,%r12d
test   %eax,%eax
jle    1565 <main+0x355>
cmp    $0x10,%r12d
jne    1520 <main+0x310>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
call   10f0 <AES_Decrypt@plt>
jmp    1520 <main+0x310>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
lea    0xbdf(%rip),%rdi
lea    0xac5(%rip),%rbx
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdi
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1070 <AES_Verify@plt>
xor    %eax,%eax
call   10e0 <AES_Done@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x468,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29f8(%rip),%rax
mov    (%rax),%edi
lea    0xa9e(%rip),%rsi
jmp    1603 <main+0x3f3>
mov    0x29e6(%rip),%rax
mov    (%rax),%edi
lea    0xa74(%rip),%rsi
call   10b0 <fprintf@plt>
mov    0x29c9(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [3 x i8] c"rb\00"
@.str.1 = [41 x i8] c"test_files/output/output_file_encryption\00"
@.str.2 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.3 = [24 x i8] c"Open input file error!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [25 x i8] c"Open output file error!\0A\00"
@.str.5 = [20 x i8] c"file size:%u bytes\0A\00"
@.str.6 = [54 x i8] c"\1B[33mEncrpytion without disk I/O takes: %lf secs\0A\1B[0m\00"
@.str.7 = [54 x i8] c"\1B[33mEncrpytion with disk I/O takes: %lf secs\0A\1B[0m\00"
@.str.8 = [51 x i8] c"\1B[33mdisk I/O takes: %lf secs(with - without)\0A\1B[0m\00"
@.str.9 = [49 x i8] c"===============================================\0A\00"
@.str.10 = [75 x i8] c"DO NOT do Parallelization for Decryption,this process is for Verification\0A\00"
@.str.11 = [43 x i8] c"Decrypting for Verification...please wait\0A\00"
@.str.12 = [41 x i8] c"test_files/output/output_file_decryption\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [16 x i32]
%9 = alloca [240 x i32]
%10 = alloca i32
%11 = alloca %struct.timeval
%12 = alloca %struct.timeval
%13 = alloca double
%14 = alloca %struct.timeval
%15 = alloca %struct.timeval
%16 = alloca double
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16, i32* %10
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %29, i32** %18
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %33, i32** %19
%34 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %34, i32** %20
%35 = load i32*, i32** %18
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %42
37: ; preds = %2
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32, i32* @EXIT_FAILURE
%41 = call i32 @exit(i32 %40)
unreachable
42: ; preds = %2
%43 = load i32*, i32** %20
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* @EXIT_FAILURE
%49 = call i32 @exit(i32 %48)
unreachable
50: ; preds = %42
%51 = call i32 (...) @AES_Init()
store i32 0, i32* %6
br label %52
52: ; preds = %61, %50
%53 = load i32, i32* %6
%54 = load i32, i32* %10
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %64
56: ; preds = %52
%57 = load i32, i32* %6
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [240 x i32], [240 x i32]* %9, i64 0, i64 %59
store i32 %57, i32* %60
br label %61
61: ; preds = %56
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %52
64: ; preds = %52
%65 = getelementptr inbounds [240 x i32], [240 x i32]* %9, i64 0, i64 0
%66 = load i32, i32* %10
%67 = call i32 @AES_ExpandKey(i32* %65, i32 %66)
store i32 %67, i32* %21
store i32 0, i32* %22
store i32 0, i32* %23
%68 = call i32 @gettimeofday(%struct.timeval* %14, i32* null)
%69 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%70 = load i32*, i32** %19
%71 = call i32 @fread(i32* %69, i32 4, i32 64, i32* %70)
store i32 %71, i32* %7
br label %72
72: ; preds = %83, %64
%73 = load i32, i32* %7
%74 = icmp sgt i32 %73, 0
br i1 %74, label %75, label %87
75: ; preds = %72
%76 = load i32, i32* %7
%77 = icmp eq i32 %76, 16
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load i32, i32* %22
%80 = add nsw i32 %79, 1
store i32 %80, i32* %22
br label %83
81: ; preds = %75
%82 = load i32, i32* %7
store i32 %82, i32* %23
br label %83
83: ; preds = %81, %78
%84 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%85 = load i32*, i32** %19
%86 = call i32 @fread(i32* %84, i32 4, i32 64, i32* %85)
store i32 %86, i32* %7
br label %72
87: ; preds = %72
%88 = load i32*, i32** %19
%89 = call i32 @fclose(i32* %88)
%90 = load i32, i32* %22
%91 = mul nsw i32 %90, 16
%92 = load i32, i32* %23
%93 = add nsw i32 %91, %92
%94 = sext i32 %93 to i64
%95 = mul i64 4, %94
%96 = trunc i64 %95 to i32
store i32 %96, i32* %24
%97 = load i32, i32* %24
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %97)
%99 = load i32, i32* %24
%100 = call i64 @malloc(i32 %99)
%101 = inttoptr i64 %100 to i32*
store i32* %101, i32** %25
%102 = load i32*, i32** %25
%103 = load i32, i32* %24
%104 = load i32*, i32** %18
%105 = call i32 @fread(i32* %102, i32 4, i32 %103, i32* %104)
store i32 %105, i32* %7
%106 = load i32*, i32** %18
%107 = call i32 @fclose(i32* %106)
%108 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
%109 = load i32*, i32** %25
%110 = getelementptr inbounds [240 x i32], [240 x i32]* %9, i64 0, i64 0
%111 = load i32, i32* %21
%112 = load i32, i32* %22
%113 = call i32 @AES_Encrypt_all(i32* %109, i32* %110, i32 %111, i32 %112)
%114 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%115 = call i32 @gettimeofday(%struct.timeval* %15, i32* null)
%116 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%117 = load i64, i64* %116
%118 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
%119 = load i64, i64* %118
%120 = sub nsw i64 %117, %119
%121 = sitofp i64 %120 to double
%122 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%123 = load i64, i64* %122
%124 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
%125 = load i64, i64* %124
%126 = sub nsw i64 %123, %125
%127 = sitofp i64 %126 to double
%128 = call double @llvm.fmuladd.f64(double 1.000000e+06, double %121, double %127)
%129 = fdiv double %128, 1.000000e+06
store double %129, double* %13
%130 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%131 = load i64, i64* %130
%132 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%133 = load i64, i64* %132
%134 = sub nsw i64 %131, %133
%135 = sitofp i64 %134 to double
%136 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%137 = load i64, i64* %136
%138 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%139 = load i64, i64* %138
%140 = sub nsw i64 %137, %139
%141 = sitofp i64 %140 to double
%142 = call double @llvm.fmuladd.f64(double 1.000000e+06, double %135, double %141)
%143 = fdiv double %142, 1.000000e+06
store double %143, double* %16
%144 = load double, double* %13
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), double %144)
%146 = load double, double* %16
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), double %146)
%148 = load double, double* %16
%149 = load double, double* %13
%150 = fsub double %148, %149
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), double %150)
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.10, i64 0, i64 0))
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
%155 = load i32*, i32** %25
%156 = load i32, i32* %24
%157 = load i32*, i32** %20
%158 = call i32 @fwrite(i32* %155, i32 4, i32 %156, i32* %157)
%159 = load i32*, i32** %20
%160 = call i32 @fclose(i32* %159)
%161 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %161, i32** %20
%162 = load i32*, i32** %20
%163 = icmp eq i32* %162, null
br i1 %163, label %164, label %169
164: ; preds = %87
%165 = load i32, i32* @stderr
%166 = call i32 @fprintf(i32 %165, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%167 = load i32, i32* @EXIT_FAILURE
%168 = call i32 @exit(i32 %167)
unreachable
169: ; preds = %87
%170 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %170, i32** %17
%171 = load i32*, i32** %17
%172 = icmp eq i32* %171, null
br i1 %172, label %173, label %178
173: ; preds = %169
%174 = load i32, i32* @stderr
%175 = call i32 @fprintf(i32 %174, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%176 = load i32, i32* @EXIT_FAILURE
%177 = call i32 @exit(i32 %176)
unreachable
178: ; preds = %169
%179 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%180 = load i32*, i32** %20
%181 = call i32 @fread(i32* %179, i32 4, i32 64, i32* %180)
store i32 %181, i32* %7
br label %182
182: ; preds = %193, %178
%183 = load i32, i32* %7
%184 = icmp sgt i32 %183, 0
br i1 %184, label %185, label %201
185: ; preds = %182
%186 = load i32, i32* %7
%187 = icmp eq i32 %186, 16
br i1 %187, label %188, label %193
188: ; preds = %185
%189 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%190 = getelementptr inbounds [240 x i32], [240 x i32]* %9, i64 0, i64 0
%191 = load i32, i32* %21
%192 = call i32 @AES_Decrypt(i32* %189, i32* %190, i32 %191)
br label %193
193: ; preds = %188, %185
%194 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%195 = load i32, i32* %7
%196 = load i32*, i32** %17
%197 = call i32 @fwrite(i32* %194, i32 4, i32 %195, i32* %196)
%198 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%199 = load i32*, i32** %20
%200 = call i32 @fread(i32* %198, i32 4, i32 64, i32* %199)
store i32 %200, i32* %7
br label %182
201: ; preds = %182
%202 = load i32*, i32** %17
%203 = call i32 @fclose(i32* %202)
%204 = load i32*, i32** %20
%205 = call i32 @fclose(i32* %204)
%206 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %206, i32** %17
%207 = load i8**, i8*** %5
%208 = getelementptr inbounds i8*, i8** %207, i64 1
%209 = load i8*, i8** %208
%210 = call i32* @fopen(i8* %209, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %210, i32** %18
%211 = load i32*, i32** %18
%212 = load i32*, i32** %17
%213 = call i32 @AES_Verify(i32* %211, i32* %212)
%214 = call i32 (...) @AES_Done()
%215 = load i32*, i32** %18
%216 = call i32 @fclose(i32* %215)
%217 = load i32*, i32** %17
%218 = call i32 @fclose(i32* %217)
%219 = load i32*, i32** %25
%220 = call i32 @free(i32* %219)
%221 = load i32, i32* %3
ret i32 %221
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [3 x i8] c"rb\00"
@.str.1 = [41 x i8] c"test_files/output/output_file_encryption\00"
@.str.2 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.3 = [24 x i8] c"Open input file error!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [25 x i8] c"Open output file error!\0A\00"
@.str.5 = [20 x i8] c"file size:%u bytes\0A\00"
@.str.6 = [54 x i8] c"\1B[33mEncrpytion without disk I/O takes: %lf secs\0A\1B[0m\00"
@.str.7 = [54 x i8] c"\1B[33mEncrpytion with disk I/O takes: %lf secs\0A\1B[0m\00"
@.str.8 = [51 x i8] c"\1B[33mdisk I/O takes: %lf secs(with - without)\0A\1B[0m\00"
@.str.12 = [41 x i8] c"test_files/output/output_file_decryption\00"
@str = [48 x i8] c"===============================================\00"
@str.13 = [74 x i8] c"DO NOT do Parallelization for Decryption,this process is for Verification\00"
@str.14 = [42 x i8] c"Decrypting for Verification...please wait\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i32]
%4 = alloca [240 x i32]
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
%8 = alloca %struct.timeval
%9 = bitcast [16 x i32]* %3 to i8*
%10 = bitcast [240 x i32]* %4 to i8*
%11 = bitcast %struct.timeval* %5 to i8*
%12 = bitcast %struct.timeval* %6 to i8*
%13 = bitcast %struct.timeval* %7 to i8*
%14 = bitcast %struct.timeval* %8 to i8*
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %15
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i32* %17, null
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = tail call i32 @exit(i32 %25)
unreachable
27: ; preds = %2
%28 = icmp eq i32* %20, null
br i1 %28, label %29, label %34
29: ; preds = %27
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = tail call i32 @exit(i32 %32)
unreachable
34: ; preds = %27
%35 = tail call i32 (...) @AES_Init()
%36 = getelementptr inbounds [240 x i32], [240 x i32]* %4, i64 0, i64 0
%37 = bitcast [240 x i32]* %4 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %37
%38 = getelementptr inbounds [240 x i32], [240 x i32]* %4, i64 0, i64 4
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %39
%40 = getelementptr inbounds [240 x i32], [240 x i32]* %4, i64 0, i64 8
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %41
%42 = getelementptr inbounds [240 x i32], [240 x i32]* %4, i64 0, i64 12
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %43
%44 = call i32 @AES_ExpandKey(i32* %36, i32 16)
%45 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%46 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%47 = call i32 @fread(i32* %46, i32 4, i32 64, i32* %19)
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %59
49: ; preds = %34, %49
%50 = phi i32 [ %57, %49 ], [ %47, %34 ]
%51 = phi i32 [ %56, %49 ], [ 0, %34 ]
%52 = phi i32 [ %55, %49 ], [ 0, %34 ]
%53 = icmp eq i32 %50, 16
%54 = zext i1 %53 to i32
%55 = add nuw nsw i32 %52, %54
%56 = select i1 %53, i32 %51, i32 %50
%57 = call i32 @fread(i32* %46, i32 4, i32 64, i32* %19)
%58 = icmp sgt i32 %57, 0
br i1 %58, label %49, label %59
59: ; preds = %49, %34
%60 = phi i32 [ 0, %34 ], [ %55, %49 ]
%61 = phi i32 [ 0, %34 ], [ %56, %49 ]
%62 = call i32 @fclose(i32* %19)
%63 = shl nsw i32 %60, 4
%64 = add nsw i32 %63, %61
%65 = shl i32 %64, 2
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %65)
%67 = call i64 @malloc(i32 %65)
%68 = inttoptr i64 %67 to i32*
%69 = call i32 @fread(i32* %68, i32 4, i32 %65, i32* %17)
%70 = call i32 @fclose(i32* %17)
%71 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%72 = call i32 @AES_Encrypt_all(i32* %68, i32* %36, i32 %44, i32 %60)
%73 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%74 = call i32 @gettimeofday(%struct.timeval* %8, i32* null)
%75 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%76 = load i64, i64* %75
%77 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%78 = load i64, i64* %77
%79 = sub nsw i64 %76, %78
%80 = sitofp i64 %79 to double
%81 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%82 = load i64, i64* %81
%83 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%84 = load i64, i64* %83
%85 = sub nsw i64 %82, %84
%86 = sitofp i64 %85 to double
%87 = call double @llvm.fmuladd.f64(double %80, double 1.000000e+06, double %86)
%88 = fdiv double %87, 1.000000e+06
%89 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i64 0, i32 1
%90 = load i64, i64* %89
%91 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 1
%92 = load i64, i64* %91
%93 = sub nsw i64 %90, %92
%94 = sitofp i64 %93 to double
%95 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i64 0, i32 0
%96 = load i64, i64* %95
%97 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 0
%98 = load i64, i64* %97
%99 = sub nsw i64 %96, %98
%100 = sitofp i64 %99 to double
%101 = call double @llvm.fmuladd.f64(double %94, double 1.000000e+06, double %100)
%102 = fdiv double %101, 1.000000e+06
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), double %88)
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), double %102)
%105 = fsub double %102, %88
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), double %105)
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.13, i64 0, i64 0))
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
%110 = call i32 @fwrite(i32* %68, i32 4, i32 %65, i32* %20)
%111 = call i32 @fclose(i32* %20)
%112 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %119
114: ; preds = %59
%115 = load i32, i32* @stderr
%116 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%117 = load i32, i32* @EXIT_FAILURE
%118 = call i32 @exit(i32 %117)
unreachable
119: ; preds = %59
%120 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%121 = icmp eq i32* %120, null
br i1 %121, label %122, label %127
122: ; preds = %119
%123 = load i32, i32* @stderr
%124 = call i32 @fprintf(i32 %123, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%125 = load i32, i32* @EXIT_FAILURE
%126 = call i32 @exit(i32 %125)
unreachable
127: ; preds = %119
%128 = call i32 @fread(i32* %46, i32 4, i32 64, i32* %112)
%129 = icmp sgt i32 %128, 0
br i1 %129, label %130, label %139
130: ; preds = %127, %135
%131 = phi i32 [ %137, %135 ], [ %128, %127 ]
%132 = icmp eq i32 %131, 16
br i1 %132, label %133, label %135
133: ; preds = %130
%134 = call i32 @AES_Decrypt(i32* %46, i32* %36, i32 %44)
br label %135
135: ; preds = %133, %130
%136 = call i32 @fwrite(i32* %46, i32 4, i32 %131, i32* %120)
%137 = call i32 @fread(i32* %46, i32 4, i32 64, i32* %112)
%138 = icmp sgt i32 %137, 0
br i1 %138, label %130, label %139
139: ; preds = %135, %127
%140 = call i32 @fclose(i32* %120)
%141 = call i32 @fclose(i32* %112)
%142 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%143 = load i8*, i8** %15
%144 = call i32* @fopen(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%145 = call i32 @AES_Verify(i32* %144, i32* %142)
%146 = call i32 (...) @AES_Done()
%147 = call i32 @fclose(i32* %144)
%148 = call i32 @fclose(i32* %142)
%149 = call i32 @free(i32* %68)
ret i32 0
}