#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ ale_decrypt(unsigned char *, unsigned char *);
int /*<<< orphan*/ ale_encrypt(unsigned char *, unsigned char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ invpbox(unsigned char *);
int /*<<< orphan*/ invsboxa(unsigned char *);
int /*<<< orphan*/ invsboxb(unsigned char *);
unsigned char *malloc(int);
int /*<<< orphan*/ mbia_decrypt(unsigned char *, unsigned char *,
                                unsigned char *);
int /*<<< orphan*/ mbia_encrypt(unsigned char *, unsigned char *,
                                unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, ...);
int /*<<< orphan*/ pbox(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int /*<<< orphan*/ sboxa(unsigned char *);
int /*<<< orphan*/ sboxb(unsigned char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
scalar_t__ strcmp(char const *, char const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  unsigned char *longblock, *testblock, *origblock, *key, *wpcn;
  char testchar, origchar;
  int i, j, fail;
  testblock = malloc(sizeof(unsigned char) * 9);
  testblock[8] = 0;
  origblock = malloc(sizeof(unsigned char) * 9);
  origblock[8] = 0;
  longblock = malloc(sizeof(unsigned char) * 17);
  longblock[16] = 0;
  key = malloc(sizeof(unsigned char) * 33);
  key[32] = 0;
  wpcn = malloc(sizeof(unsigned char) * 4);
  wpcn[4] = 0;
  fail = 0;
  printf("Test phase I - Permutation (pbox.h)\n");
  memcpy(testblock, (unsigned char *)"12345678", 8);
  printf(" Permutation input:   %s\n", testblock);
  pbox(testblock);
  printf(" Permutation output:  %s\n", testblock);
  pbox(testblock);
  printf(" Another permutation: %s\n", testblock);
  invpbox(testblock);
  printf(" And back:            %s\n", testblock);
  invpbox(testblock);
  printf(" And back again:      %s\n", testblock);
  srand(time(NULL));
  for (i = 0; i < 1000; ++i) {
    for (j = 0; j < 8; ++j)
      testblock[j] = (unsigned char)rand() % 255 + 1;
    memcpy(origblock, testblock, 8);
    pbox(testblock);
    pbox(testblock);
    invpbox(testblock);
    invpbox(testblock);
    if (strcmp((const char *)testblock, (const char *)origblock))
      fail = 1;
  }
  if (fail) {
    printf(" (--) Failed permutation random char test.\n\n");
    exit(1);
  } else
    printf(" (++) Successful permutation random char test.\n\n");
  printf("Test phase II - S-Box Alpha (sbox_alpha.h)\n");
  testchar = '@';
  printf(" S-Box input:          %c\n", testchar);
  sboxa((unsigned char *)&testchar);
  printf(" S-Box output:         %c\n", testchar);
  sboxa((unsigned char *)&testchar);
  printf(" Another substitution: %c\n", testchar);
  invsboxa((unsigned char *)&testchar);
  printf(" And back:             %c\n", testchar);
  invsboxa((unsigned char *)&testchar);
  printf(" And back again:       %c\n", testchar);
  for (i = 0; i < 256; ++i) {
    testchar = origchar = (unsigned char)i;
    sboxa((unsigned char *)&testchar);
    invsboxa((unsigned char *)&testchar);
    if (origchar != testchar)
      fail = 1;
  }
  if (fail) {
    printf(" (--) Failed test of complete S-Box Alpha.\n\n");
    exit(1);
  } else
    printf(" (++) Successful test of complete S-Box Alpha.\n\n");
  printf("Test phase III - S-Box Bravo (sbox_bravo.h)\n");
  testchar = '@';
  printf(" S-Box input:          %c\n", testchar);
  sboxb((unsigned char *)&testchar);
  printf(" S-Box output:         %c\n", testchar);
  sboxb((unsigned char *)&testchar);
  printf(" Another substitution: %c\n", testchar);
  invsboxb((unsigned char *)&testchar);
  printf(" And back:             %c\n", testchar);
  invsboxb((unsigned char *)&testchar);
  printf(" And back again:       %c\n", testchar);
  for (i = 0; i < 256; ++i) {
    testchar = origchar = (unsigned char)i;
    sboxb((unsigned char *)&testchar);
    invsboxb((unsigned char *)&testchar);
    if (origchar != testchar)
      fail = 1;
  }
  if (fail) {
    printf(" (--) Failed test of complete S-Box Bravo.\n\n");
    exit(1);
  } else
    printf(" (++) Successful test of complete S-Box Bravo.\n\n");
  printf("Test phase IV - ALE\n");
  memcpy(longblock, "0123456789ABCDEF", 16);
  memcpy(key, "00001111222233334444555566667777", 32);
  printf(" ALE input:     %s\n", longblock);
  ale_encrypt(longblock, key);
  printf(" ALE output:    %s\n", longblock);
  ale_decrypt(longblock, key);
  printf(" ALE decrypted: %s\n\n", longblock);
  printf("Test phase V - MBIA\n");
  memcpy(longblock, "0123456789ABCDEF", 16);
  memcpy(key, "00001111222233334444555566667777", 32);
  printf(" MBIA input:     %s\n", longblock);
  memcpy(wpcn, "\0\0\0", 3);
  mbia_encrypt(longblock, key, wpcn);
  printf(" MBIA output:    %s\n", longblock);
  memcpy(wpcn, "\0\0\0", 3);
  mbia_decrypt(longblock, key, wpcn);
  printf(" MBIA decrypted: %s\n\n", longblock);
  printf("Test phase V - ALE/MBIA\n");
  memcpy(longblock, "0123456789ABCDEF", 16);
  printf(" ALE/MBIA input:     %s\n", longblock);
  memcpy(wpcn, "abc", 3);
  memcpy(key, "00001111222233334444555566667777", 32);
  mbia_encrypt(longblock, key, wpcn);
  memcpy(key, "88889999AAAABBBBCCCCDDDDEEEEFFFF", 32);
  ale_encrypt(longblock, key);
  printf(" ALE/MBIA output:    %s\n", longblock);
  memcpy(wpcn, "abc", 3);
  memcpy(key, "88889999AAAABBBBCCCCDDDDEEEEFFFF", 32);
  ale_decrypt(longblock, key);
  memcpy(key, "00001111222233334444555566667777", 32);
  mbia_decrypt(longblock, key, wpcn);
  printf(" ALE/MBIA decrypted: %s\n\n", longblock);
  free(testblock);
  free(origblock);
  free(longblock);
  free(key);
  free(wpcn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    $0x9,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    $0x11,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x10(%rax)
mov    $0x21,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,0x20(%rax)
mov    $0x4,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x0,0x4(%rax)
movl   $0x0,-0x40(%rbp)
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd58(%rip),%rsi
xor    %eax,%eax
mov    $0x8,%edx
call   10c0 <memcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <pbox@plt>
mov    -0x18(%rbp),%rsi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <pbox@plt>
mov    -0x18(%rbp),%rsi
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1120 <invpbox@plt>
mov    -0x18(%rbp),%rsi
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1120 <invpbox@plt>
mov    -0x18(%rbp),%rsi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3e8,-0x38(%rbp)
jge    1423 <main+0x1f3>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x8,-0x3c(%rbp)
jge    13ba <main+0x18a>
mov    $0x0,%al
call   1150 <rand@plt>
movzbl %al,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1382 <main+0x152>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    $0x8,%edx
call   10c0 <memcpy@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <pbox@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <pbox@plt>
mov    -0x18(%rbp),%rdi
call   1120 <invpbox@plt>
mov    -0x18(%rbp),%rdi
call   1120 <invpbox@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1410 <main+0x1e0>
movl   $0x1,-0x40(%rbp)
jmp    1415 <main+0x1e5>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    136e <main+0x13e>
cmpl   $0x0,-0x40(%rbp)
je     1445 <main+0x215>
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x40,-0x31(%rbp)
movsbl -0x31(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1050 <sboxa@plt>
movsbl -0x31(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1050 <sboxa@plt>
movsbl -0x31(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1100 <invsboxa@plt>
movsbl -0x31(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1100 <invsboxa@plt>
movsbl -0x31(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x100,-0x38(%rbp)
jge    153c <main+0x30c>
mov    -0x38(%rbp),%eax
mov    %al,-0x32(%rbp)
mov    %al,-0x31(%rbp)
lea    -0x31(%rbp),%rdi
call   1050 <sboxa@plt>
lea    -0x31(%rbp),%rdi
call   1100 <invsboxa@plt>
movsbl -0x32(%rbp),%eax
movsbl -0x31(%rbp),%ecx
cmp    %ecx,%eax
je     1529 <main+0x2f9>
movl   $0x1,-0x40(%rbp)
jmp    152e <main+0x2fe>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14ea <main+0x2ba>
cmpl   $0x0,-0x40(%rbp)
je     155e <main+0x32e>
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movb   $0x40,-0x31(%rbp)
movsbl -0x31(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1110 <sboxb@plt>
movsbl -0x31(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1110 <sboxb@plt>
movsbl -0x31(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1040 <invsboxb@plt>
movsbl -0x31(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x31(%rbp),%rdi
call   1040 <invsboxb@plt>
movsbl -0x31(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x100,-0x38(%rbp)
jge    1655 <main+0x425>
mov    -0x38(%rbp),%eax
mov    %al,-0x32(%rbp)
mov    %al,-0x31(%rbp)
lea    -0x31(%rbp),%rdi
call   1110 <sboxb@plt>
lea    -0x31(%rbp),%rdi
call   1040 <invsboxb@plt>
movsbl -0x32(%rbp),%eax
movsbl -0x31(%rbp),%ecx
cmp    %ecx,%eax
je     1642 <main+0x412>
movl   $0x1,-0x40(%rbp)
jmp    1647 <main+0x417>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1603 <main+0x3d3>
cmpl   $0x0,-0x40(%rbp)
je     1677 <main+0x447>
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    0xbfb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc1e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xc21(%rip),%rsi
xor    %eax,%eax
mov    $0x10,%edx
call   10c0 <memcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xc1b(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <ale_encrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xc1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1130 <ale_decrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xb95(%rip),%rsi
xor    %eax,%eax
mov    $0x10,%edx
call   10c0 <memcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xb8f(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xbeb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xca3(%rip),%rsi
xor    %eax,%eax
mov    $0x3,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   10d0 <mbia_encrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xbc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc69(%rip),%rsi
xor    %eax,%eax
mov    $0x3,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1070 <mbia_decrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xba1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xba9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xad3(%rip),%rsi
xor    %eax,%eax
mov    $0x10,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xb99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xba0(%rip),%rsi
xor    %eax,%eax
mov    $0x3,%edx
call   10c0 <memcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xaa4(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   10d0 <mbia_encrypt@plt>
mov    -0x28(%rbp),%rdi
lea    0xb65(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <ale_encrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xb62(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xb2b(%rip),%rsi
xor    %eax,%eax
mov    $0x3,%edx
call   10c0 <memcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xb18(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1130 <ale_decrypt@plt>
mov    -0x28(%rbp),%rdi
lea    0xa0b(%rip),%rsi
xor    %eax,%eax
mov    $0x20,%edx
call   10c0 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1070 <mbia_decrypt@plt>
mov    -0x10(%rbp),%rsi
lea    0xb06(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x9,%edi
call   1100 <malloc@plt>
mov    %rax,%r12
movb   $0x0,0x8(%rax)
mov    $0x9,%edi
call   1100 <malloc@plt>
mov    %rax,%r14
movb   $0x0,0x8(%rax)
mov    $0x11,%edi
call   1100 <malloc@plt>
mov    %rax,0x18(%rsp)
movb   $0x0,0x10(%rax)
mov    $0x21,%edi
call   1100 <malloc@plt>
mov    %rax,0x10(%rsp)
movb   $0x0,0x20(%rax)
mov    $0x4,%edi
call   1100 <malloc@plt>
mov    %rax,0x8(%rsp)
movb   $0x0,0x4(%rax)
lea    0xf82(%rip),%rdi
call   1040 <puts@plt>
lea    0xd44(%rip),%rsi
mov    %r12,%rdi
mov    $0x8,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
lea    0xd37(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   10c0 <pbox@plt>
lea    0xd38(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   10c0 <pbox@plt>
lea    0xd39(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1130 <invpbox@plt>
lea    0xd3a(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1130 <invpbox@plt>
lea    0xd3b(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10f0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    $0x3e8,%ebp
mov    $0x1,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x1(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x2(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x3(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x4(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x5(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x6(%r12)
xor    %eax,%eax
call   1160 <rand@plt>
inc    %al
movzbl %al,%eax
cmove  %r13d,%eax
mov    %al,0x7(%r12)
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %r12,%rdi
call   10c0 <pbox@plt>
mov    %r12,%rdi
call   10c0 <pbox@plt>
mov    %r12,%rdi
call   1130 <invpbox@plt>
mov    %r12,%rdi
call   1130 <invpbox@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
cmovne %r13d,%ebx
add    $0xffffffff,%ebp
jne    1360 <main+0x120>
mov    %r14,0x20(%rsp)
test   %ebx,%ebx
jne    18cb <main+0x68b>
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
lea    0xe12(%rip),%rdi
call   1040 <puts@plt>
movb   $0x40,0x7(%rsp)
lea    0xc06(%rip),%rdi
xor    %ebx,%ebx
mov    $0x40,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x7(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <sboxa@plt>
movsbl 0x7(%rsp),%esi
lea    0xbfa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1060 <sboxa@plt>
movsbl 0x7(%rsp),%esi
lea    0xbfa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1110 <invsboxa@plt>
movsbl 0x7(%rsp),%esi
lea    0xbfa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1110 <invsboxa@plt>
movsbl 0x7(%rsp),%esi
lea    0xbfa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r13d
xor    %r15d,%r15d
xor    %r14d,%r14d
mov    %r14b,0x7(%rsp)
mov    %rbp,%rdi
call   1060 <sboxa@plt>
mov    %rbp,%rdi
call   1110 <invsboxa@plt>
mov    %ebx,%eax
sar    $0x18,%eax
movsbl 0x7(%rsp),%ecx
cmp    %ecx,%eax
cmovne %r13d,%r15d
add    $0x1,%r14d
add    $0x1000000,%ebx
cmp    $0x100,%r14d
jne    1510 <main+0x2d0>
test   %r15d,%r15d
jne    18d4 <main+0x694>
lea    0xd59(%rip),%rdi
call   1040 <puts@plt>
lea    0xd7d(%rip),%rdi
call   1040 <puts@plt>
movb   $0x40,0x7(%rsp)
lea    0xb16(%rip),%rdi
xor    %r14d,%r14d
mov    $0x40,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x7(%rsp),%r15
mov    %r15,%rdi
call   1120 <sboxb@plt>
movsbl 0x7(%rsp),%esi
lea    0xb09(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1120 <sboxb@plt>
movsbl 0x7(%rsp),%esi
lea    0xb09(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1050 <invsboxb@plt>
movsbl 0x7(%rsp),%esi
lea    0xb09(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1050 <invsboxb@plt>
movsbl 0x7(%rsp),%esi
lea    0xb09(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r13d
xor    %ebp,%ebp
xor    %ebx,%ebx
nop
mov    %bl,0x7(%rsp)
mov    %r15,%rdi
call   1120 <sboxb@plt>
mov    %r15,%rdi
call   1050 <invsboxb@plt>
mov    %r14d,%eax
sar    $0x18,%eax
movsbl 0x7(%rsp),%ecx
cmp    %ecx,%eax
cmovne %r13d,%ebp
add    $0x1,%ebx
add    $0x1000000,%r14d
cmp    $0x100,%ebx
jne    1600 <main+0x3c0>
test   %ebp,%ebp
jne    18dd <main+0x69d>
lea    0xcc7(%rip),%rdi
call   1040 <puts@plt>
lea    0xceb(%rip),%rdi
call   1040 <puts@plt>
lea    0xab4(%rip),%r15
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
lea    0xaa7(%rip),%r13
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
lea    0xaaa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <ale_encrypt@plt>
lea    0xaa2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1140 <ale_decrypt@plt>
lea    0xa9a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc6e(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
lea    0xa6e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcdd(%rip),%r14
mov    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10e0 <mbia_encrypt@plt>
lea    0xa46(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1080 <mbia_decrypt@plt>
lea    0xa2a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbd3(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0x971(%rip),%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
lea    0xa0d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa15(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10e0 <mbia_encrypt@plt>
lea    0x9e0(%rip),%r13
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <ale_encrypt@plt>
lea    0x9dd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1140 <ale_decrypt@plt>
mov    %rbp,%rdi
lea    0x8be(%rip),%rsi
mov    $0x20,%edx
xor    %eax,%eax
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1080 <mbia_decrypt@plt>
lea    0x992(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb03(%rip),%rdi
jmp    18e4 <main+0x6a4>
lea    0xace(%rip),%rdi
jmp    18e4 <main+0x6a4>
lea    0xa99(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1150 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Test phase I - Permutation (pbox.h)\0A\00"
@.str.1 = [9 x i8] c"12345678\00"
@.str.2 = [26 x i8] c" Permutation input: %s\0A\00"
@.str.3 = [26 x i8] c" Permutation output: %s\0A\00"
@.str.4 = [26 x i8] c" Another permutation: %s\0A\00"
@.str.5 = [26 x i8] c" And back: %s\0A\00"
@.str.6 = [26 x i8] c" And back again: %s\0A\00"
@.str.7 = [45 x i8] c" (--) Failed permutation random char test.\0A\0A\00"
@.str.8 = [49 x i8] c" (++) Successful permutation random char test.\0A\0A\00"
@.str.9 = [44 x i8] c"Test phase II - S-Box Alpha (sbox_alpha.h)\0A\00"
@.str.10 = [27 x i8] c" S-Box input: %c\0A\00"
@.str.11 = [27 x i8] c" S-Box output: %c\0A\00"
@.str.12 = [27 x i8] c" Another substitution: %c\0A\00"
@.str.13 = [27 x i8] c" And back: %c\0A\00"
@.str.14 = [27 x i8] c" And back again: %c\0A\00"
@.str.15 = [45 x i8] c" (--) Failed test of complete S-Box Alpha.\0A\0A\00"
@.str.16 = [49 x i8] c" (++) Successful test of complete S-Box Alpha.\0A\0A\00"
@.str.17 = [45 x i8] c"Test phase III - S-Box Bravo (sbox_bravo.h)\0A\00"
@.str.18 = [45 x i8] c" (--) Failed test of complete S-Box Bravo.\0A\0A\00"
@.str.19 = [49 x i8] c" (++) Successful test of complete S-Box Bravo.\0A\0A\00"
@.str.20 = [21 x i8] c"Test phase IV - ALE\0A\00"
@.str.21 = [17 x i8] c"0123456789ABCDEF\00"
@.str.22 = [33 x i8] c"00001111222233334444555566667777\00"
@.str.23 = [20 x i8] c" ALE input: %s\0A\00"
@.str.24 = [20 x i8] c" ALE output: %s\0A\00"
@.str.25 = [21 x i8] c" ALE decrypted: %s\0A\0A\00"
@.str.26 = [21 x i8] c"Test phase V - MBIA\0A\00"
@.str.27 = [21 x i8] c" MBIA input: %s\0A\00"
@.str.28 = [4 x i8] zeroinitializer
@.str.29 = [21 x i8] c" MBIA output: %s\0A\00"
@.str.30 = [22 x i8] c" MBIA decrypted: %s\0A\0A\00"
@.str.31 = [25 x i8] c"Test phase V - ALE/MBIA\0A\00"
@.str.32 = [25 x i8] c" ALE/MBIA input: %s\0A\00"
@.str.33 = [4 x i8] c"abc\00"
@.str.34 = [33 x i8] c"88889999AAAABBBBCCCCDDDDEEEEFFFF\00"
@.str.35 = [25 x i8] c" ALE/MBIA output: %s\0A\00"
@.str.36 = [26 x i8] c" ALE/MBIA decrypted: %s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = call i8* @malloc(i32 9)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 8
store i8 0, i8* %14
%15 = call i8* @malloc(i32 9)
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 8
store i8 0, i8* %17
%18 = call i8* @malloc(i32 17)
store i8* %18, i8** %2
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 16
store i8 0, i8* %20
%21 = call i8* @malloc(i32 33)
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 32
store i8 0, i8* %23
%24 = call i8* @malloc(i32 4)
store i8* %24, i8** %6
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i64 4
store i8 0, i8* %26
store i32 0, i32* %11
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%28 = load i8*, i8** %3
%29 = call i32 (i8*, ...) @memcpy(i8* %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%30 = load i8*, i8** %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %3
%33 = call i32 @pbox(i8* %32)
%34 = load i8*, i8** %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %34)
%36 = load i8*, i8** %3
%37 = call i32 @pbox(i8* %36)
%38 = load i8*, i8** %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%40 = load i8*, i8** %3
%41 = call i32 @invpbox(i8* %40)
%42 = load i8*, i8** %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %3
%45 = call i32 @invpbox(i8* %44)
%46 = load i8*, i8** %3
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %46)
%48 = call i32 @time(i32* null)
%49 = call i32 @srand(i32 %48)
store i32 0, i32* %9
br label %50
50: ; preds = %89, %0
%51 = load i32, i32* %9
%52 = icmp slt i32 %51, 1000
br i1 %52, label %53, label %92
53: ; preds = %50
store i32 0, i32* %10
br label %54
54: ; preds = %68, %53
%55 = load i32, i32* %10
%56 = icmp slt i32 %55, 8
br i1 %56, label %57, label %71
57: ; preds = %54
%58 = call i64 (...) @rand()
%59 = trunc i64 %58 to i8
%60 = zext i8 %59 to i32
%61 = srem i32 %60, 255
%62 = add nsw i32 %61, 1
%63 = trunc i32 %62 to i8
%64 = load i8*, i8** %3
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
store i8 %63, i8* %67
br label %68
68: ; preds = %57
%69 = load i32, i32* %10
%70 = add nsw i32 %69, 1
store i32 %70, i32* %10
br label %54
71: ; preds = %54
%72 = load i8*, i8** %4
%73 = load i8*, i8** %3
%74 = call i32 (i8*, ...) @memcpy(i8* %72, i8* %73, i32 8)
%75 = load i8*, i8** %3
%76 = call i32 @pbox(i8* %75)
%77 = load i8*, i8** %3
%78 = call i32 @pbox(i8* %77)
%79 = load i8*, i8** %3
%80 = call i32 @invpbox(i8* %79)
%81 = load i8*, i8** %3
%82 = call i32 @invpbox(i8* %81)
%83 = load i8*, i8** %3
%84 = load i8*, i8** %4
%85 = call i64 @strcmp(i8* %83, i8* %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %71
store i32 1, i32* %11
br label %88
88: ; preds = %87, %71
br label %89
89: ; preds = %88
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
store i32 %91, i32* %9
br label %50
92: ; preds = %50
%93 = load i32, i32* %11
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %92
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%97 = call i32 @exit(i32 1)
unreachable
98: ; preds = %92
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
br label %100
100: ; preds = %98
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
store i8 64, i8* %7
%102 = load i8, i8* %7
%103 = sext i8 %102 to i32
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %103)
%105 = call i32 @sboxa(i8* %7)
%106 = load i8, i8* %7
%107 = sext i8 %106 to i32
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %107)
%109 = call i32 @sboxa(i8* %7)
%110 = load i8, i8* %7
%111 = sext i8 %110 to i32
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i32 %111)
%113 = call i32 @invsboxa(i8* %7)
%114 = load i8, i8* %7
%115 = sext i8 %114 to i32
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %115)
%117 = call i32 @invsboxa(i8* %7)
%118 = load i8, i8* %7
%119 = sext i8 %118 to i32
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %119)
store i32 0, i32* %9
br label %121
121: ; preds = %136, %100
%122 = load i32, i32* %9
%123 = icmp slt i32 %122, 256
br i1 %123, label %124, label %139
124: ; preds = %121
%125 = load i32, i32* %9
%126 = trunc i32 %125 to i8
store i8 %126, i8* %8
store i8 %126, i8* %7
%127 = call i32 @sboxa(i8* %7)
%128 = call i32 @invsboxa(i8* %7)
%129 = load i8, i8* %8
%130 = sext i8 %129 to i32
%131 = load i8, i8* %7
%132 = sext i8 %131 to i32
%133 = icmp ne i32 %130, %132
br i1 %133, label %134, label %135
134: ; preds = %124
store i32 1, i32* %11
br label %135
135: ; preds = %134, %124
br label %136
136: ; preds = %135
%137 = load i32, i32* %9
%138 = add nsw i32 %137, 1
store i32 %138, i32* %9
br label %121
139: ; preds = %121
%140 = load i32, i32* %11
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %145
142: ; preds = %139
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%144 = call i32 @exit(i32 1)
unreachable
145: ; preds = %139
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.16, i64 0, i64 0))
br label %147
147: ; preds = %145
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0))
store i8 64, i8* %7
%149 = load i8, i8* %7
%150 = sext i8 %149 to i32
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %150)
%152 = call i32 @sboxb(i8* %7)
%153 = load i8, i8* %7
%154 = sext i8 %153 to i32
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %154)
%156 = call i32 @sboxb(i8* %7)
%157 = load i8, i8* %7
%158 = sext i8 %157 to i32
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i32 %158)
%160 = call i32 @invsboxb(i8* %7)
%161 = load i8, i8* %7
%162 = sext i8 %161 to i32
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %162)
%164 = call i32 @invsboxb(i8* %7)
%165 = load i8, i8* %7
%166 = sext i8 %165 to i32
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %166)
store i32 0, i32* %9
br label %168
168: ; preds = %183, %147
%169 = load i32, i32* %9
%170 = icmp slt i32 %169, 256
br i1 %170, label %171, label %186
171: ; preds = %168
%172 = load i32, i32* %9
%173 = trunc i32 %172 to i8
store i8 %173, i8* %8
store i8 %173, i8* %7
%174 = call i32 @sboxb(i8* %7)
%175 = call i32 @invsboxb(i8* %7)
%176 = load i8, i8* %8
%177 = sext i8 %176 to i32
%178 = load i8, i8* %7
%179 = sext i8 %178 to i32
%180 = icmp ne i32 %177, %179
br i1 %180, label %181, label %182
181: ; preds = %171
store i32 1, i32* %11
br label %182
182: ; preds = %181, %171
br label %183
183: ; preds = %182
%184 = load i32, i32* %9
%185 = add nsw i32 %184, 1
store i32 %185, i32* %9
br label %168
186: ; preds = %168
%187 = load i32, i32* %11
%188 = icmp ne i32 %187, 0
br i1 %188, label %189, label %192
189: ; preds = %186
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.18, i64 0, i64 0))
%191 = call i32 @exit(i32 1)
unreachable
192: ; preds = %186
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.19, i64 0, i64 0))
br label %194
194: ; preds = %192
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
%196 = load i8*, i8** %2
%197 = call i32 (i8*, ...) @memcpy(i8* %196, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%198 = load i8*, i8** %5
%199 = call i32 (i8*, ...) @memcpy(i8* %198, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%200 = load i8*, i8** %2
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i8* %200)
%202 = load i8*, i8** %2
%203 = load i8*, i8** %5
%204 = call i32 @ale_encrypt(i8* %202, i8* %203)
%205 = load i8*, i8** %2
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0), i8* %205)
%207 = load i8*, i8** %2
%208 = load i8*, i8** %5
%209 = call i32 @ale_decrypt(i8* %207, i8* %208)
%210 = load i8*, i8** %2
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0), i8* %210)
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.26, i64 0, i64 0))
%213 = load i8*, i8** %2
%214 = call i32 (i8*, ...) @memcpy(i8* %213, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%215 = load i8*, i8** %5
%216 = call i32 (i8*, ...) @memcpy(i8* %215, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%217 = load i8*, i8** %2
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.27, i64 0, i64 0), i8* %217)
%219 = load i8*, i8** %6
%220 = call i32 (i8*, ...) @memcpy(i8* %219, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i32 3)
%221 = load i8*, i8** %2
%222 = load i8*, i8** %5
%223 = load i8*, i8** %6
%224 = call i32 @mbia_encrypt(i8* %221, i8* %222, i8* %223)
%225 = load i8*, i8** %2
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.29, i64 0, i64 0), i8* %225)
%227 = load i8*, i8** %6
%228 = call i32 (i8*, ...) @memcpy(i8* %227, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i32 3)
%229 = load i8*, i8** %2
%230 = load i8*, i8** %5
%231 = load i8*, i8** %6
%232 = call i32 @mbia_decrypt(i8* %229, i8* %230, i8* %231)
%233 = load i8*, i8** %2
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.30, i64 0, i64 0), i8* %233)
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.31, i64 0, i64 0))
%236 = load i8*, i8** %2
%237 = call i32 (i8*, ...) @memcpy(i8* %236, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%238 = load i8*, i8** %2
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.32, i64 0, i64 0), i8* %238)
%240 = load i8*, i8** %6
%241 = call i32 (i8*, ...) @memcpy(i8* %240, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), i32 3)
%242 = load i8*, i8** %5
%243 = call i32 (i8*, ...) @memcpy(i8* %242, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%244 = load i8*, i8** %2
%245 = load i8*, i8** %5
%246 = load i8*, i8** %6
%247 = call i32 @mbia_encrypt(i8* %244, i8* %245, i8* %246)
%248 = load i8*, i8** %5
%249 = call i32 (i8*, ...) @memcpy(i8* %248, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0), i32 32)
%250 = load i8*, i8** %2
%251 = load i8*, i8** %5
%252 = call i32 @ale_encrypt(i8* %250, i8* %251)
%253 = load i8*, i8** %2
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.35, i64 0, i64 0), i8* %253)
%255 = load i8*, i8** %6
%256 = call i32 (i8*, ...) @memcpy(i8* %255, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), i32 3)
%257 = load i8*, i8** %5
%258 = call i32 (i8*, ...) @memcpy(i8* %257, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0), i32 32)
%259 = load i8*, i8** %2
%260 = load i8*, i8** %5
%261 = call i32 @ale_decrypt(i8* %259, i8* %260)
%262 = load i8*, i8** %5
%263 = call i32 (i8*, ...) @memcpy(i8* %262, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%264 = load i8*, i8** %2
%265 = load i8*, i8** %5
%266 = load i8*, i8** %6
%267 = call i32 @mbia_decrypt(i8* %264, i8* %265, i8* %266)
%268 = load i8*, i8** %2
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.36, i64 0, i64 0), i8* %268)
%270 = load i8*, i8** %3
%271 = call i32 @free(i8* %270)
%272 = load i8*, i8** %4
%273 = call i32 @free(i8* %272)
%274 = load i8*, i8** %2
%275 = call i32 @free(i8* %274)
%276 = load i8*, i8** %5
%277 = call i32 @free(i8* %276)
%278 = load i8*, i8** %6
%279 = call i32 @free(i8* %278)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"12345678\00"
@.str.2 = [26 x i8] c" Permutation input: %s\0A\00"
@.str.3 = [26 x i8] c" Permutation output: %s\0A\00"
@.str.4 = [26 x i8] c" Another permutation: %s\0A\00"
@.str.5 = [26 x i8] c" And back: %s\0A\00"
@.str.6 = [26 x i8] c" And back again: %s\0A\00"
@.str.10 = [27 x i8] c" S-Box input: %c\0A\00"
@.str.11 = [27 x i8] c" S-Box output: %c\0A\00"
@.str.12 = [27 x i8] c" Another substitution: %c\0A\00"
@.str.13 = [27 x i8] c" And back: %c\0A\00"
@.str.14 = [27 x i8] c" And back again: %c\0A\00"
@.str.21 = [17 x i8] c"0123456789ABCDEF\00"
@.str.22 = [33 x i8] c"00001111222233334444555566667777\00"
@.str.23 = [20 x i8] c" ALE input: %s\0A\00"
@.str.24 = [20 x i8] c" ALE output: %s\0A\00"
@.str.25 = [21 x i8] c" ALE decrypted: %s\0A\0A\00"
@.str.27 = [21 x i8] c" MBIA input: %s\0A\00"
@.str.28 = [4 x i8] zeroinitializer
@.str.29 = [21 x i8] c" MBIA output: %s\0A\00"
@.str.30 = [22 x i8] c" MBIA decrypted: %s\0A\0A\00"
@.str.32 = [25 x i8] c" ALE/MBIA input: %s\0A\00"
@.str.33 = [4 x i8] c"abc\00"
@.str.34 = [33 x i8] c"88889999AAAABBBBCCCCDDDDEEEEFFFF\00"
@.str.35 = [25 x i8] c" ALE/MBIA output: %s\0A\00"
@.str.36 = [26 x i8] c" ALE/MBIA decrypted: %s\0A\0A\00"
@str = [36 x i8] c"Test phase I - Permutation (pbox.h)\00"
@str.37 = [48 x i8] c" (++) Successful permutation random char test.\0A\00"
@str.38 = [43 x i8] c"Test phase II - S-Box Alpha (sbox_alpha.h)\00"
@str.39 = [48 x i8] c" (++) Successful test of complete S-Box Alpha.\0A\00"
@str.40 = [44 x i8] c"Test phase III - S-Box Bravo (sbox_bravo.h)\00"
@str.41 = [48 x i8] c" (++) Successful test of complete S-Box Bravo.\0A\00"
@str.42 = [20 x i8] c"Test phase IV - ALE\00"
@str.43 = [20 x i8] c"Test phase V - MBIA\00"
@str.44 = [24 x i8] c"Test phase V - ALE/MBIA\00"
@str.45 = [44 x i8] c" (--) Failed test of complete S-Box Bravo.\0A\00"
@str.46 = [44 x i8] c" (--) Failed test of complete S-Box Alpha.\0A\00"
@str.47 = [44 x i8] c" (--) Failed permutation random char test.\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call dereferenceable_or_null(9) i8* @malloc(i32 9)
%3 = getelementptr inbounds i8, i8* %2, i64 8
store i8 0, i8* %3
%4 = tail call dereferenceable_or_null(9) i8* @malloc(i32 9)
%5 = getelementptr inbounds i8, i8* %4, i64 8
store i8 0, i8* %5
%6 = tail call dereferenceable_or_null(17) i8* @malloc(i32 17)
%7 = getelementptr inbounds i8, i8* %6, i64 16
store i8 0, i8* %7
%8 = tail call dereferenceable_or_null(33) i8* @malloc(i32 33)
%9 = getelementptr inbounds i8, i8* %8, i64 32
store i8 0, i8* %9
%10 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%11 = getelementptr inbounds i8, i8* %10, i64 4
store i8 0, i8* %11
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @memcpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%15 = tail call i32 @pbox(i8* %2)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%17 = tail call i32 @pbox(i8* %2)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%19 = tail call i32 @invpbox(i8* %2)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%21 = tail call i32 @invpbox(i8* %2)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%23 = tail call i32 @time(i32* null)
%24 = tail call i32 @srand(i32 %23)
%25 = getelementptr inbounds i8, i8* %2, i64 1
%26 = getelementptr inbounds i8, i8* %2, i64 2
%27 = getelementptr inbounds i8, i8* %2, i64 3
%28 = getelementptr inbounds i8, i8* %2, i64 4
%29 = getelementptr inbounds i8, i8* %2, i64 5
%30 = getelementptr inbounds i8, i8* %2, i64 6
%31 = getelementptr inbounds i8, i8* %2, i64 7
br label %32
32: ; preds = %0, %32
%33 = phi i32 [ 0, %0 ], [ %82, %32 ]
%34 = phi i32 [ 0, %0 ], [ %83, %32 ]
%35 = tail call i64 (...) @rand()
%36 = trunc i64 %35 to i8
%37 = icmp eq i8 %36, -1
%38 = add i8 %36, 1
%39 = select i1 %37, i8 1, i8 %38
store i8 %39, i8* %2
%40 = tail call i64 (...) @rand()
%41 = trunc i64 %40 to i8
%42 = icmp eq i8 %41, -1
%43 = add i8 %41, 1
%44 = select i1 %42, i8 1, i8 %43
store i8 %44, i8* %25
%45 = tail call i64 (...) @rand()
%46 = trunc i64 %45 to i8
%47 = icmp eq i8 %46, -1
%48 = add i8 %46, 1
%49 = select i1 %47, i8 1, i8 %48
store i8 %49, i8* %26
%50 = tail call i64 (...) @rand()
%51 = trunc i64 %50 to i8
%52 = icmp eq i8 %51, -1
%53 = add i8 %51, 1
%54 = select i1 %52, i8 1, i8 %53
store i8 %54, i8* %27
%55 = tail call i64 (...) @rand()
%56 = trunc i64 %55 to i8
%57 = icmp eq i8 %56, -1
%58 = add i8 %56, 1
%59 = select i1 %57, i8 1, i8 %58
store i8 %59, i8* %28
%60 = tail call i64 (...) @rand()
%61 = trunc i64 %60 to i8
%62 = icmp eq i8 %61, -1
%63 = add i8 %61, 1
%64 = select i1 %62, i8 1, i8 %63
store i8 %64, i8* %29
%65 = tail call i64 (...) @rand()
%66 = trunc i64 %65 to i8
%67 = icmp eq i8 %66, -1
%68 = add i8 %66, 1
%69 = select i1 %67, i8 1, i8 %68
store i8 %69, i8* %30
%70 = tail call i64 (...) @rand()
%71 = trunc i64 %70 to i8
%72 = icmp eq i8 %71, -1
%73 = add i8 %71, 1
%74 = select i1 %72, i8 1, i8 %73
store i8 %74, i8* %31
%75 = tail call i32 (i8*, ...) @memcpy(i8* %4, i8* %2, i32 8)
%76 = tail call i32 @pbox(i8* %2)
%77 = tail call i32 @pbox(i8* %2)
%78 = tail call i32 @invpbox(i8* %2)
%79 = tail call i32 @invpbox(i8* %2)
%80 = tail call i64 @strcmp(i8* %2, i8* %4)
%81 = icmp eq i64 %80, 0
%82 = select i1 %81, i32 %33, i32 1
%83 = add nuw nsw i32 %34, 1
%84 = icmp eq i32 %83, 1000
br i1 %84, label %85, label %32
85: ; preds = %32
%86 = icmp eq i32 %82, 0
br i1 %86, label %90, label %87
87: ; preds = %85
%88 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.47, i64 0, i64 0))
%89 = tail call i32 @exit(i32 1)
unreachable
90: ; preds = %85
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.37, i64 0, i64 0))
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.38, i64 0, i64 0))
store i8 64, i8* %1
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 64)
%94 = call i32 @sboxa(i8* %1)
%95 = load i8, i8* %1
%96 = sext i8 %95 to i32
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %96)
%98 = call i32 @sboxa(i8* %1)
%99 = load i8, i8* %1
%100 = sext i8 %99 to i32
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i32 %100)
%102 = call i32 @invsboxa(i8* %1)
%103 = load i8, i8* %1
%104 = sext i8 %103 to i32
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %104)
%106 = call i32 @invsboxa(i8* %1)
%107 = load i8, i8* %1
%108 = sext i8 %107 to i32
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %108)
br label %110
110: ; preds = %90, %110
%111 = phi i32 [ 0, %90 ], [ %121, %110 ]
%112 = phi i32 [ 0, %90 ], [ %122, %110 ]
%113 = trunc i32 %112 to i8
store i8 %113, i8* %1
%114 = call i32 @sboxa(i8* %1)
%115 = call i32 @invsboxa(i8* %1)
%116 = shl nuw i32 %112, 24
%117 = ashr exact i32 %116, 24
%118 = load i8, i8* %1
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %117, %119
%121 = select i1 %120, i32 %111, i32 1
%122 = add nuw nsw i32 %112, 1
%123 = icmp eq i32 %122, 256
br i1 %123, label %124, label %110
124: ; preds = %110
%125 = icmp eq i32 %121, 0
br i1 %125, label %129, label %126
126: ; preds = %124
%127 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.46, i64 0, i64 0))
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %124
%130 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.39, i64 0, i64 0))
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.40, i64 0, i64 0))
store i8 64, i8* %1
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 64)
%133 = call i32 @sboxb(i8* %1)
%134 = load i8, i8* %1
%135 = sext i8 %134 to i32
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %135)
%137 = call i32 @sboxb(i8* %1)
%138 = load i8, i8* %1
%139 = sext i8 %138 to i32
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i32 %139)
%141 = call i32 @invsboxb(i8* %1)
%142 = load i8, i8* %1
%143 = sext i8 %142 to i32
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %143)
%145 = call i32 @invsboxb(i8* %1)
%146 = load i8, i8* %1
%147 = sext i8 %146 to i32
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i32 %147)
br label %149
149: ; preds = %129, %149
%150 = phi i32 [ 0, %129 ], [ %160, %149 ]
%151 = phi i32 [ 0, %129 ], [ %161, %149 ]
%152 = trunc i32 %151 to i8
store i8 %152, i8* %1
%153 = call i32 @sboxb(i8* %1)
%154 = call i32 @invsboxb(i8* %1)
%155 = shl nuw i32 %151, 24
%156 = ashr exact i32 %155, 24
%157 = load i8, i8* %1
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %156, %158
%160 = select i1 %159, i32 %150, i32 1
%161 = add nuw nsw i32 %151, 1
%162 = icmp eq i32 %161, 256
br i1 %162, label %163, label %149
163: ; preds = %149
%164 = icmp eq i32 %160, 0
br i1 %164, label %168, label %165
165: ; preds = %163
%166 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.45, i64 0, i64 0))
%167 = call i32 @exit(i32 1)
unreachable
168: ; preds = %163
%169 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.41, i64 0, i64 0))
%170 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.42, i64 0, i64 0))
%171 = call i32 (i8*, ...) @memcpy(i8* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%172 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i8* %6)
%174 = call i32 @ale_encrypt(i8* %6, i8* %8)
%175 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0), i8* %6)
%176 = call i32 @ale_decrypt(i8* %6, i8* %8)
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0), i8* %6)
%178 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.43, i64 0, i64 0))
%179 = call i32 (i8*, ...) @memcpy(i8* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%180 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%181 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.27, i64 0, i64 0), i8* %6)
%182 = call i32 (i8*, ...) @memcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i32 3)
%183 = call i32 @mbia_encrypt(i8* %6, i8* %8, i8* %10)
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.29, i64 0, i64 0), i8* %6)
%185 = call i32 (i8*, ...) @memcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i32 3)
%186 = call i32 @mbia_decrypt(i8* %6, i8* %8, i8* %10)
%187 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.30, i64 0, i64 0), i8* %6)
%188 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.44, i64 0, i64 0))
%189 = call i32 (i8*, ...) @memcpy(i8* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i32 16)
%190 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.32, i64 0, i64 0), i8* %6)
%191 = call i32 (i8*, ...) @memcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), i32 3)
%192 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%193 = call i32 @mbia_encrypt(i8* %6, i8* %8, i8* %10)
%194 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0), i32 32)
%195 = call i32 @ale_encrypt(i8* %6, i8* %8)
%196 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.35, i64 0, i64 0), i8* %6)
%197 = call i32 (i8*, ...) @memcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), i32 3)
%198 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0), i32 32)
%199 = call i32 @ale_decrypt(i8* %6, i8* %8)
%200 = call i32 (i8*, ...) @memcpy(i8* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 32)
%201 = call i32 @mbia_decrypt(i8* %6, i8* %8, i8* %10)
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.36, i64 0, i64 0), i8* %6)
%203 = call i32 @free(i8* %2)
%204 = call i32 @free(i8* %4)
%205 = call i32 @free(i8* %6)
%206 = call i32 @free(i8* %8)
%207 = call i32 @free(i8* %10)
ret i32 0
}