#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 */
scalar_t__ cmdcmp(int *, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ writeportb(int, int *, int);
int cmd_aa(int fd, int *f) {
  int answer2[] = {170, 8, 0, 48, 190};
  int answer4[] = {170, 16, 0, 113, 139};
  int op5[] = {170, 64, 0, 230, 62};
  int op15[] = {170, 65, 16, 161, 57};
  int start_order[] = {170, 128, 0, 204, 124};
  int end[] = {170, 128, 1, 69, 115};
  int answer1[] = {170, 128, 2, 222, 99};
  int timeout[] = {170, 128, 4, 232, 66};
  int answer3[] = {170, 192, 2, 56, 93};
  int op2[] = {170, 192, 9, 235, 49};
  int op14[] = {170, 192, 12, 70, 0};
  int op3[] = {170, 193, 16, 109, 69};
  int op6[] = {170, 194, 16, 39, 93};
  int op4[] = {170, 194, 17, 174, 82};
  int op10[] = {170, 195, 2, 114, 69};
  int op7[] = {170, 195, 15, 151, 8};
  int op11[] = {170, 196, 2, 32, 130};
  int op8[] = {170, 196, 16, 179, 109};
  int op9[] = {170, 197, 12, 152, 40};
  int op12[] = {170, 198, 12, 210, 48};
  int op16[] = {170, 198, 16, 63, 130};
  int op13[] = {170, 199, 12, 20, 199};
  if (cmdcmp(f, start_order, 5) == 0) {
    printf("0xAA: Start order found. Sending answer\n");
    writeportb(fd, answer1, 5);
  } else if (cmdcmp(f, op2, 5) == 0) {
  } else if (cmdcmp(f, op3, 5) == 0) {
  } else if (cmdcmp(f, op4, 5) == 0) {
  } else if (cmdcmp(f, op5, 5) == 0) {
  } else if (cmdcmp(f, op9, 5) == 0) {
  } else if (cmdcmp(f, op10, 5) == 0) {
  } else if (cmdcmp(f, op11, 5) == 0) {
  } else if (cmdcmp(f, op12, 5) == 0) {
  } else if (cmdcmp(f, op13, 5) == 0) {
  } else if (cmdcmp(f, op14, 5) == 0) {
  } else if (cmdcmp(f, op15, 5) == 0) {
  } else if (cmdcmp(f, op16, 5) == 0) {
  } else if (cmdcmp(f, timeout, 5) == 0) {
  } else if (cmdcmp(f, end, 5) == 0) {
    printf("0xAA: End of communication\n");
  } else {
    printf("> Unknown 0xAA cmd: ");
    printf("%i,%i,%i,%i,%i\n", f[0], f[1], f[2], f[3], f[4]);
  }
}


x86 assembly (clang, -O0):
<cmd_aa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d0,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb3(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xeb4(%rip),%eax
mov    %eax,-0x60(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xeaf(%rip),%eax
mov    %eax,-0x80(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xeaa(%rip),%eax
mov    %eax,-0xa0(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xea2(%rip),%eax
mov    %eax,-0xc0(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    0xe9a(%rip),%eax
mov    %eax,-0xe0(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xe92(%rip),%eax
mov    %eax,-0x100(%rbp)
mov    0xe95(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xe8f(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    0xe8a(%rip),%eax
mov    %eax,-0x120(%rbp)
mov    0xe8d(%rip),%rax
mov    %rax,-0x150(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x148(%rbp)
mov    0xe82(%rip),%eax
mov    %eax,-0x140(%rbp)
mov    0xfe5(%rip),%rax
mov    %rax,-0x170(%rbp)
mov    0xfdf(%rip),%rax
mov    %rax,-0x168(%rbp)
mov    0xfda(%rip),%eax
mov    %eax,-0x160(%rbp)
mov    0xe5d(%rip),%rax
mov    %rax,-0x190(%rbp)
mov    0xe57(%rip),%rax
mov    %rax,-0x188(%rbp)
mov    0xe52(%rip),%eax
mov    %eax,-0x180(%rbp)
mov    0xe55(%rip),%rax
mov    %rax,-0x1b0(%rbp)
mov    0xe4f(%rip),%rax
mov    %rax,-0x1a8(%rbp)
mov    0xe4a(%rip),%eax
mov    %eax,-0x1a0(%rbp)
mov    0xe4d(%rip),%rax
mov    %rax,-0x1d0(%rbp)
mov    0xe47(%rip),%rax
mov    %rax,-0x1c8(%rbp)
mov    0xe42(%rip),%eax
mov    %eax,-0x1c0(%rbp)
mov    0xe45(%rip),%rax
mov    %rax,-0x1f0(%rbp)
mov    0xe3f(%rip),%rax
mov    %rax,-0x1e8(%rbp)
mov    0xe3a(%rip),%eax
mov    %eax,-0x1e0(%rbp)
mov    0xe3d(%rip),%rax
mov    %rax,-0x210(%rbp)
mov    0xe37(%rip),%rax
mov    %rax,-0x208(%rbp)
mov    0xe32(%rip),%eax
mov    %eax,-0x200(%rbp)
mov    0xe35(%rip),%rax
mov    %rax,-0x230(%rbp)
mov    0xe2f(%rip),%rax
mov    %rax,-0x228(%rbp)
mov    0xe2a(%rip),%eax
mov    %eax,-0x220(%rbp)
mov    0xe2d(%rip),%rax
mov    %rax,-0x250(%rbp)
mov    0xe27(%rip),%rax
mov    %rax,-0x248(%rbp)
mov    0xe22(%rip),%eax
mov    %eax,-0x240(%rbp)
mov    0xe25(%rip),%rax
mov    %rax,-0x270(%rbp)
mov    0xe1f(%rip),%rax
mov    %rax,-0x268(%rbp)
mov    0xe1a(%rip),%eax
mov    %eax,-0x260(%rbp)
mov    0xe1d(%rip),%rax
mov    %rax,-0x290(%rbp)
mov    0xe17(%rip),%rax
mov    %rax,-0x288(%rbp)
mov    0xe12(%rip),%eax
mov    %eax,-0x280(%rbp)
mov    0xe15(%rip),%rax
mov    %rax,-0x2b0(%rbp)
mov    0xe0f(%rip),%rax
mov    %rax,-0x2a8(%rbp)
mov    0xe0a(%rip),%eax
mov    %eax,-0x2a0(%rbp)
mov    0xe0d(%rip),%rax
mov    %rax,-0x2d0(%rbp)
mov    0xe07(%rip),%rax
mov    %rax,-0x2c8(%rbp)
mov    0xe02(%rip),%eax
mov    %eax,-0x2c0(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    14da <cmd_aa+0x3aa>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0xf0(%rbp),%rsi
mov    $0x5,%edx
call   1030 <writeportb@plt>
jmp    1763 <cmd_aa+0x633>
mov    -0x10(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    14fe <cmd_aa+0x3ce>
jmp    175e <cmd_aa+0x62e>
mov    -0x10(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    1522 <cmd_aa+0x3f2>
jmp    1759 <cmd_aa+0x629>
mov    -0x10(%rbp),%rdi
lea    -0x1d0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    1546 <cmd_aa+0x416>
jmp    1754 <cmd_aa+0x624>
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    1567 <cmd_aa+0x437>
jmp    174f <cmd_aa+0x61f>
mov    -0x10(%rbp),%rdi
lea    -0x270(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    158b <cmd_aa+0x45b>
jmp    174a <cmd_aa+0x61a>
mov    -0x10(%rbp),%rdi
lea    -0x1f0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    15af <cmd_aa+0x47f>
jmp    1745 <cmd_aa+0x615>
mov    -0x10(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    15d3 <cmd_aa+0x4a3>
jmp    1740 <cmd_aa+0x610>
mov    -0x10(%rbp),%rdi
lea    -0x290(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    15f7 <cmd_aa+0x4c7>
jmp    173b <cmd_aa+0x60b>
mov    -0x10(%rbp),%rdi
lea    -0x2d0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    161b <cmd_aa+0x4eb>
jmp    1736 <cmd_aa+0x606>
mov    -0x10(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    163f <cmd_aa+0x50f>
jmp    1731 <cmd_aa+0x601>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    1663 <cmd_aa+0x533>
jmp    172c <cmd_aa+0x5fc>
mov    -0x10(%rbp),%rdi
lea    -0x2b0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    1687 <cmd_aa+0x557>
jmp    1727 <cmd_aa+0x5f7>
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    16ab <cmd_aa+0x57b>
jmp    1722 <cmd_aa+0x5f2>
mov    -0x10(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x5,%edx
call   1050 <cmdcmp@plt>
cmp    $0x0,%rax
jne    16dd <cmd_aa+0x5ad>
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    171d <cmd_aa+0x5ed>
lea    0xc15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r9d
lea    0xbf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1722 <cmd_aa+0x5f2>
jmp    1727 <cmd_aa+0x5f7>
jmp    172c <cmd_aa+0x5fc>
jmp    1731 <cmd_aa+0x601>
jmp    1736 <cmd_aa+0x606>
jmp    173b <cmd_aa+0x60b>
jmp    1740 <cmd_aa+0x610>
jmp    1745 <cmd_aa+0x615>
jmp    174a <cmd_aa+0x61a>
jmp    174f <cmd_aa+0x61f>
jmp    1754 <cmd_aa+0x624>
jmp    1759 <cmd_aa+0x629>
jmp    175e <cmd_aa+0x62e>
jmp    1763 <cmd_aa+0x633>
mov    -0x4(%rbp),%eax
add    $0x2d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_aa>:
push   %rbp
push   %rbx
sub    $0x1f8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0xebc(%rip),%eax
mov    %eax,0x1f0(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,0x1e0(%rsp)
mov    0xec0(%rip),%eax
mov    %eax,0x1d0(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x1c0(%rsp)
mov    0xec4(%rip),%eax
mov    %eax,0x1b0(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
mov    0xec8(%rip),%eax
mov    %eax,0x190(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
mov    0xecc(%rip),%eax
mov    %eax,0x170(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
mov    0xed0(%rip),%eax
mov    %eax,0x150(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x130(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
mov    0xfd8(%rip),%eax
mov    %eax,0x110(%rsp)
movaps 0xfba(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
mov    0xebc(%rip),%eax
mov    %eax,0xf0(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
mov    0xec0(%rip),%eax
mov    %eax,0xd0(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
mov    0xec4(%rip),%eax
mov    %eax,0xb0(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
mov    0xec8(%rip),%eax
mov    %eax,0x90(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
mov    0xecc(%rip),%eax
mov    %eax,0x70(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
mov    0xed6(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xee0(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeea(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x1a0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14cf <cmd_aa+0x38f>
lea    0x120(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0xe0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0xc0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x1e0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0xa0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x80(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x100(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x1c0(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x140(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14ef <cmd_aa+0x3af>
lea    0x180(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1060 <cmdcmp@plt>
test   %rax,%rax
je     14f9 <cmd_aa+0x3b9>
lea    0xd4c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
mov    0x10(%rbx),%r9d
lea    0xd43(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    14ef <cmd_aa+0x3af>
lea    0xd5e(%rip),%rdi
call   1030 <puts@plt>
lea    0x160(%rsp),%rsi
mov    %ebp,%edi
mov    $0x5,%edx
call   1040 <writeportb@plt>
add    $0x1f8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xd19(%rip),%rdi
call   1030 <puts@plt>
jmp    14ef <cmd_aa+0x3af>

LLVM IR (-O0):
@__const.cmd_aa.answer2 = [5 x i32] [i32 170, i32 8, i32 0, i32 48, i32 190]
@__const.cmd_aa.answer4 = [5 x i32] [i32 170, i32 16, i32 0, i32 113, i32 139]
@__const.cmd_aa.op5 = [5 x i32] [i32 170, i32 64, i32 0, i32 230, i32 62]
@__const.cmd_aa.op15 = [5 x i32] [i32 170, i32 65, i32 16, i32 161, i32 57]
@__const.cmd_aa.start_order = [5 x i32] [i32 170, i32 128, i32 0, i32 204, i32 124]
@__const.cmd_aa.end = [5 x i32] [i32 170, i32 128, i32 1, i32 69, i32 115]
@__const.cmd_aa.answer1 = [5 x i32] [i32 170, i32 128, i32 2, i32 222, i32 99]
@__const.cmd_aa.timeout = [5 x i32] [i32 170, i32 128, i32 4, i32 232, i32 66]
@__const.cmd_aa.answer3 = [5 x i32] [i32 170, i32 192, i32 2, i32 56, i32 93]
@__const.cmd_aa.op2 = [5 x i32] [i32 170, i32 192, i32 9, i32 235, i32 49]
@__const.cmd_aa.op14 = [5 x i32] [i32 170, i32 192, i32 12, i32 70, i32 0]
@__const.cmd_aa.op3 = [5 x i32] [i32 170, i32 193, i32 16, i32 109, i32 69]
@__const.cmd_aa.op6 = [5 x i32] [i32 170, i32 194, i32 16, i32 39, i32 93]
@__const.cmd_aa.op4 = [5 x i32] [i32 170, i32 194, i32 17, i32 174, i32 82]
@__const.cmd_aa.op10 = [5 x i32] [i32 170, i32 195, i32 2, i32 114, i32 69]
@__const.cmd_aa.op7 = [5 x i32] [i32 170, i32 195, i32 15, i32 151, i32 8]
@__const.cmd_aa.op11 = [5 x i32] [i32 170, i32 196, i32 2, i32 32, i32 130]
@__const.cmd_aa.op8 = [5 x i32] [i32 170, i32 196, i32 16, i32 179, i32 109]
@__const.cmd_aa.op9 = [5 x i32] [i32 170, i32 197, i32 12, i32 152, i32 40]
@__const.cmd_aa.op12 = [5 x i32] [i32 170, i32 198, i32 12, i32 210, i32 48]
@__const.cmd_aa.op16 = [5 x i32] [i32 170, i32 198, i32 16, i32 63, i32 130]
@__const.cmd_aa.op13 = [5 x i32] [i32 170, i32 199, i32 12, i32 20, i32 199]
@.str = [41 x i8] c"0xAA: Start order found. Sending answer\0A\00"
@.str.1 = [28 x i8] c"0xAA: End of communication\0A\00"
@.str.2 = [21 x i8] c"> Unknown 0xAA cmd: \00"
@.str.3 = [16 x i8] c"%i,%i,%i,%i,%i\0A\00"
define i32 @cmd_aa(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
%8 = alloca [5 x i32]
%9 = alloca [5 x i32]
%10 = alloca [5 x i32]
%11 = alloca [5 x i32]
%12 = alloca [5 x i32]
%13 = alloca [5 x i32]
%14 = alloca [5 x i32]
%15 = alloca [5 x i32]
%16 = alloca [5 x i32]
%17 = alloca [5 x i32]
%18 = alloca [5 x i32]
%19 = alloca [5 x i32]
%20 = alloca [5 x i32]
%21 = alloca [5 x i32]
%22 = alloca [5 x i32]
%23 = alloca [5 x i32]
%24 = alloca [5 x i32]
%25 = alloca [5 x i32]
%26 = alloca [5 x i32]
%27 = alloca [5 x i32]
store i32 %0, i32* %4
store i32* %1, i32** %5
%28 = bitcast [5 x i32]* %6 to i8*
%29 = bitcast [5 x i32]* %7 to i8*
%30 = bitcast [5 x i32]* %8 to i8*
%31 = bitcast [5 x i32]* %9 to i8*
%32 = bitcast [5 x i32]* %10 to i8*
%33 = bitcast [5 x i32]* %11 to i8*
%34 = bitcast [5 x i32]* %12 to i8*
%35 = bitcast [5 x i32]* %13 to i8*
%36 = bitcast [5 x i32]* %14 to i8*
%37 = bitcast [5 x i32]* %15 to i8*
%38 = bitcast [5 x i32]* %16 to i8*
%39 = bitcast [5 x i32]* %17 to i8*
%40 = bitcast [5 x i32]* %18 to i8*
%41 = bitcast [5 x i32]* %19 to i8*
%42 = bitcast [5 x i32]* %20 to i8*
%43 = bitcast [5 x i32]* %21 to i8*
%44 = bitcast [5 x i32]* %22 to i8*
%45 = bitcast [5 x i32]* %23 to i8*
%46 = bitcast [5 x i32]* %24 to i8*
%47 = bitcast [5 x i32]* %25 to i8*
%48 = bitcast [5 x i32]* %26 to i8*
%49 = bitcast [5 x i32]* %27 to i8*
%50 = load i32*, i32** %5
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 0
%52 = call i64 @cmdcmp(i32* %50, i32* %51, i32 5)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %2
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%56 = load i32, i32* %4
%57 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 0
%58 = call i32 @writeportb(i32 %56, i32* %57, i32 5)
br label %176
59: ; preds = %2
%60 = load i32*, i32** %5
%61 = getelementptr inbounds [5 x i32], [5 x i32]* %15, i64 0, i64 0
%62 = call i64 @cmdcmp(i32* %60, i32* %61, i32 5)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %59
br label %175
65: ; preds = %59
%66 = load i32*, i32** %5
%67 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 0
%68 = call i64 @cmdcmp(i32* %66, i32* %67, i32 5)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %65
br label %174
71: ; preds = %65
%72 = load i32*, i32** %5
%73 = getelementptr inbounds [5 x i32], [5 x i32]* %19, i64 0, i64 0
%74 = call i64 @cmdcmp(i32* %72, i32* %73, i32 5)
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %71
br label %173
77: ; preds = %71
%78 = load i32*, i32** %5
%79 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%80 = call i64 @cmdcmp(i32* %78, i32* %79, i32 5)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %77
br label %172
83: ; preds = %77
%84 = load i32*, i32** %5
%85 = getelementptr inbounds [5 x i32], [5 x i32]* %24, i64 0, i64 0
%86 = call i64 @cmdcmp(i32* %84, i32* %85, i32 5)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %83
br label %171
89: ; preds = %83
%90 = load i32*, i32** %5
%91 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 0
%92 = call i64 @cmdcmp(i32* %90, i32* %91, i32 5)
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %95
94: ; preds = %89
br label %170
95: ; preds = %89
%96 = load i32*, i32** %5
%97 = getelementptr inbounds [5 x i32], [5 x i32]* %22, i64 0, i64 0
%98 = call i64 @cmdcmp(i32* %96, i32* %97, i32 5)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %101
100: ; preds = %95
br label %169
101: ; preds = %95
%102 = load i32*, i32** %5
%103 = getelementptr inbounds [5 x i32], [5 x i32]* %25, i64 0, i64 0
%104 = call i64 @cmdcmp(i32* %102, i32* %103, i32 5)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %107
106: ; preds = %101
br label %168
107: ; preds = %101
%108 = load i32*, i32** %5
%109 = getelementptr inbounds [5 x i32], [5 x i32]* %27, i64 0, i64 0
%110 = call i64 @cmdcmp(i32* %108, i32* %109, i32 5)
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %107
br label %167
113: ; preds = %107
%114 = load i32*, i32** %5
%115 = getelementptr inbounds [5 x i32], [5 x i32]* %16, i64 0, i64 0
%116 = call i64 @cmdcmp(i32* %114, i32* %115, i32 5)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %119
118: ; preds = %113
br label %166
119: ; preds = %113
%120 = load i32*, i32** %5
%121 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%122 = call i64 @cmdcmp(i32* %120, i32* %121, i32 5)
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %125
124: ; preds = %119
br label %165
125: ; preds = %119
%126 = load i32*, i32** %5
%127 = getelementptr inbounds [5 x i32], [5 x i32]* %26, i64 0, i64 0
%128 = call i64 @cmdcmp(i32* %126, i32* %127, i32 5)
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %131
130: ; preds = %125
br label %164
131: ; preds = %125
%132 = load i32*, i32** %5
%133 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%134 = call i64 @cmdcmp(i32* %132, i32* %133, i32 5)
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %137
136: ; preds = %131
br label %163
137: ; preds = %131
%138 = load i32*, i32** %5
%139 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%140 = call i64 @cmdcmp(i32* %138, i32* %139, i32 5)
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %137
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %162
144: ; preds = %137
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%146 = load i32*, i32** %5
%147 = getelementptr inbounds i32, i32* %146, i64 0
%148 = load i32, i32* %147
%149 = load i32*, i32** %5
%150 = getelementptr inbounds i32, i32* %149, i64 1
%151 = load i32, i32* %150
%152 = load i32*, i32** %5
%153 = getelementptr inbounds i32, i32* %152, i64 2
%154 = load i32, i32* %153
%155 = load i32*, i32** %5
%156 = getelementptr inbounds i32, i32* %155, i64 3
%157 = load i32, i32* %156
%158 = load i32*, i32** %5
%159 = getelementptr inbounds i32, i32* %158, i64 4
%160 = load i32, i32* %159
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %148, i32 %151, i32 %154, i32 %157, i32 %160)
br label %162
162: ; preds = %144, %142
br label %163
163: ; preds = %162, %136
br label %164
164: ; preds = %163, %130
br label %165
165: ; preds = %164, %124
br label %166
166: ; preds = %165, %118
br label %167
167: ; preds = %166, %112
br label %168
168: ; preds = %167, %106
br label %169
169: ; preds = %168, %100
br label %170
170: ; preds = %169, %94
br label %171
171: ; preds = %170, %88
br label %172
172: ; preds = %171, %82
br label %173
173: ; preds = %172, %76
br label %174
174: ; preds = %173, %70
br label %175
175: ; preds = %174, %64
br label %176
176: ; preds = %175, %54
%177 = load i32, i32* %3
ret i32 %177
}

LLVM IR (-O2):
@__const.cmd_aa.op5 = [5 x i32] [i32 170, i32 64, i32 0, i32 230, i32 62]
@__const.cmd_aa.op15 = [5 x i32] [i32 170, i32 65, i32 16, i32 161, i32 57]
@__const.cmd_aa.start_order = [5 x i32] [i32 170, i32 128, i32 0, i32 204, i32 124]
@__const.cmd_aa.end = [5 x i32] [i32 170, i32 128, i32 1, i32 69, i32 115]
@__const.cmd_aa.answer1 = [5 x i32] [i32 170, i32 128, i32 2, i32 222, i32 99]
@__const.cmd_aa.timeout = [5 x i32] [i32 170, i32 128, i32 4, i32 232, i32 66]
@__const.cmd_aa.op2 = [5 x i32] [i32 170, i32 192, i32 9, i32 235, i32 49]
@__const.cmd_aa.op14 = [5 x i32] [i32 170, i32 192, i32 12, i32 70, i32 0]
@__const.cmd_aa.op3 = [5 x i32] [i32 170, i32 193, i32 16, i32 109, i32 69]
@__const.cmd_aa.op4 = [5 x i32] [i32 170, i32 194, i32 17, i32 174, i32 82]
@__const.cmd_aa.op10 = [5 x i32] [i32 170, i32 195, i32 2, i32 114, i32 69]
@__const.cmd_aa.op11 = [5 x i32] [i32 170, i32 196, i32 2, i32 32, i32 130]
@__const.cmd_aa.op9 = [5 x i32] [i32 170, i32 197, i32 12, i32 152, i32 40]
@__const.cmd_aa.op12 = [5 x i32] [i32 170, i32 198, i32 12, i32 210, i32 48]
@__const.cmd_aa.op16 = [5 x i32] [i32 170, i32 198, i32 16, i32 63, i32 130]
@__const.cmd_aa.op13 = [5 x i32] [i32 170, i32 199, i32 12, i32 20, i32 199]
@.str.2 = [21 x i8] c"> Unknown 0xAA cmd: \00"
@.str.3 = [16 x i8] c"%i,%i,%i,%i,%i\0A\00"
@str = [27 x i8] c"0xAA: End of communication\00"
@str.4 = [40 x i8] c"0xAA: Start order found. Sending answer\00"
define i32 @cmd_aa(i32 %0, i32* %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca [5 x i32]
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
%8 = alloca [5 x i32]
%9 = alloca [5 x i32]
%10 = alloca [5 x i32]
%11 = alloca [5 x i32]
%12 = alloca [5 x i32]
%13 = alloca [5 x i32]
%14 = alloca [5 x i32]
%15 = alloca [5 x i32]
%16 = alloca [5 x i32]
%17 = alloca [5 x i32]
%18 = alloca [5 x i32]
%19 = bitcast [5 x i32]* %3 to i8*
%20 = bitcast [5 x i32]* %4 to i8*
%21 = bitcast [5 x i32]* %5 to i8*
%22 = bitcast [5 x i32]* %6 to i8*
%23 = bitcast [5 x i32]* %7 to i8*
%24 = bitcast [5 x i32]* %8 to i8*
%25 = bitcast [5 x i32]* %9 to i8*
%26 = bitcast [5 x i32]* %10 to i8*
%27 = bitcast [5 x i32]* %11 to i8*
%28 = bitcast [5 x i32]* %12 to i8*
%29 = bitcast [5 x i32]* %13 to i8*
%30 = bitcast [5 x i32]* %14 to i8*
%31 = bitcast [5 x i32]* %15 to i8*
%32 = bitcast [5 x i32]* %16 to i8*
%33 = bitcast [5 x i32]* %17 to i8*
%34 = bitcast [5 x i32]* %18 to i8*
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%36 = call i64 @cmdcmp(i32* %1, i32* %35, i32 5)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %2
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%41 = call i32 @writeportb(i32 %0, i32* %40, i32 5)
br label %112
42: ; preds = %2
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%44 = call i64 @cmdcmp(i32* %1, i32* %43, i32 5)
%45 = icmp eq i64 %44, 0
br i1 %45, label %112, label %46
46: ; preds = %42
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%48 = call i64 @cmdcmp(i32* %1, i32* %47, i32 5)
%49 = icmp eq i64 %48, 0
br i1 %49, label %112, label %50
50: ; preds = %46
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 0
%52 = call i64 @cmdcmp(i32* %1, i32* %51, i32 5)
%53 = icmp eq i64 %52, 0
br i1 %53, label %112, label %54
54: ; preds = %50
%55 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%56 = call i64 @cmdcmp(i32* %1, i32* %55, i32 5)
%57 = icmp eq i64 %56, 0
br i1 %57, label %112, label %58
58: ; preds = %54
%59 = getelementptr inbounds [5 x i32], [5 x i32]* %15, i64 0, i64 0
%60 = call i64 @cmdcmp(i32* %1, i32* %59, i32 5)
%61 = icmp eq i64 %60, 0
br i1 %61, label %112, label %62
62: ; preds = %58
%63 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%64 = call i64 @cmdcmp(i32* %1, i32* %63, i32 5)
%65 = icmp eq i64 %64, 0
br i1 %65, label %112, label %66
66: ; preds = %62
%67 = getelementptr inbounds [5 x i32], [5 x i32]* %14, i64 0, i64 0
%68 = call i64 @cmdcmp(i32* %1, i32* %67, i32 5)
%69 = icmp eq i64 %68, 0
br i1 %69, label %112, label %70
70: ; preds = %66
%71 = getelementptr inbounds [5 x i32], [5 x i32]* %16, i64 0, i64 0
%72 = call i64 @cmdcmp(i32* %1, i32* %71, i32 5)
%73 = icmp eq i64 %72, 0
br i1 %73, label %112, label %74
74: ; preds = %70
%75 = getelementptr inbounds [5 x i32], [5 x i32]* %18, i64 0, i64 0
%76 = call i64 @cmdcmp(i32* %1, i32* %75, i32 5)
%77 = icmp eq i64 %76, 0
br i1 %77, label %112, label %78
78: ; preds = %74
%79 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0, i64 0
%80 = call i64 @cmdcmp(i32* %1, i32* %79, i32 5)
%81 = icmp eq i64 %80, 0
br i1 %81, label %112, label %82
82: ; preds = %78
%83 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%84 = call i64 @cmdcmp(i32* %1, i32* %83, i32 5)
%85 = icmp eq i64 %84, 0
br i1 %85, label %112, label %86
86: ; preds = %82
%87 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 0
%88 = call i64 @cmdcmp(i32* %1, i32* %87, i32 5)
%89 = icmp eq i64 %88, 0
br i1 %89, label %112, label %90
90: ; preds = %86
%91 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%92 = call i64 @cmdcmp(i32* %1, i32* %91, i32 5)
%93 = icmp eq i64 %92, 0
br i1 %93, label %112, label %94
94: ; preds = %90
%95 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%96 = call i64 @cmdcmp(i32* %1, i32* %95, i32 5)
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %94
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %112
100: ; preds = %94
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%102 = load i32, i32* %1
%103 = getelementptr inbounds i32, i32* %1, i64 1
%104 = load i32, i32* %103
%105 = getelementptr inbounds i32, i32* %1, i64 2
%106 = load i32, i32* %105
%107 = getelementptr inbounds i32, i32* %1, i64 3
%108 = load i32, i32* %107
%109 = getelementptr inbounds i32, i32* %1, i64 4
%110 = load i32, i32* %109
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %102, i32 %104, i32 %106, i32 %108, i32 %110)
br label %112
112: ; preds = %42, %50, %58, %66, %74, %82, %90, %100, %98, %86, %78, %70, %62, %54, %46, %38
ret i32 undef
}