#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*/ AES(unsigned char *, unsigned char *, unsigned long *);
int /*<<< orphan*/ KeyExpansion(unsigned char *, unsigned long *, int);
unsigned char charsToHex(unsigned char, unsigned char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned char *);
int main() {
  int i;
  int Nk = 4;
  unsigned char plaintext[32];
  unsigned char key[32];
  unsigned char str[16];
  unsigned char encrypted_message[16];
  unsigned char pairs_hex[16];
  unsigned char key_pairs_hex[16];
  unsigned long key_expansion[44];
  *(volatile char *)0x00000040 = 0;
  *(volatile char *)0x00000050 = 0;
  printf("Press reset!\n");
  while (*(char *)0x00000020 != 3)
    ;
  while (1) {
    *(volatile char *)0x00000040 = 0;
    printf("\n");
    printf("\nEnter plain text:\n");
    scanf("%s", plaintext);
    printf("\n");
    printf("\nEnter key:\n");
    scanf("%s", key);
    printf("\n");
    for (i = 0; i < 16; i++) {
      pairs_hex[i] = charsToHex(plaintext[2 * i], plaintext[2 * i + 1]);
    }
    for (i = 0; i < 16; i++) {
      key_pairs_hex[i] = charsToHex(key[2 * i], key[2 * i + 1]);
    }
    KeyExpansion(key_pairs_hex, key_expansion, Nk);
    AES(pairs_hex, encrypted_message, key_expansion);
    printf("\nEncrypted message is\n");
    for (i = 0; i < 16; i++) {
      printf("%02x", encrypted_message[i]);
    }
    printf("\n");
    printf("\nTransmitting message...\n");
    for (i = 0; i < 16; i++) {
      *(volatile char *)0x00000040 = 1;
      *(volatile char *)0x00000050 = encrypted_message[i];
      while (*(char *)0x00000020 != 1)
        ;
      *(volatile char *)0x00000040 = 2;
      while (*(char *)0x00000020 != 0)
        ;
    }
    *(volatile char *)0x00000040 = 0;
    printf("\nTransmitting key...\n");
    for (i = 0; i < 16; i++) {
      *(volatile char *)0x00000040 = 2;
      *(volatile char *)0x00000050 = key_pairs_hex[i];
      while (*(char *)0x00000020 != 1)
        ;
      *(volatile char *)0x00000040 = 1;
      while (*(char *)0x00000020 != 0)
        ;
    }
    *(volatile char *)0x00000040 = 3;
    printf("\n\n");
    while (*(char *)0x00000020 != 2)
      ;
    printf("\nRetrieving message...\n");
    for (i = 0; i < 16; ++i) {
      *(volatile char *)0x00000040 = 1;
      while (*(char *)0x00000020 != 1)
        ;
      str[i] = *(char *)0x00000030;
      *(volatile char *)0x00000040 = 2;
      while (*(char *)0x00000020 != 0)
        ;
    }
    printf("\n\n");
    printf("Decoded message:\n");
    for (i = 0; i < 16; i++) {
      printf("%02x", str[i]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    $0x40,%eax
movb   $0x0,(%rax)
mov    $0x50,%eax
movb   $0x0,(%rax)
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x3,%eax
je     119d <main+0x4d>
jmp    1187 <main+0x37>
jmp    11a2 <main+0x52>
mov    $0x40,%eax
movb   $0x0,(%rax)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe51(%rip),%rdi
call   1060 <scanf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe25(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    125d <main+0x10d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,1),%cl
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movzbl %cl,%edi
movzbl -0x30(%rbp,%rax,1),%esi
call   1070 <charsToHex@plt>
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1217 <main+0xc7>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    12ad <main+0x15d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltq
mov    -0x50(%rbp,%rax,1),%cl
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movzbl %cl,%edi
movzbl -0x50(%rbp,%rax,1),%esi
call   1070 <charsToHex@plt>
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1264 <main+0x114>
lea    -0x90(%rbp),%rdi
lea    -0x1f0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <KeyExpansion@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x1f0(%rbp),%rdx
call   1040 <AES@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    131b <main+0x1cb>
movslq -0x8(%rbp),%rax
movzbl -0x70(%rbp,%rax,1),%esi
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12ec <main+0x19c>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    13a6 <main+0x256>
mov    $0x40,%eax
movb   $0x1,(%rax)
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
mov    $0x50,%eax
mov    %cl,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x1,%eax
je     1375 <main+0x225>
jmp    135f <main+0x20f>
mov    $0x40,%eax
movb   $0x2,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1393 <main+0x243>
jmp    137d <main+0x22d>
jmp    1398 <main+0x248>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    133e <main+0x1ee>
mov    $0x40,%eax
movb   $0x0,(%rax)
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    142e <main+0x2de>
mov    $0x40,%eax
movb   $0x2,(%rax)
movslq -0x8(%rbp),%rax
mov    -0x90(%rbp,%rax,1),%cl
mov    $0x50,%eax
mov    %cl,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x1,%eax
je     13fd <main+0x2ad>
jmp    13e7 <main+0x297>
mov    $0x40,%eax
movb   $0x1,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     141b <main+0x2cb>
jmp    1405 <main+0x2b5>
jmp    1420 <main+0x2d0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13c3 <main+0x273>
mov    $0x40,%eax
movb   $0x3,(%rax)
lea    0xc41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x2,%eax
je     145a <main+0x30a>
jmp    1444 <main+0x2f4>
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    14d7 <main+0x387>
mov    $0x40,%eax
movb   $0x1,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x1,%eax
je     1497 <main+0x347>
jmp    1481 <main+0x331>
mov    $0x30,%eax
mov    (%rax),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    $0x40,%eax
movb   $0x2,(%rax)
mov    $0x20,%eax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     14c4 <main+0x374>
jmp    14ae <main+0x35e>
jmp    14c9 <main+0x379>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    146f <main+0x31f>
lea    0xba0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1529 <main+0x3d9>
movslq -0x8(%rbp),%rax
movzbl -0x60(%rbp,%rax,1),%esi
lea    0xb35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14fa <main+0x3aa>
lea    0xb4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <main+0x52>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
movb   $0x0,0x40
movb   $0x0,0x50
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
cmpb   $0x3,0x20
03
jne    16b0 <main+0x540>
lea    0xe63(%rip),%rbx
lea    0xe47(%rip),%r13
lea    0x40(%rsp),%r12
lea    0xe63(%rip),%rbp
lea    0x60(%rsp),%r14
lea    0xe32(%rip),%r15
movb   $0x0,0x40
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r13,%rbx
mov    %r12,%rsi
call   1080 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x40(%rsp,%r12,2),%edi
movzbl 0x41(%rsp,%r12,2),%esi
call   1090 <charsToHex@plt>
mov    %al,0x30(%rsp,%r12,1)
add    $0x1,%r12
cmp    $0x10,%r12
jne    1230 <main+0xc0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x60(%rsp,%rbx,2),%edi
movzbl 0x61(%rsp,%rbx,2),%esi
call   1090 <charsToHex@plt>
mov    %al,0x20(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1260 <main+0xf0>
lea    0x20(%rsp),%rdi
lea    0x80(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1070 <KeyExpansion@plt>
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    %rbx,%rdx
call   1060 <AES@plt>
lea    0xd86(%rip),%rdi
call   1040 <puts@plt>
movzbl (%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x3(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x5(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x6(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x8(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x9(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xa(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xb(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xc(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xd(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xe(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xf(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc97(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
lea    0xc54(%rip),%rbx
lea    0x40(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
movb   $0x1,0x40
01
movzbl (%rsp,%rax,1),%ecx
mov    %cl,0x50
cmpb   $0x1,0x20
01
jne    16c0 <main+0x550>
movb   $0x2,0x40
02
cmpb   $0x0,0x20
jne    16d0 <main+0x560>
movb   $0x1,0x40
01
movzbl 0x1(%rsp,%rax,1),%ecx
mov    %cl,0x50
cmpb   $0x1,0x20
01
jne    16c0 <main+0x550>
movb   $0x2,0x40
02
cmpb   $0x0,0x20
jne    16d0 <main+0x560>
add    $0x2,%rax
cmp    $0x10,%rax
jne    13d0 <main+0x260>
movb   $0x0,0x40
lea    0xc0b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
nop
movb   $0x2,0x40
02
movzbl 0x20(%rsp,%rax,1),%ecx
mov    %cl,0x50
cmpb   $0x1,0x20
01
jne    16e0 <main+0x570>
movb   $0x1,0x40
01
cmpb   $0x0,0x20
jne    16f0 <main+0x580>
movb   $0x2,0x40
02
movzbl 0x21(%rsp,%rax,1),%ecx
mov    %cl,0x50
cmpb   $0x1,0x20
01
jne    16e0 <main+0x570>
movb   $0x1,0x40
01
cmpb   $0x0,0x20
jne    16f0 <main+0x580>
add    $0x2,%rax
cmp    $0x10,%rax
jne    1460 <main+0x2f0>
movb   $0x3,0x40
03
lea    0xba6(%rip),%rdi
call   1040 <puts@plt>
cmpb   $0x2,0x20
02
jne    1720 <main+0x5b0>
lea    0xb75(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
movb   $0x1,0x40
01
cmpb   $0x1,0x20
01
jne    1700 <main+0x590>
movzbl 0x30,%ecx
mov    %cl,0x10(%rsp,%rax,1)
movb   $0x2,0x40
02
cmpb   $0x0,0x20
jne    1710 <main+0x5a0>
movb   $0x1,0x40
01
cmpb   $0x1,0x20
01
jne    1700 <main+0x590>
movzbl 0x30,%ecx
mov    %cl,0x11(%rsp,%rax,1)
movb   $0x2,0x40
02
cmpb   $0x0,0x20
jne    1710 <main+0x5a0>
add    $0x2,%rax
cmp    $0x10,%rax
jne    150a <main+0x39a>
lea    0xb04(%rip),%rdi
call   1040 <puts@plt>
lea    0xafa(%rip),%rdi
call   1040 <puts@plt>
movzbl 0x10(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x11(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x12(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x13(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x14(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x15(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x16(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x17(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x18(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x19(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1a(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1b(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1c(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1d(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1e(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1f(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x98b(%rip),%rbp
jmp    11d1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    16b0 <main+0x540>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    16c0 <main+0x550>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    16d0 <main+0x560>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    16e0 <main+0x570>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    16f0 <main+0x580>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1700 <main+0x590>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1710 <main+0x5a0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1720 <main+0x5b0>

LLVM IR (-O0):
@.str = [14 x i8] c"Press reset!\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [20 x i8] c"\0AEnter plain text:\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [13 x i8] c"\0AEnter key:\0A\00"
@.str.5 = [23 x i8] c"\0AEncrypted message is\0A\00"
@.str.6 = [5 x i8] c"%02x\00"
@.str.7 = [26 x i8] c"\0ATransmitting message...\0A\00"
@.str.8 = [22 x i8] c"\0ATransmitting key...\0A\00"
@.str.9 = [3 x i8] c"\0A\0A\00"
@.str.10 = [24 x i8] c"\0ARetrieving message...\0A\00"
@.str.11 = [18 x i8] c"Decoded message:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = alloca [16 x i8]
%9 = alloca [16 x i8]
%10 = alloca [44 x i64]
store i32 0, i32* %1
store i32 4, i32* %3
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
store volatile i8 0, i8* inttoptr (i64 80 to i8*)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %16, %0
%13 = load i8, i8* inttoptr (i64 32 to i8*)
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %12
br label %12
17: ; preds = %12
br label %18
18: ; preds = %17, %195
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %28
28: ; preds = %47, %18
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 16
br i1 %30, label %31, label %50
31: ; preds = %28
%32 = load i32, i32* %2
%33 = mul nsw i32 2, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = load i32, i32* %2
%38 = mul nsw i32 2, %37
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = call zeroext i8 @charsToHex(i8 zeroext %36, i8 zeroext %42)
%44 = load i32, i32* %2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 %45
store i8 %43, i8* %46
br label %47
47: ; preds = %31
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %28
50: ; preds = %28
store i32 0, i32* %2
br label %51
51: ; preds = %70, %50
%52 = load i32, i32* %2
%53 = icmp slt i32 %52, 16
br i1 %53, label %54, label %73
54: ; preds = %51
%55 = load i32, i32* %2
%56 = mul nsw i32 2, %55
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = load i32, i32* %2
%61 = mul nsw i32 2, %60
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = call zeroext i8 @charsToHex(i8 zeroext %59, i8 zeroext %65)
%67 = load i32, i32* %2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 %68
store i8 %66, i8* %69
br label %70
70: ; preds = %54
%71 = load i32, i32* %2
%72 = add nsw i32 %71, 1
store i32 %72, i32* %2
br label %51
73: ; preds = %51
%74 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%75 = getelementptr inbounds [44 x i64], [44 x i64]* %10, i64 0, i64 0
%76 = load i32, i32* %3
%77 = call i32 @KeyExpansion(i8* %74, i64* %75, i32 %76)
%78 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%79 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%80 = getelementptr inbounds [44 x i64], [44 x i64]* %10, i64 0, i64 0
%81 = call i32 @AES(i8* %78, i8* %79, i64* %80)
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %2
br label %83
83: ; preds = %93, %73
%84 = load i32, i32* %2
%85 = icmp slt i32 %84, 16
br i1 %85, label %86, label %96
86: ; preds = %83
%87 = load i32, i32* %2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %86
%94 = load i32, i32* %2
%95 = add nsw i32 %94, 1
store i32 %95, i32* %2
br label %83
96: ; preds = %83
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %2
br label %99
99: ; preds = %119, %96
%100 = load i32, i32* %2
%101 = icmp slt i32 %100, 16
br i1 %101, label %102, label %122
102: ; preds = %99
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%103 = load i32, i32* %2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %104
%106 = load i8, i8* %105
store volatile i8 %106, i8* inttoptr (i64 80 to i8*)
br label %107
107: ; preds = %111, %102
%108 = load i8, i8* inttoptr (i64 32 to i8*)
%109 = sext i8 %108 to i32
%110 = icmp ne i32 %109, 1
br i1 %110, label %111, label %112
111: ; preds = %107
br label %107
112: ; preds = %107
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
br label %113
113: ; preds = %117, %112
%114 = load i8, i8* inttoptr (i64 32 to i8*)
%115 = sext i8 %114 to i32
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %113
br label %113
118: ; preds = %113
br label %119
119: ; preds = %118
%120 = load i32, i32* %2
%121 = add nsw i32 %120, 1
store i32 %121, i32* %2
br label %99
122: ; preds = %99
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %124
124: ; preds = %144, %122
%125 = load i32, i32* %2
%126 = icmp slt i32 %125, 16
br i1 %126, label %127, label %147
127: ; preds = %124
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%128 = load i32, i32* %2
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 %129
%131 = load i8, i8* %130
store volatile i8 %131, i8* inttoptr (i64 80 to i8*)
br label %132
132: ; preds = %136, %127
%133 = load i8, i8* inttoptr (i64 32 to i8*)
%134 = sext i8 %133 to i32
%135 = icmp ne i32 %134, 1
br i1 %135, label %136, label %137
136: ; preds = %132
br label %132
137: ; preds = %132
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
br label %138
138: ; preds = %142, %137
%139 = load i8, i8* inttoptr (i64 32 to i8*)
%140 = sext i8 %139 to i32
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %143
142: ; preds = %138
br label %138
143: ; preds = %138
br label %144
144: ; preds = %143
%145 = load i32, i32* %2
%146 = add nsw i32 %145, 1
store i32 %146, i32* %2
br label %124
147: ; preds = %124
store volatile i8 3, i8* inttoptr (i64 64 to i8*)
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %149
149: ; preds = %153, %147
%150 = load i8, i8* inttoptr (i64 32 to i8*)
%151 = sext i8 %150 to i32
%152 = icmp ne i32 %151, 2
br i1 %152, label %153, label %154
153: ; preds = %149
br label %149
154: ; preds = %149
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %2
br label %156
156: ; preds = %176, %154
%157 = load i32, i32* %2
%158 = icmp slt i32 %157, 16
br i1 %158, label %159, label %179
159: ; preds = %156
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
br label %160
160: ; preds = %164, %159
%161 = load i8, i8* inttoptr (i64 32 to i8*)
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %162, 1
br i1 %163, label %164, label %165
164: ; preds = %160
br label %160
165: ; preds = %160
%166 = load i8, i8* inttoptr (i64 48 to i8*)
%167 = load i32, i32* %2
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %168
store i8 %166, i8* %169
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
br label %170
170: ; preds = %174, %165
%171 = load i8, i8* inttoptr (i64 32 to i8*)
%172 = sext i8 %171 to i32
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %175
174: ; preds = %170
br label %170
175: ; preds = %170
br label %176
176: ; preds = %175
%177 = load i32, i32* %2
%178 = add nsw i32 %177, 1
store i32 %178, i32* %2
br label %156
179: ; preds = %156
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %2
br label %182
182: ; preds = %192, %179
%183 = load i32, i32* %2
%184 = icmp slt i32 %183, 16
br i1 %184, label %185, label %195
185: ; preds = %182
%186 = load i32, i32* %2
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %187
%189 = load i8, i8* %188
%190 = zext i8 %189 to i32
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %190)
br label %192
192: ; preds = %185
%193 = load i32, i32* %2
%194 = add nsw i32 %193, 1
store i32 %194, i32* %2
br label %182
195: ; preds = %182
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%s\00"
@.str.6 = [5 x i8] c"%02x\00"
@str = [13 x i8] c"Press reset!\00"
@str.12 = [19 x i8] c"\0AEnter plain text:\00"
@str.13 = [12 x i8] c"\0AEnter key:\00"
@str.14 = [22 x i8] c"\0AEncrypted message is\00"
@str.15 = [25 x i8] c"\0ATransmitting message...\00"
@str.16 = [21 x i8] c"\0ATransmitting key...\00"
@str.18 = [23 x i8] c"\0ARetrieving message...\00"
@str.19 = [2 x i8] c"\0A\00"
@str.20 = [17 x i8] c"Decoded message:\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [32 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca [44 x i64]
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%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 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%14 = bitcast [44 x i64]* %7 to i8*
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
store volatile i8 0, i8* inttoptr (i64 80 to i8*)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%16 = load i8, i8* inttoptr (i64 32 to i8*)
%17 = icmp eq i8 %16, 3
br i1 %17, label %19, label %18
18: ; preds = %0, %18
br label %18
19: ; preds = %0
%20 = getelementptr inbounds [44 x i64], [44 x i64]* %7, i64 0, i64 0
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 1
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 2
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 3
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 4
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 5
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 6
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 7
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 8
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 9
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 10
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 11
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 12
%33 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 13
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 14
%35 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 15
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 2
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 3
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%40 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 5
%41 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%42 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 7
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
%44 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 9
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 11
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 12
%48 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 13
%49 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 14
%50 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 15
br label %51
51: ; preds = %19, %221
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
%52 = call i32 @putchar(i32 10)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.12, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%55 = call i32 @putchar(i32 10)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%57 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%58 = call i32 @putchar(i32 10)
br label %59
59: ; preds = %51, %59
%60 = phi i64 [ 0, %51 ], [ %69, %59 ]
%61 = shl nuw nsw i64 %60, 1
%62 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = or i64 %61, 1
%65 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = call zeroext i8 @charsToHex(i8 zeroext %63, i8 zeroext %66)
%68 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %60
store i8 %67, i8* %68
%69 = add nuw nsw i64 %60, 1
%70 = icmp eq i64 %69, 16
br i1 %70, label %71, label %59
71: ; preds = %59, %71
%72 = phi i64 [ %81, %71 ], [ 0, %59 ]
%73 = shl nuw nsw i64 %72, 1
%74 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = or i64 %73, 1
%77 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = call zeroext i8 @charsToHex(i8 zeroext %75, i8 zeroext %78)
%80 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %72
store i8 %79, i8* %80
%81 = add nuw nsw i64 %72, 1
%82 = icmp eq i64 %81, 16
br i1 %82, label %83, label %71
83: ; preds = %71
%84 = call i32 @KeyExpansion(i8* %13, i64* %20, i32 4)
%85 = call i32 @AES(i8* %12, i8* %11, i64* %20)
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0))
%87 = load i8, i8* %11
%88 = zext i8 %87 to i32
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %88)
%90 = load i8, i8* %21
%91 = zext i8 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %91)
%93 = load i8, i8* %22
%94 = zext i8 %93 to i32
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %94)
%96 = load i8, i8* %23
%97 = zext i8 %96 to i32
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %97)
%99 = load i8, i8* %24
%100 = zext i8 %99 to i32
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %100)
%102 = load i8, i8* %25
%103 = zext i8 %102 to i32
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %103)
%105 = load i8, i8* %26
%106 = zext i8 %105 to i32
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %106)
%108 = load i8, i8* %27
%109 = zext i8 %108 to i32
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %109)
%111 = load i8, i8* %28
%112 = zext i8 %111 to i32
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %112)
%114 = load i8, i8* %29
%115 = zext i8 %114 to i32
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %115)
%117 = load i8, i8* %30
%118 = zext i8 %117 to i32
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %118)
%120 = load i8, i8* %31
%121 = zext i8 %120 to i32
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %121)
%123 = load i8, i8* %32
%124 = zext i8 %123 to i32
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %124)
%126 = load i8, i8* %33
%127 = zext i8 %126 to i32
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %127)
%129 = load i8, i8* %34
%130 = zext i8 %129 to i32
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %130)
%132 = load i8, i8* %35
%133 = zext i8 %132 to i32
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %133)
%135 = call i32 @putchar(i32 10)
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
br label %149
137: ; preds = %157
%138 = or i64 %150, 1
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%139 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 %138
%140 = load i8, i8* %139
store volatile i8 %140, i8* inttoptr (i64 80 to i8*)
%141 = load i8, i8* inttoptr (i64 32 to i8*)
%142 = icmp eq i8 %141, 1
br i1 %142, label %143, label %155
143: ; preds = %137
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%144 = load i8, i8* inttoptr (i64 32 to i8*)
%145 = icmp eq i8 %144, 0
br i1 %145, label %146, label %160
146: ; preds = %143
%147 = add nuw nsw i64 %150, 2
%148 = icmp eq i64 %147, 16
br i1 %148, label %162, label %149
149: ; preds = %146, %83
%150 = phi i64 [ 0, %83 ], [ %147, %146 ]
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%151 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 %150
%152 = load i8, i8* %151
store volatile i8 %152, i8* inttoptr (i64 80 to i8*)
%153 = load i8, i8* inttoptr (i64 32 to i8*)
%154 = icmp eq i8 %153, 1
br i1 %154, label %157, label %155
155: ; preds = %137, %149
br label %156
156: ; preds = %155, %156
br label %156
157: ; preds = %149
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%158 = load i8, i8* inttoptr (i64 32 to i8*)
%159 = icmp eq i8 %158, 0
br i1 %159, label %137, label %160
160: ; preds = %143, %157
br label %161
161: ; preds = %160, %161
br label %161
162: ; preds = %146
store volatile i8 0, i8* inttoptr (i64 64 to i8*)
%163 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
br label %176
164: ; preds = %184
%165 = or i64 %177, 1
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%166 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %165
%167 = load i8, i8* %166
store volatile i8 %167, i8* inttoptr (i64 80 to i8*)
%168 = load i8, i8* inttoptr (i64 32 to i8*)
%169 = icmp eq i8 %168, 1
br i1 %169, label %170, label %182
170: ; preds = %164
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%171 = load i8, i8* inttoptr (i64 32 to i8*)
%172 = icmp eq i8 %171, 0
br i1 %172, label %173, label %187
173: ; preds = %170
%174 = add nuw nsw i64 %177, 2
%175 = icmp eq i64 %174, 16
br i1 %175, label %189, label %176
176: ; preds = %173, %162
%177 = phi i64 [ 0, %162 ], [ %174, %173 ]
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%178 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %177
%179 = load i8, i8* %178
store volatile i8 %179, i8* inttoptr (i64 80 to i8*)
%180 = load i8, i8* inttoptr (i64 32 to i8*)
%181 = icmp eq i8 %180, 1
br i1 %181, label %184, label %182
182: ; preds = %164, %176
br label %183
183: ; preds = %182, %183
br label %183
184: ; preds = %176
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%185 = load i8, i8* inttoptr (i64 32 to i8*)
%186 = icmp eq i8 %185, 0
br i1 %186, label %164, label %187
187: ; preds = %170, %184
br label %188
188: ; preds = %187, %188
br label %188
189: ; preds = %173
store volatile i8 3, i8* inttoptr (i64 64 to i8*)
%190 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%191 = load i8, i8* inttoptr (i64 32 to i8*)
%192 = icmp eq i8 %191, 2
br i1 %192, label %194, label %193
193: ; preds = %189, %193
br label %193
194: ; preds = %189
%195 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.18, i64 0, i64 0))
br label %208
196: ; preds = %214
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%197 = load i8, i8* inttoptr (i64 32 to i8*)
%198 = icmp eq i8 %197, 1
br i1 %198, label %199, label %212
199: ; preds = %196
%200 = or i64 %209, 1
%201 = load i8, i8* inttoptr (i64 48 to i8*)
%202 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %200
store i8 %201, i8* %202
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%203 = load i8, i8* inttoptr (i64 32 to i8*)
%204 = icmp eq i8 %203, 0
br i1 %204, label %205, label %219
205: ; preds = %199
%206 = add nuw nsw i64 %209, 2
%207 = icmp eq i64 %206, 16
br i1 %207, label %221, label %208
208: ; preds = %205, %194
%209 = phi i64 [ 0, %194 ], [ %206, %205 ]
store volatile i8 1, i8* inttoptr (i64 64 to i8*)
%210 = load i8, i8* inttoptr (i64 32 to i8*)
%211 = icmp eq i8 %210, 1
br i1 %211, label %214, label %212
212: ; preds = %196, %208
br label %213
213: ; preds = %212, %213
br label %213
214: ; preds = %208
%215 = load i8, i8* inttoptr (i64 48 to i8*)
%216 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %209
store i8 %215, i8* %216
store volatile i8 2, i8* inttoptr (i64 64 to i8*)
%217 = load i8, i8* inttoptr (i64 32 to i8*)
%218 = icmp eq i8 %217, 0
br i1 %218, label %196, label %219
219: ; preds = %199, %214
br label %220
220: ; preds = %219, %220
br label %220
221: ; preds = %205
%222 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%223 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.20, i64 0, i64 0))
%224 = load i8, i8* %10
%225 = zext i8 %224 to i32
%226 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %225)
%227 = load i8, i8* %36
%228 = zext i8 %227 to i32
%229 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %228)
%230 = load i8, i8* %37
%231 = zext i8 %230 to i32
%232 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %231)
%233 = load i8, i8* %38
%234 = zext i8 %233 to i32
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %234)
%236 = load i8, i8* %39
%237 = zext i8 %236 to i32
%238 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %237)
%239 = load i8, i8* %40
%240 = zext i8 %239 to i32
%241 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %240)
%242 = load i8, i8* %41
%243 = zext i8 %242 to i32
%244 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %243)
%245 = load i8, i8* %42
%246 = zext i8 %245 to i32
%247 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %246)
%248 = load i8, i8* %43
%249 = zext i8 %248 to i32
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %249)
%251 = load i8, i8* %44
%252 = zext i8 %251 to i32
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %252)
%254 = load i8, i8* %45
%255 = zext i8 %254 to i32
%256 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %255)
%257 = load i8, i8* %46
%258 = zext i8 %257 to i32
%259 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %258)
%260 = load i8, i8* %47
%261 = zext i8 %260 to i32
%262 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %261)
%263 = load i8, i8* %48
%264 = zext i8 %263 to i32
%265 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %264)
%266 = load i8, i8* %49
%267 = zext i8 %266 to i32
%268 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %267)
%269 = load i8, i8* %50
%270 = zext i8 %269 to i32
%271 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %270)
%272 = call i32 @putchar(i32 10)
br label %51
}