#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*/ AES_KEY;

/* Variables and functions */
int AES_BLOCK_SIZE;
int /*<<< orphan*/ AES_DECRYPT;
int /*<<< orphan*/ AES_ENCRYPT;
int /*<<< orphan*/ AES_bi_ige_encrypt(unsigned char *, unsigned char *, int,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *, unsigned char *,
                                      int /*<<< orphan*/);
int /*<<< orphan*/ AES_ige_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*/ assert(int);
int /*<<< orphan*/ hexdump(int /*<<< orphan*/, char *, unsigned char *, int);
scalar_t__ memcmp(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ run_test_vectors();
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  unsigned char rkey[16];
  unsigned char rkey2[16];
  AES_KEY key;
  AES_KEY key2;
  unsigned char plaintext[10240];
  unsigned char ciphertext[10240];
  unsigned char checktext[10240];
  unsigned char iv[AES_BLOCK_SIZE * 4];
  unsigned char saved_iv[AES_BLOCK_SIZE * 4];
  int err = 0;
  unsigned int n;
  unsigned matches;
  assert(10240 >= 128);
  RAND_pseudo_bytes(rkey, sizeof rkey);
  RAND_pseudo_bytes(plaintext, sizeof plaintext);
  RAND_pseudo_bytes(iv, sizeof iv);
  memcpy(saved_iv, iv, sizeof saved_iv);
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_ige_encrypt(plaintext, ciphertext, 128, &key, iv, AES_ENCRYPT);
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(ciphertext, checktext, 128, &key, iv, AES_DECRYPT);
  if (memcmp(checktext, plaintext, 128)) {
    printf("Encrypt+decrypt doesn't match\n");
    hexdump(stdout, "Plaintext", plaintext, 128);
    hexdump(stdout, "Checktext", checktext, 128);
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(plaintext, ciphertext, 128 / 2, &key, iv, AES_ENCRYPT);
  AES_ige_encrypt(plaintext + 128 / 2, ciphertext + 128 / 2, 128 / 2, &key, iv,
                  AES_ENCRYPT);
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(ciphertext, checktext, 128, &key, iv, AES_DECRYPT);
  if (memcmp(checktext, plaintext, 128)) {
    printf("Chained encrypt+decrypt doesn't match\n");
    hexdump(stdout, "Plaintext", plaintext, 128);
    hexdump(stdout, "Checktext", checktext, 128);
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(plaintext, ciphertext, 128 / 2, &key, iv, AES_ENCRYPT);
  AES_ige_encrypt(plaintext + 128 / 2, ciphertext + 128 / 2, 128 / 2, &key, iv,
                  AES_ENCRYPT);
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(ciphertext, checktext, 128 / 2, &key, iv, AES_DECRYPT);
  AES_ige_encrypt(ciphertext + 128 / 2, checktext + 128 / 2, 128 / 2, &key, iv,
                  AES_DECRYPT);
  if (memcmp(checktext, plaintext, 128)) {
    printf("Chained encrypt+chained decrypt doesn't match\n");
    hexdump(stdout, "Plaintext", plaintext, 128);
    hexdump(stdout, "Checktext", checktext, 128);
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
                  AES_ENCRYPT);
  ++ciphertext[sizeof ciphertext / 2];
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  memcpy(iv, saved_iv, sizeof iv);
  AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv,
                  AES_DECRYPT);
  matches = 0;
  for (n = 0; n < sizeof checktext; ++n)
    if (checktext[n] == plaintext[n])
      ++matches;
  if (matches > sizeof checktext / 2 + sizeof checktext / 100) {
    printf("More than 51%% matches after garbling\n");
    ++err;
  }
  if (matches < sizeof checktext / 2) {
    printf("Garble extends backwards!\n");
    ++err;
  }
  RAND_pseudo_bytes(rkey2, sizeof rkey2);
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_bi_ige_encrypt(plaintext, ciphertext, 128, &key, &key2, iv, AES_ENCRYPT);
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_decrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_bi_ige_encrypt(ciphertext, checktext, 128, &key, &key2, iv, AES_DECRYPT);
  if (memcmp(checktext, plaintext, 128)) {
    printf("Encrypt+decrypt doesn't match\n");
    hexdump(stdout, "Plaintext", plaintext, 128);
    hexdump(stdout, "Checktext", checktext, 128);
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
                  AES_ENCRYPT);
  ++ciphertext[sizeof ciphertext / 2];
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_decrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv,
                  AES_DECRYPT);
  matches = 0;
  for (n = 0; n < sizeof checktext; ++n)
    if (checktext[n] == plaintext[n])
      ++matches;
  if (matches > sizeof checktext / 100) {
    printf("More than 1%% matches after bidirectional garbling\n");
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
                  AES_ENCRYPT);
  ++ciphertext[sizeof ciphertext - 1];
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_decrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv,
                  AES_DECRYPT);
  matches = 0;
  for (n = 0; n < sizeof checktext; ++n)
    if (checktext[n] == plaintext[n])
      ++matches;
  if (matches > sizeof checktext / 100) {
    printf("More than 1%% matches after bidirectional garbling (2)\n");
    ++err;
  }
  AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_encrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv,
                  AES_ENCRYPT);
  ++ciphertext[0];
  AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);
  AES_set_decrypt_key(rkey2, 8 * sizeof rkey2, &key2);
  AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv,
                  AES_DECRYPT);
  matches = 0;
  for (n = 0; n < sizeof checktext; ++n)
    if (checktext[n] == plaintext[n])
      ++matches;
  if (matches > sizeof checktext / 100) {
    printf("More than 1%% matches after bidirectional garbling (3)\n");
    ++err;
  }
  err += run_test_vectors();
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7890,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e18(%rip),%rax
mov    (%rax),%ecx
shl    $0x2,%ecx
mov    %rcx,-0x7878(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x7848(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x7870(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x7850(%rbp)
mov    (%rax),%eax
shl    $0x2,%eax
mov    %rax,-0x7888(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x7880(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x7858(%rbp)
movl   $0x0,-0x785c(%rbp)
mov    $0x1,%edi
call   1070 <assert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   10b0 <RAND_pseudo_bytes@plt>
lea    -0x2840(%rbp),%rdi
mov    $0x2800,%esi
call   10b0 <RAND_pseudo_bytes@plt>
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%esi
call   10b0 <RAND_pseudo_bytes@plt>
mov    -0x7880(%rbp),%rdi
mov    -0x7870(%rbp),%rsi
mov    -0x7888(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x2d08(%rip),%rax
mov    (%rax),%r9d
mov    $0x80,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x2cbd(%rip),%rax
mov    (%rax),%r9d
mov    $0x80,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x7840(%rbp),%rdi
lea    -0x2840(%rbp),%rsi
mov    $0x80,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     13b3 <main+0x203>
lea    0xca3(%rip),%rdi
call   1050 <printf@plt>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
lea    -0x2840(%rbp),%rdx
lea    0xca6(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
lea    -0x7840(%rbp),%rdx
lea    0xc8f(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x2bd3(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
add    $0x40,%rdi
lea    -0x5040(%rbp),%rsi
add    $0x40,%rsi
mov    0x2b9e(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x2b53(%rip),%rax
mov    (%rax),%r9d
mov    $0x80,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x7840(%rbp),%rdi
lea    -0x2840(%rbp),%rsi
mov    $0x80,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     151d <main+0x36d>
lea    0xb6c(%rip),%rdi
call   1050 <printf@plt>
mov    0x2af5(%rip),%rax
mov    (%rax),%edi
lea    -0x2840(%rbp),%rdx
lea    0xb3c(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    0x2ad4(%rip),%rax
mov    (%rax),%edi
lea    -0x7840(%rbp),%rdx
lea    0xb25(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x2a69(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
add    $0x40,%rdi
lea    -0x5040(%rbp),%rsi
add    $0x40,%rsi
mov    0x2a34(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x29e9(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
add    $0x40,%rdi
lea    -0x7840(%rbp),%rsi
add    $0x40,%rsi
mov    0x29b4(%rip),%rax
mov    (%rax),%r9d
mov    $0x40,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
lea    -0x7840(%rbp),%rdi
lea    -0x2840(%rbp),%rsi
mov    $0x80,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     16bc <main+0x50c>
lea    0x9f4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2956(%rip),%rax
mov    (%rax),%edi
lea    -0x2840(%rbp),%rdx
lea    0x99d(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    0x2935(%rip),%rax
mov    (%rax),%edi
lea    -0x7840(%rbp),%rdx
lea    0x986(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x28ca(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x3c40(%rbp),%al
add    $0x1,%al
mov    %al,-0x3c40(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7880(%rbp),%rsi
mov    -0x7870(%rbp),%rdi
mov    -0x7878(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x2871(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
movl   $0x0,-0x7864(%rbp)
movl   $0x0,-0x7860(%rbp)
mov    -0x7860(%rbp),%eax
cmp    $0x2800,%rax
jae    17f2 <main+0x642>
mov    -0x7860(%rbp),%eax
movzbl -0x7840(%rbp,%rax,1),%eax
ff
mov    -0x7860(%rbp),%ecx
movzbl -0x2840(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    17d9 <main+0x629>
mov    -0x7864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7864(%rbp)
jmp    17de <main+0x62e>
mov    -0x7860(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7860(%rbp)
jmp    1794 <main+0x5e4>
mov    -0x7864(%rbp),%eax
cmp    $0x1466,%rax
jbe    181f <main+0x66f>
lea    0x87e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
mov    -0x7864(%rbp),%eax
cmp    $0x1400,%rax
jae    184c <main+0x69c>
lea    0x878(%rip),%rdi
call   1050 <printf@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
call   10b0 <RAND_pseudo_bytes@plt>
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7870(%rbp),%r9
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x2736(%rip),%rax
mov    (%rax),%eax
mov    $0x80,%edx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   10d0 <AES_bi_ige_encrypt@plt>
add    $0x10,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7870(%rbp),%r9
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x26e7(%rip),%rax
mov    (%rax),%eax
mov    $0x80,%edx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   10d0 <AES_bi_ige_encrypt@plt>
add    $0x10,%rsp
lea    -0x7840(%rbp),%rdi
lea    -0x2840(%rbp),%rsi
mov    $0x80,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1997 <main+0x7e7>
lea    0x6bf(%rip),%rdi
call   1050 <printf@plt>
mov    0x267b(%rip),%rax
mov    (%rax),%edi
lea    -0x2840(%rbp),%rdx
lea    0x6c2(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    0x265a(%rip),%rax
mov    (%rax),%edi
lea    -0x7840(%rbp),%rdx
lea    0x6ab(%rip),%rsi
mov    $0x80,%ecx
call   10a0 <hexdump@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x25f9(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x3c40(%rbp),%al
add    $0x1,%al
mov    %al,-0x3c40(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x25aa(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
movl   $0x0,-0x7864(%rbp)
movl   $0x0,-0x7860(%rbp)
mov    -0x7860(%rbp),%eax
cmp    $0x2800,%rax
jae    1ab9 <main+0x909>
mov    -0x7860(%rbp),%eax
movzbl -0x7840(%rbp,%rax,1),%eax
ff
mov    -0x7860(%rbp),%ecx
movzbl -0x2840(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1aa0 <main+0x8f0>
mov    -0x7864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7864(%rbp)
jmp    1aa5 <main+0x8f5>
mov    -0x7860(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7860(%rbp)
jmp    1a5b <main+0x8ab>
mov    -0x7864(%rbp),%eax
cmp    $0x66,%rax
jbe    1ae4 <main+0x934>
lea    0x5fb(%rip),%rdi
call   1050 <printf@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x24ac(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x2841(%rbp),%al
add    $0x1,%al
mov    %al,-0x2841(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x245d(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
movl   $0x0,-0x7864(%rbp)
movl   $0x0,-0x7860(%rbp)
mov    -0x7860(%rbp),%eax
cmp    $0x2800,%rax
jae    1c06 <main+0xa56>
mov    -0x7860(%rbp),%eax
movzbl -0x7840(%rbp,%rax,1),%eax
ff
mov    -0x7860(%rbp),%ecx
movzbl -0x2840(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1bed <main+0xa3d>
mov    -0x7864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7864(%rbp)
jmp    1bf2 <main+0xa42>
mov    -0x7860(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7860(%rbp)
jmp    1ba8 <main+0x9f8>
mov    -0x7864(%rbp),%eax
cmp    $0x66,%rax
jbe    1c31 <main+0xa81>
lea    0x4e2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   1040 <AES_set_encrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x2840(%rbp),%rdi
lea    -0x5040(%rbp),%rsi
mov    0x235f(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
mov    -0x5040(%rbp),%al
add    $0x1,%al
mov    %al,-0x5040(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x80,%esi
lea    -0x34(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
lea    -0x30(%rbp),%rdi
mov    $0x80,%esi
lea    -0x38(%rbp),%rdx
call   10c0 <AES_set_decrypt_key@plt>
mov    -0x7870(%rbp),%r8
lea    -0x5040(%rbp),%rdi
lea    -0x7840(%rbp),%rsi
mov    0x2310(%rip),%rax
mov    (%rax),%r9d
mov    $0x2800,%edx
lea    -0x34(%rbp),%rcx
call   1080 <AES_ige_encrypt@plt>
movl   $0x0,-0x7864(%rbp)
movl   $0x0,-0x7860(%rbp)
mov    -0x7860(%rbp),%eax
cmp    $0x2800,%rax
jae    1d53 <main+0xba3>
mov    -0x7860(%rbp),%eax
movzbl -0x7840(%rbp,%rax,1),%eax
ff
mov    -0x7860(%rbp),%ecx
movzbl -0x2840(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1d3a <main+0xb8a>
mov    -0x7864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7864(%rbp)
jmp    1d3f <main+0xb8f>
mov    -0x7860(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7860(%rbp)
jmp    1cf5 <main+0xb45>
mov    -0x7864(%rbp),%eax
cmp    $0x66,%rax
jbe    1d7e <main+0xbce>
lea    0x3cd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x785c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x785c(%rbp)
mov    $0x0,%al
call   1030 <run_test_vectors@plt>
mov    %rax,%rcx
movslq -0x785c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x785c(%rbp)
mov    -0x785c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x7848(%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    $0x7848,%rsp
mov    %rsp,-0x68(%rbp)
mov    0x2e09(%rip),%rax
mov    (%rax),%ebx
shl    $0x2,%ebx
mov    %rsp,%r12
lea    0xf(%rbx),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
mov    (%rax),%r13d
shl    $0x2,%r13d
mov    %rsp,%r15
lea    0xf(%r13),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
movl   $0x1,-0x2c(%rbp)
mov    $0x1,%edi
call   1080 <assert@plt>
lea    -0x40(%rbp),%rdi
mov    $0x10,%esi
call   10c0 <RAND_pseudo_bytes@plt>
lea    -0x2870(%rbp),%rdi
mov    $0x2800,%esi
call   10c0 <RAND_pseudo_bytes@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   10c0 <RAND_pseudo_bytes@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   10a0 <memcpy@plt>
lea    -0x30(%rbp),%r14
lea    -0x40(%rbp),%r13
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%r9d
lea    -0x7870(%rbp),%rsi
lea    -0x2870(%rbp),%rdi
mov    $0x80,%edx
mov    %r14,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,-0x50(%rbp)
mov    %ebx,%edx
call   10a0 <memcpy@plt>
mov    0x2d23(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rbx
lea    -0x7870(%rbp),%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
mov    %r14,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
mov    %rbx,%rdi
lea    -0x2870(%rbp),%rsi
mov    $0x80,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1343 <main+0x183>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cbb(%rip),%rbx
mov    (%rbx),%edi
lea    0xcfa(%rip),%rsi
lea    -0x2870(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
mov    (%rbx),%edi
lea    0xcea(%rip),%rsi
lea    -0x5070(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
jmp    134a <main+0x18a>
movl   $0x0,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%r13
mov    $0x80,%esi
mov    %r13,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    -0x50(%rbp),%r14
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x2c58(%rip),%rbx
mov    (%rbx),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%rsi
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
lea    -0x2830(%rbp),%rdi
lea    -0x7830(%rbp),%rsi
mov    (%rbx),%r9d
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %r13,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x2c00(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rbx
lea    -0x7870(%rbp),%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
mov    %rbx,%rdi
lea    -0x2870(%rbp),%rsi
mov    $0x80,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1468 <main+0x2a8>
lea    0xd13(%rip),%rdi
call   1030 <puts@plt>
mov    0x2b98(%rip),%rbx
mov    (%rbx),%edi
lea    0xbd7(%rip),%rsi
lea    -0x2870(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
mov    (%rbx),%edi
lea    0xbc7(%rip),%rsi
lea    -0x5070(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%r13
mov    $0x80,%esi
mov    %r13,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    -0x50(%rbp),%r14
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x2b3a(%rip),%rbx
mov    (%rbx),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%rsi
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
mov    (%rbx),%r9d
lea    -0x2830(%rbp),%rdi
lea    -0x7830(%rbp),%rsi
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %r13,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x2ae2(%rip),%r14
mov    (%r14),%r9d
lea    -0x5070(%rbp),%rbx
lea    -0x7870(%rbp),%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
lea    -0x5030(%rbp),%rsi
mov    (%r14),%r9d
lea    -0x7830(%rbp),%rdi
mov    $0x40,%edx
mov    %r13,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
mov    %rbx,%rdi
lea    -0x2870(%rbp),%rsi
mov    $0x80,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     15a7 <main+0x3e7>
lea    0xba6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2a59(%rip),%rbx
mov    (%rbx),%edi
lea    0xa98(%rip),%rsi
lea    -0x2870(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
mov    (%rbx),%edi
lea    0xa88(%rip),%rsi
lea    -0x5070(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rbx
mov    $0x80,%esi
mov    %rbx,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    -0x50(%rbp),%r14
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x29fb(%rip),%rax
mov    (%rax),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%r13
mov    %r13,%rsi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
addb   $0x1,-0x6470(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   10a0 <memcpy@plt>
mov    0x29ba(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rsi
mov    %r13,%rdi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
pxor   %xmm0,%xmm0
mov    $0xc,%eax
movdqa 0x9ac(%rip),%xmm5
pxor   %xmm1,%xmm1
nopl   0x0(%rax,%rax,1)
movdqa -0x507c(%rbp,%rax,1),%xmm3
ff ff
movd   -0x5078(%rbp,%rax,1),%xmm4
ff ff
movd   -0x2878(%rbp,%rax,1),%xmm2
ff ff
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pcmpeqb -0x287c(%rbp,%rax,1),%xmm3
ff ff
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movq   -0x5074(%rbp,%rax,1),%xmm1
ff ff
movd   -0x5070(%rbp,%rax,1),%xmm4
ff ff
movq   -0x2874(%rbp,%rax,1),%xmm0
ff ff
pcmpeqb %xmm1,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   -0x2870(%rbp,%rax,1),%xmm1
ff ff
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rax
cmp    $0x280c,%rax
jne    1660 <main+0x4a0>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
cmp    $0x1467,%eax
jb     1733 <main+0x573>
lea    0x8f8(%rip),%rdi
call   1060 <printf@plt>
jmp    1746 <main+0x586>
cmp    $0x13ff,%eax
ja     174a <main+0x58a>
lea    0x9ae(%rip),%rdi
call   1030 <puts@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x60(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   10c0 <RAND_pseudo_bytes@plt>
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%r15
mov    $0x80,%esi
mov    %r15,%rdx
call   1050 <AES_set_encrypt_key@plt>
lea    -0x44(%rbp),%r14
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    0x2845(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%r13
mov    %r13,%rsi
mov    $0x80,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %r12,%r9
push   %rax
call   10e0 <AES_bi_ige_encrypt@plt>
add    $0x10,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    0x27fe(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
lea    -0x5070(%rbp),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %r12,%r9
push   %rax
call   10e0 <AES_bi_ige_encrypt@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    -0x2870(%rbp),%rsi
mov    $0x80,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1871 <main+0x6b1>
lea    0x930(%rip),%rdi
call   1030 <puts@plt>
mov    0x278f(%rip),%rbx
mov    (%rbx),%edi
lea    0x7ce(%rip),%rsi
lea    -0x2870(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
mov    (%rbx),%edi
lea    0x7be(%rip),%rsi
lea    -0x5070(%rbp),%rdx
mov    $0x80,%ecx
call   10b0 <hexdump@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rbx
mov    $0x80,%esi
mov    %rbx,%rdx
call   1050 <AES_set_encrypt_key@plt>
lea    -0x60(%rbp),%r13
lea    -0x44(%rbp),%r15
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    0x272b(%rip),%rax
mov    (%rax),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%r14
mov    %r14,%rsi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
addb   $0x1,-0x6470(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    0x26e8(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rsi
mov    %r14,%rdi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
pxor   %xmm0,%xmm0
mov    $0xc,%eax
pxor   %xmm1,%xmm1
movdqa 0x6d6(%rip),%xmm5
nopw   0x0(%rax,%rax,1)
movdqa -0x507c(%rbp,%rax,1),%xmm3
ff ff
movd   -0x5078(%rbp,%rax,1),%xmm4
ff ff
movd   -0x2878(%rbp,%rax,1),%xmm2
ff ff
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pcmpeqb -0x287c(%rbp,%rax,1),%xmm3
ff ff
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movq   -0x5074(%rbp,%rax,1),%xmm1
ff ff
movd   -0x5070(%rbp,%rax,1),%xmm4
ff ff
movq   -0x2874(%rbp,%rax,1),%xmm0
ff ff
pcmpeqb %xmm1,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   -0x2870(%rbp,%rax,1),%xmm1
ff ff
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rax
cmp    $0x280c,%rax
jne    1930 <main+0x770>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
cmp    $0x67,%eax
jb     1a03 <main+0x843>
lea    0x651(%rip),%rdi
call   1060 <printf@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rbx
mov    $0x80,%esi
mov    %rbx,%rdx
call   1050 <AES_set_encrypt_key@plt>
lea    -0x60(%rbp),%r13
lea    -0x44(%rbp),%r15
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    0x2599(%rip),%rax
mov    (%rax),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%r14
mov    %r14,%rsi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
addb   $0x1,-0x5071(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    0x2556(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rsi
mov    %r14,%rdi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
pxor   %xmm0,%xmm0
mov    $0xc,%eax
pxor   %xmm1,%xmm1
movdqa 0x544(%rip),%xmm5
nopl   0x0(%rax)
movdqa -0x507c(%rbp,%rax,1),%xmm3
ff ff
movd   -0x5078(%rbp,%rax,1),%xmm4
ff ff
movd   -0x2878(%rbp,%rax,1),%xmm2
ff ff
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pcmpeqb -0x287c(%rbp,%rax,1),%xmm3
ff ff
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movq   -0x5074(%rbp,%rax,1),%xmm1
ff ff
movd   -0x5070(%rbp,%rax,1),%xmm4
ff ff
movq   -0x2874(%rbp,%rax,1),%xmm0
ff ff
pcmpeqb %xmm1,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   -0x2870(%rbp,%rax,1),%xmm1
ff ff
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rax
cmp    $0x280c,%rax
jne    1ac0 <main+0x900>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
cmp    $0x67,%eax
jb     1b93 <main+0x9d3>
lea    0x4f5(%rip),%rdi
call   1060 <printf@plt>
addl   $0x1,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rbx
mov    $0x80,%esi
mov    %rbx,%rdx
call   1050 <AES_set_encrypt_key@plt>
lea    -0x60(%rbp),%r13
lea    -0x44(%rbp),%r15
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   1050 <AES_set_encrypt_key@plt>
mov    0x2409(%rip),%rax
mov    (%rax),%r9d
lea    -0x2870(%rbp),%rdi
lea    -0x7870(%rbp),%r14
mov    %r14,%rsi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
addb   $0x1,-0x7870(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    %r13,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   10d0 <AES_set_decrypt_key@plt>
mov    0x23c6(%rip),%rax
mov    (%rax),%r9d
lea    -0x5070(%rbp),%rsi
mov    %r14,%rdi
mov    $0x2800,%edx
mov    %rbx,%rcx
mov    %r12,%r8
call   1090 <AES_ige_encrypt@plt>
pxor   %xmm0,%xmm0
mov    $0xc,%eax
pxor   %xmm1,%xmm1
movdqa 0x3b4(%rip),%xmm5
nopl   0x0(%rax)
movdqa -0x507c(%rbp,%rax,1),%xmm3
ff ff
movd   -0x5078(%rbp,%rax,1),%xmm4
ff ff
movd   -0x2878(%rbp,%rax,1),%xmm2
ff ff
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pcmpeqb -0x287c(%rbp,%rax,1),%xmm3
ff ff
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movq   -0x5074(%rbp,%rax,1),%xmm1
ff ff
movd   -0x5070(%rbp,%rax,1),%xmm4
ff ff
movq   -0x2874(%rbp,%rax,1),%xmm0
ff ff
pcmpeqb %xmm1,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   -0x2870(%rbp,%rax,1),%xmm1
ff ff
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rax
cmp    $0x280c,%rax
jne    1c50 <main+0xa90>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
cmp    $0x67,%eax
mov    -0x2c(%rbp),%ebx
jb     1d25 <main+0xb65>
lea    0x39a(%rip),%rdi
call   1060 <printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <run_test_vectors@plt>
add    %ebx,%eax
mov    -0x68(%rbp),%rsp
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
@AES_ENCRYPT = global i32 0
@AES_DECRYPT = global i32 0
@.str = [31 x i8] c"Encrypt+decrypt doesn't match\0A\00"
@stdout = global i32 0
@.str.1 = [10 x i8] c"Plaintext\00"
@.str.2 = [10 x i8] c"Checktext\00"
@.str.3 = [39 x i8] c"Chained encrypt+decrypt doesn't match\0A\00"
@.str.4 = [47 x i8] c"Chained encrypt+chained decrypt doesn't match\0A\00"
@.str.5 = [39 x i8] c"More than 51%% matches after garbling\0A\00"
@.str.6 = [27 x i8] c"Garble extends backwards!\0A\00"
@.str.7 = [52 x i8] c"More than 1%% matches after bidirectional garbling\0A\00"
@.str.8 = [56 x i8] c"More than 1%% matches after bidirectional garbling (2)\0A\00"
@.str.9 = [56 x i8] c"More than 1%% matches after bidirectional garbling (3)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [10240 x i8]
%11 = alloca [10240 x i8]
%12 = alloca [10240 x i8]
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* @AES_BLOCK_SIZE
%20 = mul nsw i32 %19, 4
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %13
%23 = alloca i8, i64 %21
store i64 %21, i64* %14
%24 = load i32, i32* @AES_BLOCK_SIZE
%25 = mul nsw i32 %24, 4
%26 = zext i32 %25 to i64
%27 = alloca i8, i64 %26
store i64 %26, i64* %15
store i32 0, i32* %16
%28 = call i32 @assert(i32 1)
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%30 = call i32 @RAND_pseudo_bytes(i8* %29, i32 16)
%31 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%32 = call i32 @RAND_pseudo_bytes(i8* %31, i32 10240)
%33 = trunc i64 %21 to i32
%34 = call i32 @RAND_pseudo_bytes(i8* %23, i32 %33)
%35 = trunc i64 %26 to i32
%36 = call i32 @memcpy(i8* %27, i8* %23, i32 %35)
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%38 = call i32 @AES_set_encrypt_key(i8* %37, i32 128, i32* %8)
%39 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%40 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%41 = load i32, i32* @AES_ENCRYPT
%42 = call i32 @AES_ige_encrypt(i8* %39, i8* %40, i32 128, i32* %8, i8* %23, i32 %41)
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%44 = call i32 @AES_set_decrypt_key(i8* %43, i32 128, i32* %8)
%45 = trunc i64 %21 to i32
%46 = call i32 @memcpy(i8* %23, i8* %27, i32 %45)
%47 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%48 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%49 = load i32, i32* @AES_DECRYPT
%50 = call i32 @AES_ige_encrypt(i8* %47, i8* %48, i32 128, i32* %8, i8* %23, i32 %49)
%51 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%52 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%53 = call i64 @memcmp(i8* %51, i8* %52, i32 128)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %65
55: ; preds = %2
%56 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%57 = load i32, i32* @stdout
%58 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%59 = call i32 @hexdump(i32 %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %58, i32 128)
%60 = load i32, i32* @stdout
%61 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%62 = call i32 @hexdump(i32 %60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %61, i32 128)
%63 = load i32, i32* %16
%64 = add nsw i32 %63, 1
store i32 %64, i32* %16
br label %65
65: ; preds = %55, %2
%66 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%67 = call i32 @AES_set_encrypt_key(i8* %66, i32 128, i32* %8)
%68 = trunc i64 %21 to i32
%69 = call i32 @memcpy(i8* %23, i8* %27, i32 %68)
%70 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%71 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%72 = load i32, i32* @AES_ENCRYPT
%73 = call i32 @AES_ige_encrypt(i8* %70, i8* %71, i32 64, i32* %8, i8* %23, i32 %72)
%74 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%75 = getelementptr inbounds i8, i8* %74, i64 64
%76 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%77 = getelementptr inbounds i8, i8* %76, i64 64
%78 = load i32, i32* @AES_ENCRYPT
%79 = call i32 @AES_ige_encrypt(i8* %75, i8* %77, i32 64, i32* %8, i8* %23, i32 %78)
%80 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%81 = call i32 @AES_set_decrypt_key(i8* %80, i32 128, i32* %8)
%82 = trunc i64 %21 to i32
%83 = call i32 @memcpy(i8* %23, i8* %27, i32 %82)
%84 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%85 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%86 = load i32, i32* @AES_DECRYPT
%87 = call i32 @AES_ige_encrypt(i8* %84, i8* %85, i32 128, i32* %8, i8* %23, i32 %86)
%88 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%89 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%90 = call i64 @memcmp(i8* %88, i8* %89, i32 128)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %102
92: ; preds = %65
%93 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%94 = load i32, i32* @stdout
%95 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%96 = call i32 @hexdump(i32 %94, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %95, i32 128)
%97 = load i32, i32* @stdout
%98 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%99 = call i32 @hexdump(i32 %97, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %98, i32 128)
%100 = load i32, i32* %16
%101 = add nsw i32 %100, 1
store i32 %101, i32* %16
br label %102
102: ; preds = %92, %65
%103 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%104 = call i32 @AES_set_encrypt_key(i8* %103, i32 128, i32* %8)
%105 = trunc i64 %21 to i32
%106 = call i32 @memcpy(i8* %23, i8* %27, i32 %105)
%107 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%108 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%109 = load i32, i32* @AES_ENCRYPT
%110 = call i32 @AES_ige_encrypt(i8* %107, i8* %108, i32 64, i32* %8, i8* %23, i32 %109)
%111 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%112 = getelementptr inbounds i8, i8* %111, i64 64
%113 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%114 = getelementptr inbounds i8, i8* %113, i64 64
%115 = load i32, i32* @AES_ENCRYPT
%116 = call i32 @AES_ige_encrypt(i8* %112, i8* %114, i32 64, i32* %8, i8* %23, i32 %115)
%117 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%118 = call i32 @AES_set_decrypt_key(i8* %117, i32 128, i32* %8)
%119 = trunc i64 %21 to i32
%120 = call i32 @memcpy(i8* %23, i8* %27, i32 %119)
%121 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%122 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%123 = load i32, i32* @AES_DECRYPT
%124 = call i32 @AES_ige_encrypt(i8* %121, i8* %122, i32 64, i32* %8, i8* %23, i32 %123)
%125 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%126 = getelementptr inbounds i8, i8* %125, i64 64
%127 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%128 = getelementptr inbounds i8, i8* %127, i64 64
%129 = load i32, i32* @AES_DECRYPT
%130 = call i32 @AES_ige_encrypt(i8* %126, i8* %128, i32 64, i32* %8, i8* %23, i32 %129)
%131 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%132 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%133 = call i64 @memcmp(i8* %131, i8* %132, i32 128)
%134 = icmp ne i64 %133, 0
br i1 %134, label %135, label %145
135: ; preds = %102
%136 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%137 = load i32, i32* @stdout
%138 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%139 = call i32 @hexdump(i32 %137, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %138, i32 128)
%140 = load i32, i32* @stdout
%141 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%142 = call i32 @hexdump(i32 %140, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %141, i32 128)
%143 = load i32, i32* %16
%144 = add nsw i32 %143, 1
store i32 %144, i32* %16
br label %145
145: ; preds = %135, %102
%146 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%147 = call i32 @AES_set_encrypt_key(i8* %146, i32 128, i32* %8)
%148 = trunc i64 %21 to i32
%149 = call i32 @memcpy(i8* %23, i8* %27, i32 %148)
%150 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%151 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%152 = load i32, i32* @AES_ENCRYPT
%153 = call i32 @AES_ige_encrypt(i8* %150, i8* %151, i32 10240, i32* %8, i8* %23, i32 %152)
%154 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 5120
%155 = load i8, i8* %154
%156 = add i8 %155, 1
store i8 %156, i8* %154
%157 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%158 = call i32 @AES_set_decrypt_key(i8* %157, i32 128, i32* %8)
%159 = trunc i64 %21 to i32
%160 = call i32 @memcpy(i8* %23, i8* %27, i32 %159)
%161 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%162 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%163 = load i32, i32* @AES_DECRYPT
%164 = call i32 @AES_ige_encrypt(i8* %161, i8* %162, i32 10240, i32* %8, i8* %23, i32 %163)
store i32 0, i32* %18
store i32 0, i32* %17
br label %165
165: ; preds = %185, %145
%166 = load i32, i32* %17
%167 = zext i32 %166 to i64
%168 = icmp ult i64 %167, 10240
br i1 %168, label %169, label %188
169: ; preds = %165
%170 = load i32, i32* %17
%171 = zext i32 %170 to i64
%172 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 %171
%173 = load i8, i8* %172
%174 = zext i8 %173 to i32
%175 = load i32, i32* %17
%176 = zext i32 %175 to i64
%177 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = icmp eq i32 %174, %179
br i1 %180, label %181, label %184
181: ; preds = %169
%182 = load i32, i32* %18
%183 = add i32 %182, 1
store i32 %183, i32* %18
br label %184
184: ; preds = %181, %169
br label %185
185: ; preds = %184
%186 = load i32, i32* %17
%187 = add i32 %186, 1
store i32 %187, i32* %17
br label %165
188: ; preds = %165
%189 = load i32, i32* %18
%190 = zext i32 %189 to i64
%191 = icmp ugt i64 %190, 5222
br i1 %191, label %192, label %196
192: ; preds = %188
%193 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%194 = load i32, i32* %16
%195 = add nsw i32 %194, 1
store i32 %195, i32* %16
br label %196
196: ; preds = %192, %188
%197 = load i32, i32* %18
%198 = zext i32 %197 to i64
%199 = icmp ult i64 %198, 5120
br i1 %199, label %200, label %204
200: ; preds = %196
%201 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%202 = load i32, i32* %16
%203 = add nsw i32 %202, 1
store i32 %203, i32* %16
br label %204
204: ; preds = %200, %196
%205 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%206 = call i32 @RAND_pseudo_bytes(i8* %205, i32 16)
%207 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%208 = call i32 @AES_set_encrypt_key(i8* %207, i32 128, i32* %8)
%209 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%210 = call i32 @AES_set_encrypt_key(i8* %209, i32 128, i32* %9)
%211 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%212 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%213 = load i32, i32* @AES_ENCRYPT
%214 = call i32 @AES_bi_ige_encrypt(i8* %211, i8* %212, i32 128, i32* %8, i32* %9, i8* %23, i32 %213)
%215 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%216 = call i32 @AES_set_decrypt_key(i8* %215, i32 128, i32* %8)
%217 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%218 = call i32 @AES_set_decrypt_key(i8* %217, i32 128, i32* %9)
%219 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%220 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%221 = load i32, i32* @AES_DECRYPT
%222 = call i32 @AES_bi_ige_encrypt(i8* %219, i8* %220, i32 128, i32* %8, i32* %9, i8* %23, i32 %221)
%223 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%224 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%225 = call i64 @memcmp(i8* %223, i8* %224, i32 128)
%226 = icmp ne i64 %225, 0
br i1 %226, label %227, label %237
227: ; preds = %204
%228 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%229 = load i32, i32* @stdout
%230 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%231 = call i32 @hexdump(i32 %229, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %230, i32 128)
%232 = load i32, i32* @stdout
%233 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%234 = call i32 @hexdump(i32 %232, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %233, i32 128)
%235 = load i32, i32* %16
%236 = add nsw i32 %235, 1
store i32 %236, i32* %16
br label %237
237: ; preds = %227, %204
%238 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%239 = call i32 @AES_set_encrypt_key(i8* %238, i32 128, i32* %8)
%240 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%241 = call i32 @AES_set_encrypt_key(i8* %240, i32 128, i32* %9)
%242 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%243 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%244 = load i32, i32* @AES_ENCRYPT
%245 = call i32 @AES_ige_encrypt(i8* %242, i8* %243, i32 10240, i32* %8, i8* %23, i32 %244)
%246 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 5120
%247 = load i8, i8* %246
%248 = add i8 %247, 1
store i8 %248, i8* %246
%249 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%250 = call i32 @AES_set_decrypt_key(i8* %249, i32 128, i32* %8)
%251 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%252 = call i32 @AES_set_decrypt_key(i8* %251, i32 128, i32* %9)
%253 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%254 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%255 = load i32, i32* @AES_DECRYPT
%256 = call i32 @AES_ige_encrypt(i8* %253, i8* %254, i32 10240, i32* %8, i8* %23, i32 %255)
store i32 0, i32* %18
store i32 0, i32* %17
br label %257
257: ; preds = %277, %237
%258 = load i32, i32* %17
%259 = zext i32 %258 to i64
%260 = icmp ult i64 %259, 10240
br i1 %260, label %261, label %280
261: ; preds = %257
%262 = load i32, i32* %17
%263 = zext i32 %262 to i64
%264 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 %263
%265 = load i8, i8* %264
%266 = zext i8 %265 to i32
%267 = load i32, i32* %17
%268 = zext i32 %267 to i64
%269 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 %268
%270 = load i8, i8* %269
%271 = zext i8 %270 to i32
%272 = icmp eq i32 %266, %271
br i1 %272, label %273, label %276
273: ; preds = %261
%274 = load i32, i32* %18
%275 = add i32 %274, 1
store i32 %275, i32* %18
br label %276
276: ; preds = %273, %261
br label %277
277: ; preds = %276
%278 = load i32, i32* %17
%279 = add i32 %278, 1
store i32 %279, i32* %17
br label %257
280: ; preds = %257
%281 = load i32, i32* %18
%282 = zext i32 %281 to i64
%283 = icmp ugt i64 %282, 102
br i1 %283, label %284, label %288
284: ; preds = %280
%285 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%286 = load i32, i32* %16
%287 = add nsw i32 %286, 1
store i32 %287, i32* %16
br label %288
288: ; preds = %284, %280
%289 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%290 = call i32 @AES_set_encrypt_key(i8* %289, i32 128, i32* %8)
%291 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%292 = call i32 @AES_set_encrypt_key(i8* %291, i32 128, i32* %9)
%293 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%294 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%295 = load i32, i32* @AES_ENCRYPT
%296 = call i32 @AES_ige_encrypt(i8* %293, i8* %294, i32 10240, i32* %8, i8* %23, i32 %295)
%297 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 10239
%298 = load i8, i8* %297
%299 = add i8 %298, 1
store i8 %299, i8* %297
%300 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%301 = call i32 @AES_set_decrypt_key(i8* %300, i32 128, i32* %8)
%302 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%303 = call i32 @AES_set_decrypt_key(i8* %302, i32 128, i32* %9)
%304 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%305 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%306 = load i32, i32* @AES_DECRYPT
%307 = call i32 @AES_ige_encrypt(i8* %304, i8* %305, i32 10240, i32* %8, i8* %23, i32 %306)
store i32 0, i32* %18
store i32 0, i32* %17
br label %308
308: ; preds = %328, %288
%309 = load i32, i32* %17
%310 = zext i32 %309 to i64
%311 = icmp ult i64 %310, 10240
br i1 %311, label %312, label %331
312: ; preds = %308
%313 = load i32, i32* %17
%314 = zext i32 %313 to i64
%315 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 %314
%316 = load i8, i8* %315
%317 = zext i8 %316 to i32
%318 = load i32, i32* %17
%319 = zext i32 %318 to i64
%320 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 %319
%321 = load i8, i8* %320
%322 = zext i8 %321 to i32
%323 = icmp eq i32 %317, %322
br i1 %323, label %324, label %327
324: ; preds = %312
%325 = load i32, i32* %18
%326 = add i32 %325, 1
store i32 %326, i32* %18
br label %327
327: ; preds = %324, %312
br label %328
328: ; preds = %327
%329 = load i32, i32* %17
%330 = add i32 %329, 1
store i32 %330, i32* %17
br label %308
331: ; preds = %308
%332 = load i32, i32* %18
%333 = zext i32 %332 to i64
%334 = icmp ugt i64 %333, 102
br i1 %334, label %335, label %339
335: ; preds = %331
%336 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0))
%337 = load i32, i32* %16
%338 = add nsw i32 %337, 1
store i32 %338, i32* %16
br label %339
339: ; preds = %335, %331
%340 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%341 = call i32 @AES_set_encrypt_key(i8* %340, i32 128, i32* %8)
%342 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%343 = call i32 @AES_set_encrypt_key(i8* %342, i32 128, i32* %9)
%344 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 0
%345 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%346 = load i32, i32* @AES_ENCRYPT
%347 = call i32 @AES_ige_encrypt(i8* %344, i8* %345, i32 10240, i32* %8, i8* %23, i32 %346)
%348 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%349 = load i8, i8* %348
%350 = add i8 %349, 1
store i8 %350, i8* %348
%351 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%352 = call i32 @AES_set_decrypt_key(i8* %351, i32 128, i32* %8)
%353 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%354 = call i32 @AES_set_decrypt_key(i8* %353, i32 128, i32* %9)
%355 = getelementptr inbounds [10240 x i8], [10240 x i8]* %11, i64 0, i64 0
%356 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 0
%357 = load i32, i32* @AES_DECRYPT
%358 = call i32 @AES_ige_encrypt(i8* %355, i8* %356, i32 10240, i32* %8, i8* %23, i32 %357)
store i32 0, i32* %18
store i32 0, i32* %17
br label %359
359: ; preds = %379, %339
%360 = load i32, i32* %17
%361 = zext i32 %360 to i64
%362 = icmp ult i64 %361, 10240
br i1 %362, label %363, label %382
363: ; preds = %359
%364 = load i32, i32* %17
%365 = zext i32 %364 to i64
%366 = getelementptr inbounds [10240 x i8], [10240 x i8]* %12, i64 0, i64 %365
%367 = load i8, i8* %366
%368 = zext i8 %367 to i32
%369 = load i32, i32* %17
%370 = zext i32 %369 to i64
%371 = getelementptr inbounds [10240 x i8], [10240 x i8]* %10, i64 0, i64 %370
%372 = load i8, i8* %371
%373 = zext i8 %372 to i32
%374 = icmp eq i32 %368, %373
br i1 %374, label %375, label %378
375: ; preds = %363
%376 = load i32, i32* %18
%377 = add i32 %376, 1
store i32 %377, i32* %18
br label %378
378: ; preds = %375, %363
br label %379
379: ; preds = %378
%380 = load i32, i32* %17
%381 = add i32 %380, 1
store i32 %381, i32* %17
br label %359
382: ; preds = %359
%383 = load i32, i32* %18
%384 = zext i32 %383 to i64
%385 = icmp ugt i64 %384, 102
br i1 %385, label %386, label %390
386: ; preds = %382
%387 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%388 = load i32, i32* %16
%389 = add nsw i32 %388, 1
store i32 %389, i32* %16
br label %390
390: ; preds = %386, %382
%391 = call i64 (...) @run_test_vectors()
%392 = load i32, i32* %16
%393 = sext i32 %392 to i64
%394 = add nsw i64 %393, %391
%395 = trunc i64 %394 to i32
store i32 %395, i32* %16
%396 = load i32, i32* %16
store i32 %396, i32* %3
%397 = load i8*, i8** %13
%398 = load i32, i32* %3
ret i32 %398
}

LLVM IR (-O2):
@AES_BLOCK_SIZE = global i32 0
@AES_ENCRYPT = global i32 0
@AES_DECRYPT = global i32 0
@stdout = global i32 0
@.str.1 = [10 x i8] c"Plaintext\00"
@.str.2 = [10 x i8] c"Checktext\00"
@.str.5 = [39 x i8] c"More than 51%% matches after garbling\0A\00"
@.str.7 = [52 x i8] c"More than 1%% matches after bidirectional garbling\0A\00"
@.str.8 = [56 x i8] c"More than 1%% matches after bidirectional garbling (2)\0A\00"
@.str.9 = [56 x i8] c"More than 1%% matches after bidirectional garbling (3)\0A\00"
@str.10 = [26 x i8] c"Garble extends backwards!\00"
@str.11 = [46 x i8] c"Chained encrypt+chained decrypt doesn't match\00"
@str.12 = [38 x i8] c"Chained encrypt+decrypt doesn't match\00"
@str.13 = [30 x i8] c"Encrypt+decrypt doesn't match\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [10240 x i8]
%8 = alloca [10240 x i8]
%9 = alloca [10240 x i8]
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [10240 x i8], [10240 x i8]* %8, i64 0, i64 0
%16 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 0
%17 = load i32, i32* @AES_BLOCK_SIZE
%18 = shl nsw i32 %17, 2
%19 = zext i32 %18 to i64
%20 = tail call i8* @llvm.stacksave()
%21 = alloca i8, i64 %19
%22 = load i32, i32* @AES_BLOCK_SIZE
%23 = shl nsw i32 %22, 2
%24 = zext i32 %23 to i64
%25 = alloca i8, i64 %24
%26 = tail call i32 @assert(i32 1)
%27 = call i32 @RAND_pseudo_bytes(i8* %10, i32 16)
%28 = call i32 @RAND_pseudo_bytes(i8* %14, i32 10240)
%29 = call i32 @RAND_pseudo_bytes(i8* %21, i32 %18)
%30 = call i32 @memcpy(i8* %25, i8* %21, i32 %23)
%31 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%32 = load i32, i32* @AES_ENCRYPT
%33 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 128, i32* %5, i8* %21, i32 %32)
%34 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%35 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%36 = load i32, i32* @AES_DECRYPT
%37 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 128, i32* %5, i8* %21, i32 %36)
%38 = call i64 @memcmp(i8* %16, i8* %14, i32 128)
%39 = icmp eq i64 %38, 0
br i1 %39, label %46, label %40
40: ; preds = %2
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.13, i64 0, i64 0))
%42 = load i32, i32* @stdout
%43 = call i32 @hexdump(i32 %42, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 128)
%44 = load i32, i32* @stdout
%45 = call i32 @hexdump(i32 %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32 128)
br label %46
46: ; preds = %40, %2
%47 = phi i32 [ 1, %40 ], [ 0, %2 ]
%48 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%49 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%50 = load i32, i32* @AES_ENCRYPT
%51 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 64, i32* %5, i8* %21, i32 %50)
%52 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 64
%53 = getelementptr inbounds [10240 x i8], [10240 x i8]* %8, i64 0, i64 64
%54 = load i32, i32* @AES_ENCRYPT
%55 = call i32 @AES_ige_encrypt(i8* %52, i8* %53, i32 64, i32* %5, i8* %21, i32 %54)
%56 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%57 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%58 = load i32, i32* @AES_DECRYPT
%59 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 128, i32* %5, i8* %21, i32 %58)
%60 = call i64 @memcmp(i8* %16, i8* %14, i32 128)
%61 = icmp eq i64 %60, 0
br i1 %61, label %69, label %62
62: ; preds = %46
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.12, i64 0, i64 0))
%64 = load i32, i32* @stdout
%65 = call i32 @hexdump(i32 %64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 128)
%66 = load i32, i32* @stdout
%67 = call i32 @hexdump(i32 %66, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32 128)
%68 = add nuw nsw i32 %47, 1
br label %69
69: ; preds = %62, %46
%70 = phi i32 [ %68, %62 ], [ %47, %46 ]
%71 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%72 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%73 = load i32, i32* @AES_ENCRYPT
%74 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 64, i32* %5, i8* %21, i32 %73)
%75 = load i32, i32* @AES_ENCRYPT
%76 = call i32 @AES_ige_encrypt(i8* %52, i8* %53, i32 64, i32* %5, i8* %21, i32 %75)
%77 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%78 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%79 = load i32, i32* @AES_DECRYPT
%80 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 64, i32* %5, i8* %21, i32 %79)
%81 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 64
%82 = load i32, i32* @AES_DECRYPT
%83 = call i32 @AES_ige_encrypt(i8* %53, i8* %81, i32 64, i32* %5, i8* %21, i32 %82)
%84 = call i64 @memcmp(i8* %16, i8* %14, i32 128)
%85 = icmp eq i64 %84, 0
br i1 %85, label %93, label %86
86: ; preds = %69
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.11, i64 0, i64 0))
%88 = load i32, i32* @stdout
%89 = call i32 @hexdump(i32 %88, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 128)
%90 = load i32, i32* @stdout
%91 = call i32 @hexdump(i32 %90, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32 128)
%92 = add nuw nsw i32 %70, 1
br label %93
93: ; preds = %86, %69
%94 = phi i32 [ %92, %86 ], [ %70, %69 ]
%95 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%96 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%97 = load i32, i32* @AES_ENCRYPT
%98 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 10240, i32* %5, i8* %21, i32 %97)
%99 = getelementptr inbounds [10240 x i8], [10240 x i8]* %8, i64 0, i64 5120
%100 = load i8, i8* %99
%101 = add i8 %100, 1
store i8 %101, i8* %99
%102 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%103 = call i32 @memcpy(i8* %21, i8* %25, i32 %18)
%104 = load i32, i32* @AES_DECRYPT
%105 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 10240, i32* %5, i8* %21, i32 %104)
br label %106
106: ; preds = %106, %93
%107 = phi i64 [ 0, %93 ], [ %147, %106 ]
%108 = phi <4 x i32> [ zeroinitializer, %93 ], [ %145, %106 ]
%109 = phi <4 x i32> [ zeroinitializer, %93 ], [ %146, %106 ]
%110 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %107
%111 = bitcast i8* %110 to <4 x i8>*
%112 = load <4 x i8>, <4 x i8>* %111
%113 = getelementptr inbounds i8, i8* %110, i64 4
%114 = bitcast i8* %113 to <4 x i8>*
%115 = load <4 x i8>, <4 x i8>* %114
%116 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %107
%117 = bitcast i8* %116 to <4 x i8>*
%118 = load <4 x i8>, <4 x i8>* %117
%119 = getelementptr inbounds i8, i8* %116, i64 4
%120 = bitcast i8* %119 to <4 x i8>*
%121 = load <4 x i8>, <4 x i8>* %120
%122 = icmp eq <4 x i8> %112, %118
%123 = icmp eq <4 x i8> %115, %121
%124 = zext <4 x i1> %122 to <4 x i32>
%125 = zext <4 x i1> %123 to <4 x i32>
%126 = add <4 x i32> %108, %124
%127 = add <4 x i32> %109, %125
%128 = or i64 %107, 8
%129 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %128
%130 = bitcast i8* %129 to <4 x i8>*
%131 = load <4 x i8>, <4 x i8>* %130
%132 = getelementptr inbounds i8, i8* %129, i64 4
%133 = bitcast i8* %132 to <4 x i8>*
%134 = load <4 x i8>, <4 x i8>* %133
%135 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %128
%136 = bitcast i8* %135 to <4 x i8>*
%137 = load <4 x i8>, <4 x i8>* %136
%138 = getelementptr inbounds i8, i8* %135, i64 4
%139 = bitcast i8* %138 to <4 x i8>*
%140 = load <4 x i8>, <4 x i8>* %139
%141 = icmp eq <4 x i8> %131, %137
%142 = icmp eq <4 x i8> %134, %140
%143 = zext <4 x i1> %141 to <4 x i32>
%144 = zext <4 x i1> %142 to <4 x i32>
%145 = add <4 x i32> %126, %143
%146 = add <4 x i32> %127, %144
%147 = add nuw nsw i64 %107, 16
%148 = icmp eq i64 %147, 10240
br i1 %148, label %149, label %106
149: ; preds = %106
%150 = add <4 x i32> %146, %145
%151 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %150)
%152 = icmp ugt i32 %151, 5222
br i1 %152, label %153, label %156
153: ; preds = %149
%154 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%155 = add nsw i32 %94, 1
br label %161
156: ; preds = %149
%157 = icmp ult i32 %151, 5120
br i1 %157, label %158, label %161
158: ; preds = %156
%159 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.10, i64 0, i64 0))
%160 = add nsw i32 %94, 1
br label %161
161: ; preds = %153, %158, %156
%162 = phi i32 [ %160, %158 ], [ %94, %156 ], [ %155, %153 ]
%163 = call i32 @RAND_pseudo_bytes(i8* %11, i32 16)
%164 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%165 = call i32 @AES_set_encrypt_key(i8* %11, i32 128, i32* %6)
%166 = load i32, i32* @AES_ENCRYPT
%167 = call i32 @AES_bi_ige_encrypt(i8* %14, i8* %15, i32 128, i32* %5, i32* %6, i8* %21, i32 %166)
%168 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%169 = call i32 @AES_set_decrypt_key(i8* %11, i32 128, i32* %6)
%170 = load i32, i32* @AES_DECRYPT
%171 = call i32 @AES_bi_ige_encrypt(i8* %15, i8* %16, i32 128, i32* %5, i32* %6, i8* %21, i32 %170)
%172 = call i64 @memcmp(i8* %16, i8* %14, i32 128)
%173 = icmp eq i64 %172, 0
br i1 %173, label %181, label %174
174: ; preds = %161
%175 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.13, i64 0, i64 0))
%176 = load i32, i32* @stdout
%177 = call i32 @hexdump(i32 %176, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 128)
%178 = load i32, i32* @stdout
%179 = call i32 @hexdump(i32 %178, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32 128)
%180 = add nsw i32 %162, 1
br label %181
181: ; preds = %174, %161
%182 = phi i32 [ %180, %174 ], [ %162, %161 ]
%183 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%184 = call i32 @AES_set_encrypt_key(i8* %11, i32 128, i32* %6)
%185 = load i32, i32* @AES_ENCRYPT
%186 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 10240, i32* %5, i8* %21, i32 %185)
%187 = load i8, i8* %99
%188 = add i8 %187, 1
store i8 %188, i8* %99
%189 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%190 = call i32 @AES_set_decrypt_key(i8* %11, i32 128, i32* %6)
%191 = load i32, i32* @AES_DECRYPT
%192 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 10240, i32* %5, i8* %21, i32 %191)
br label %193
193: ; preds = %193, %181
%194 = phi i64 [ 0, %181 ], [ %234, %193 ]
%195 = phi <4 x i32> [ zeroinitializer, %181 ], [ %232, %193 ]
%196 = phi <4 x i32> [ zeroinitializer, %181 ], [ %233, %193 ]
%197 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %194
%198 = bitcast i8* %197 to <4 x i8>*
%199 = load <4 x i8>, <4 x i8>* %198
%200 = getelementptr inbounds i8, i8* %197, i64 4
%201 = bitcast i8* %200 to <4 x i8>*
%202 = load <4 x i8>, <4 x i8>* %201
%203 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %194
%204 = bitcast i8* %203 to <4 x i8>*
%205 = load <4 x i8>, <4 x i8>* %204
%206 = getelementptr inbounds i8, i8* %203, i64 4
%207 = bitcast i8* %206 to <4 x i8>*
%208 = load <4 x i8>, <4 x i8>* %207
%209 = icmp eq <4 x i8> %199, %205
%210 = icmp eq <4 x i8> %202, %208
%211 = zext <4 x i1> %209 to <4 x i32>
%212 = zext <4 x i1> %210 to <4 x i32>
%213 = add <4 x i32> %195, %211
%214 = add <4 x i32> %196, %212
%215 = or i64 %194, 8
%216 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %215
%217 = bitcast i8* %216 to <4 x i8>*
%218 = load <4 x i8>, <4 x i8>* %217
%219 = getelementptr inbounds i8, i8* %216, i64 4
%220 = bitcast i8* %219 to <4 x i8>*
%221 = load <4 x i8>, <4 x i8>* %220
%222 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %215
%223 = bitcast i8* %222 to <4 x i8>*
%224 = load <4 x i8>, <4 x i8>* %223
%225 = getelementptr inbounds i8, i8* %222, i64 4
%226 = bitcast i8* %225 to <4 x i8>*
%227 = load <4 x i8>, <4 x i8>* %226
%228 = icmp eq <4 x i8> %218, %224
%229 = icmp eq <4 x i8> %221, %227
%230 = zext <4 x i1> %228 to <4 x i32>
%231 = zext <4 x i1> %229 to <4 x i32>
%232 = add <4 x i32> %213, %230
%233 = add <4 x i32> %214, %231
%234 = add nuw nsw i64 %194, 16
%235 = icmp eq i64 %234, 10240
br i1 %235, label %236, label %193
236: ; preds = %193
%237 = add <4 x i32> %233, %232
%238 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %237)
%239 = icmp ugt i32 %238, 102
br i1 %239, label %240, label %243
240: ; preds = %236
%241 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%242 = add nsw i32 %182, 1
br label %243
243: ; preds = %240, %236
%244 = phi i32 [ %242, %240 ], [ %182, %236 ]
%245 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%246 = call i32 @AES_set_encrypt_key(i8* %11, i32 128, i32* %6)
%247 = load i32, i32* @AES_ENCRYPT
%248 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 10240, i32* %5, i8* %21, i32 %247)
%249 = getelementptr inbounds [10240 x i8], [10240 x i8]* %8, i64 0, i64 10239
%250 = load i8, i8* %249
%251 = add i8 %250, 1
store i8 %251, i8* %249
%252 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%253 = call i32 @AES_set_decrypt_key(i8* %11, i32 128, i32* %6)
%254 = load i32, i32* @AES_DECRYPT
%255 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 10240, i32* %5, i8* %21, i32 %254)
br label %256
256: ; preds = %256, %243
%257 = phi i64 [ 0, %243 ], [ %297, %256 ]
%258 = phi <4 x i32> [ zeroinitializer, %243 ], [ %295, %256 ]
%259 = phi <4 x i32> [ zeroinitializer, %243 ], [ %296, %256 ]
%260 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %257
%261 = bitcast i8* %260 to <4 x i8>*
%262 = load <4 x i8>, <4 x i8>* %261
%263 = getelementptr inbounds i8, i8* %260, i64 4
%264 = bitcast i8* %263 to <4 x i8>*
%265 = load <4 x i8>, <4 x i8>* %264
%266 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %257
%267 = bitcast i8* %266 to <4 x i8>*
%268 = load <4 x i8>, <4 x i8>* %267
%269 = getelementptr inbounds i8, i8* %266, i64 4
%270 = bitcast i8* %269 to <4 x i8>*
%271 = load <4 x i8>, <4 x i8>* %270
%272 = icmp eq <4 x i8> %262, %268
%273 = icmp eq <4 x i8> %265, %271
%274 = zext <4 x i1> %272 to <4 x i32>
%275 = zext <4 x i1> %273 to <4 x i32>
%276 = add <4 x i32> %258, %274
%277 = add <4 x i32> %259, %275
%278 = or i64 %257, 8
%279 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %278
%280 = bitcast i8* %279 to <4 x i8>*
%281 = load <4 x i8>, <4 x i8>* %280
%282 = getelementptr inbounds i8, i8* %279, i64 4
%283 = bitcast i8* %282 to <4 x i8>*
%284 = load <4 x i8>, <4 x i8>* %283
%285 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %278
%286 = bitcast i8* %285 to <4 x i8>*
%287 = load <4 x i8>, <4 x i8>* %286
%288 = getelementptr inbounds i8, i8* %285, i64 4
%289 = bitcast i8* %288 to <4 x i8>*
%290 = load <4 x i8>, <4 x i8>* %289
%291 = icmp eq <4 x i8> %281, %287
%292 = icmp eq <4 x i8> %284, %290
%293 = zext <4 x i1> %291 to <4 x i32>
%294 = zext <4 x i1> %292 to <4 x i32>
%295 = add <4 x i32> %276, %293
%296 = add <4 x i32> %277, %294
%297 = add nuw nsw i64 %257, 16
%298 = icmp eq i64 %297, 10240
br i1 %298, label %299, label %256
299: ; preds = %256
%300 = add <4 x i32> %296, %295
%301 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %300)
%302 = icmp ugt i32 %301, 102
br i1 %302, label %303, label %306
303: ; preds = %299
%304 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0))
%305 = add nsw i32 %244, 1
br label %306
306: ; preds = %303, %299
%307 = phi i32 [ %305, %303 ], [ %244, %299 ]
%308 = call i32 @AES_set_encrypt_key(i8* %10, i32 128, i32* %5)
%309 = call i32 @AES_set_encrypt_key(i8* %11, i32 128, i32* %6)
%310 = load i32, i32* @AES_ENCRYPT
%311 = call i32 @AES_ige_encrypt(i8* %14, i8* %15, i32 10240, i32* %5, i8* %21, i32 %310)
%312 = load i8, i8* %15
%313 = add i8 %312, 1
store i8 %313, i8* %15
%314 = call i32 @AES_set_decrypt_key(i8* %10, i32 128, i32* %5)
%315 = call i32 @AES_set_decrypt_key(i8* %11, i32 128, i32* %6)
%316 = load i32, i32* @AES_DECRYPT
%317 = call i32 @AES_ige_encrypt(i8* %15, i8* %16, i32 10240, i32* %5, i8* %21, i32 %316)
br label %318
318: ; preds = %318, %306
%319 = phi i64 [ 0, %306 ], [ %359, %318 ]
%320 = phi <4 x i32> [ zeroinitializer, %306 ], [ %357, %318 ]
%321 = phi <4 x i32> [ zeroinitializer, %306 ], [ %358, %318 ]
%322 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %319
%323 = bitcast i8* %322 to <4 x i8>*
%324 = load <4 x i8>, <4 x i8>* %323
%325 = getelementptr inbounds i8, i8* %322, i64 4
%326 = bitcast i8* %325 to <4 x i8>*
%327 = load <4 x i8>, <4 x i8>* %326
%328 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %319
%329 = bitcast i8* %328 to <4 x i8>*
%330 = load <4 x i8>, <4 x i8>* %329
%331 = getelementptr inbounds i8, i8* %328, i64 4
%332 = bitcast i8* %331 to <4 x i8>*
%333 = load <4 x i8>, <4 x i8>* %332
%334 = icmp eq <4 x i8> %324, %330
%335 = icmp eq <4 x i8> %327, %333
%336 = zext <4 x i1> %334 to <4 x i32>
%337 = zext <4 x i1> %335 to <4 x i32>
%338 = add <4 x i32> %320, %336
%339 = add <4 x i32> %321, %337
%340 = or i64 %319, 8
%341 = getelementptr inbounds [10240 x i8], [10240 x i8]* %9, i64 0, i64 %340
%342 = bitcast i8* %341 to <4 x i8>*
%343 = load <4 x i8>, <4 x i8>* %342
%344 = getelementptr inbounds i8, i8* %341, i64 4
%345 = bitcast i8* %344 to <4 x i8>*
%346 = load <4 x i8>, <4 x i8>* %345
%347 = getelementptr inbounds [10240 x i8], [10240 x i8]* %7, i64 0, i64 %340
%348 = bitcast i8* %347 to <4 x i8>*
%349 = load <4 x i8>, <4 x i8>* %348
%350 = getelementptr inbounds i8, i8* %347, i64 4
%351 = bitcast i8* %350 to <4 x i8>*
%352 = load <4 x i8>, <4 x i8>* %351
%353 = icmp eq <4 x i8> %343, %349
%354 = icmp eq <4 x i8> %346, %352
%355 = zext <4 x i1> %353 to <4 x i32>
%356 = zext <4 x i1> %354 to <4 x i32>
%357 = add <4 x i32> %338, %355
%358 = add <4 x i32> %339, %356
%359 = add nuw nsw i64 %319, 16
%360 = icmp eq i64 %359, 10240
br i1 %360, label %361, label %318
361: ; preds = %318
%362 = add <4 x i32> %358, %357
%363 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %362)
%364 = icmp ugt i32 %363, 102
br i1 %364, label %365, label %368
365: ; preds = %361
%366 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%367 = add nsw i32 %307, 1
br label %368
368: ; preds = %365, %361
%369 = phi i32 [ %367, %365 ], [ %307, %361 ]
%370 = call i64 (...) @run_test_vectors()
%371 = trunc i64 %370 to i32
%372 = add i32 %369, %371
ret i32 %372
}