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

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ regs;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, char *, char *);
int rand();
int sscanf(char *, char *, int *, int *, ...);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  uint8_t regs[8];
  char buf[1000];
  int i, i0, i1, i2, v2, reset_perform;
  reset_perform = 0;
  if (argc == 2 && (strcmp(argv[1], "-r") == 0)) {
    reset_perform++;
  }
  for (i = 0; i < sizeof(regs) / sizeof(regs[0]); i++) {
    regs[i] = reset_perform ? 0 : rand();
  }
  buf[0] = '\0';
  do {
    if (sscanf(buf, "mov r%d,r%d", &i0, &i1) == 2) {
      regs[i0 % 8] = regs[i1 % 8];
    }
    if (sscanf(buf, "add r%d,r%d,r%d", &i0, &i1, &i2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] + regs[i2 % 8];
    }
    if (sscanf(buf, "addi r%d,r%d,%d", &i0, &i1, &v2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] + v2;
    }
    if (sscanf(buf, "sub r%d,r%d,r%d", &i0, &i1, &i2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] - regs[i2 % 8];
    }
    if (sscanf(buf, "subi r%d,r%d,%d", &i0, &i1, &v2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] - v2;
    }
    if (sscanf(buf, "and r%d,r%d,r%d", &i0, &i1, &i2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] & regs[i2 % 8];
    }
    if (sscanf(buf, "andi r%d,r%d,%d", &i0, &i1, &v2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] & v2;
    }
    if (sscanf(buf, "or r%d,r%d,r%d", &i0, &i1, &i2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] | regs[i2 % 8];
    }
    if (sscanf(buf, "ori r%d,r%d,%d", &i0, &i1, &v2) == 3) {
      regs[i0 % 8] = regs[i1 % 8] | v2;
    }
    buf[((0) > (strlen(buf) - 1)) ? (0) : (strlen(buf) - 1)] = 0;
    for (i = 0; i < 8; i++) {
      printf("reg%1d=%02x %s %s", i, regs[i], i == 7 ? buf : "",
             i == 7 ? "\n" : " ");
    }
  } while (fgets(buf, sizeof(buf), stdin));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x438(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11ba <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe64(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ba <main+0x5a>
mov    -0x438(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x438(%rbp)
movl   $0x0,-0x424(%rbp)
movslq -0x424(%rbp),%rax
cmp    $0x8,%rax
jae    1221 <main+0xc1>
cmpl   $0x0,-0x438(%rbp)
je     11ef <main+0x8f>
xor    %eax,%eax
mov    %eax,-0x43c(%rbp)
jmp    11fc <main+0x9c>
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x43c(%rbp)
mov    -0x43c(%rbp),%ecx
movslq -0x424(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    11c4 <main+0x64>
movb   $0x0,-0x420(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xdcd(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x2,%eax
jne    127e <main+0x11e>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xd83(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x430(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    12f0 <main+0x190>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x430(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
add    -0x30(%rbp,%rax,4),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xd21(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    1353 <main+0x1f3>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
add    -0x434(%rbp),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xcce(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x430(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    13c5 <main+0x265>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x430(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
sub    -0x30(%rbp,%rax,4),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xc6c(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    1428 <main+0x2c8>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
sub    -0x434(%rbp),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xc19(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x430(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    149a <main+0x33a>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x430(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
and    -0x30(%rbp,%rax,4),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xbb7(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    14fd <main+0x39d>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
and    -0x434(%rbp),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xb64(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x430(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    156f <main+0x40f>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x430(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
or     -0x30(%rbp,%rax,4),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
lea    0xb01(%rip),%rsi
lea    -0x428(%rbp),%rdx
lea    -0x42c(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    15d2 <main+0x472>
mov    -0x42c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
or     -0x434(%rbp),%ecx
mov    -0x428(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
lea    -0x420(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    15fa <main+0x49a>
xor    %eax,%eax
mov    %eax,-0x440(%rbp)
jmp    160f <main+0x4af>
lea    -0x420(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x440(%rbp)
mov    -0x440(%rbp),%eax
cltq
movb   $0x0,-0x420(%rbp,%rax,1)
movl   $0x0,-0x424(%rbp)
cmpl   $0x8,-0x424(%rbp)
jge    16d4 <main+0x574>
mov    -0x424(%rbp),%eax
mov    %eax,-0x448(%rbp)
movslq -0x424(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x444(%rbp)
cmpl   $0x7,-0x424(%rbp)
jne    1673 <main+0x513>
lea    -0x420(%rbp),%rax
mov    %rax,-0x450(%rbp)
jmp    1686 <main+0x526>
lea    0xa26(%rip),%rax
mov    %rax,-0x450(%rbp)
jmp    1686 <main+0x526>
mov    -0x444(%rbp),%edx
mov    -0x448(%rbp),%esi
mov    -0x450(%rbp),%rcx
mov    -0x424(%rbp),%edi
lea    0x9fb(%rip),%r8
lea    0x9f2(%rip),%rax
cmp    $0x7,%edi
cmove  %rax,%r8
lea    0x9d2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    1629 <main+0x4c9>
jmp    16d9 <main+0x579>
lea    -0x420(%rbp),%rdi
mov    0x2901(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jne    1228 <main+0xc8>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
cmp    $0x2,%edi
jne    118b <main+0x2b>
mov    0x8(%rsi),%rdi
lea    0xe7f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11e1 <main+0x81>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x10(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x14(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x18(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x1c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x20(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x24(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,0x28(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
jmp    11f0 <main+0x90>
xorps  %xmm0,%xmm0
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %eax,%eax
mov    %eax,0x2c(%rsp)
movb   $0x0,0x30(%rsp)
lea    0x30(%rsp),%rbx
lea    0x4(%rsp),%r15
mov    %rsp,%r12
lea    0xe80(%rip),%r14
lea    0xe8c(%rip),%rbp
lea    0xe86(%rip),%r13
jmp    131a <main+0x1ba>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1650 <main+0x4f0>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0xffffffff,%eax
cltq
movb   $0x0,0x30(%rsp,%rax,1)
mov    0x10(%rsp),%edx
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x14(%rsp),%edx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x18(%rsp),%edx
mov    %r14,%rdi
mov    $0x2,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x1c(%rsp),%edx
mov    %r14,%rdi
mov    $0x3,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x20(%rsp),%edx
mov    %r14,%rdi
mov    $0x4,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    %r14,%rdi
mov    $0x5,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x28(%rsp),%edx
mov    %r14,%rdi
mov    $0x6,%esi
mov    %rbp,%rcx
mov    %r13,%r8
call   1040 <printf@plt>
mov    0x2c(%rsp),%edx
mov    %r14,%rdi
mov    $0x7,%esi
mov    %rbx,%rcx
lea    0xda9(%rip),%r8
call   1040 <printf@plt>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1657 <main+0x4f7>
mov    %rbx,%rdi
lea    0xcdf(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x2,%eax
jne    1364 <main+0x204>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x10(%rsp,%rax,4),%eax
mov    0x4(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    %eax,0x10(%rsp,%rcx,4)
mov    %rbx,%rdi
lea    0xca1(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    13ca <main+0x26a>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
mov    0xc(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
cltq
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    0x10(%rsp,%rcx,4),%ecx
add    0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
lea    0xc4b(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0x8(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    141c <main+0x2bc>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x8(%rsp),%ecx
add    0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
lea    0xc09(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    1483 <main+0x323>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x10(%rsp,%rax,4),%eax
mov    0xc(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
sub    0x10(%rsp,%rcx,4),%eax
mov    0x4(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    %eax,0x10(%rsp,%rcx,4)
mov    %rbx,%rdi
lea    0xbb2(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0x8(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    14d6 <main+0x376>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x10(%rsp,%rax,4),%eax
sub    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    %eax,0x10(%rsp,%rcx,4)
mov    %rbx,%rdi
lea    0xb6f(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    153c <main+0x3dc>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
mov    0xc(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
cltq
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    0x10(%rsp,%rcx,4),%ecx
and    0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
lea    0xb19(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0x8(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    158e <main+0x42e>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x8(%rsp),%ecx
and    0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
lea    0xad7(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    15f4 <main+0x494>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
mov    0xc(%rsp),%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
cltq
and    $0xfffffff8,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    0x10(%rsp,%rcx,4),%ecx
or     0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
mov    %rbx,%rdi
lea    0xa80(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
lea    0x8(%rsp),%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x3,%eax
jne    1220 <main+0xc0>
mov    (%rsp),%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
cltq
mov    0x8(%rsp),%ecx
or     0x10(%rsp,%rax,4),%ecx
mov    0x4(%rsp),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%eax
cltq
mov    %ecx,0x10(%rsp,%rax,4)
jmp    1220 <main+0xc0>
nop
xor    %eax,%eax
jmp    123b <main+0xdb>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-r\00"
@.str.1 = [12 x i8] c"mov r%d,r%d\00"
@.str.2 = [16 x i8] c"add r%d,r%d,r%d\00"
@.str.3 = [16 x i8] c"addi r%d,r%d,%d\00"
@.str.4 = [16 x i8] c"sub r%d,r%d,r%d\00"
@.str.5 = [16 x i8] c"subi r%d,r%d,%d\00"
@.str.6 = [16 x i8] c"and r%d,r%d,r%d\00"
@.str.7 = [16 x i8] c"andi r%d,r%d,%d\00"
@.str.8 = [15 x i8] c"or r%d,r%d,r%d\00"
@.str.9 = [15 x i8] c"ori r%d,r%d,%d\00"
@.str.10 = [18 x i8] c"reg%1d=%02x %s %s\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [2 x i8] c" \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
%7 = alloca [1000 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i32, i32* %13
%24 = add nsw i32 %23, 1
store i32 %24, i32* %13
br label %25
25: ; preds = %22, %16, %2
store i32 0, i32* %8
br label %26
26: ; preds = %41, %25
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = icmp ult i64 %28, 8
br i1 %29, label %30, label %44
30: ; preds = %26
%31 = load i32, i32* %13
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30
br label %36
34: ; preds = %30
%35 = call i32 (...) @rand()
br label %36
36: ; preds = %34, %33
%37 = phi i32 [ 0, %33 ], [ %35, %34 ]
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %39
store i32 %37, i32* %40
br label %41
41: ; preds = %36
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %26
44: ; preds = %26
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
store i8 0, i8* %45
br label %46
46: ; preds = %243, %44
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%48 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %9, i32* %10)
%49 = icmp eq i32 %48, 2
br i1 %49, label %50, label %60
50: ; preds = %46
%51 = load i32, i32* %10
%52 = srem i32 %51, 8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %9
%57 = srem i32 %56, 8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %58
store i32 %55, i32* %59
br label %60
60: ; preds = %50, %46
%61 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%62 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %61, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
%63 = icmp eq i32 %62, 3
br i1 %63, label %64, label %80
64: ; preds = %60
%65 = load i32, i32* %10
%66 = srem i32 %65, 8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = load i32, i32* %11
%71 = srem i32 %70, 8
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = add nsw i32 %69, %74
%76 = load i32, i32* %9
%77 = srem i32 %76, 8
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %78
store i32 %75, i32* %79
br label %80
80: ; preds = %64, %60
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%82 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %81, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32* %9, i32* %10, i32* %12)
%83 = icmp eq i32 %82, 3
br i1 %83, label %84, label %96
84: ; preds = %80
%85 = load i32, i32* %10
%86 = srem i32 %85, 8
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %87
%89 = load i32, i32* %88
%90 = load i32, i32* %12
%91 = add nsw i32 %89, %90
%92 = load i32, i32* %9
%93 = srem i32 %92, 8
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %94
store i32 %91, i32* %95
br label %96
96: ; preds = %84, %80
%97 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%98 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %97, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
%99 = icmp eq i32 %98, 3
br i1 %99, label %100, label %116
100: ; preds = %96
%101 = load i32, i32* %10
%102 = srem i32 %101, 8
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = load i32, i32* %11
%107 = srem i32 %106, 8
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = sub nsw i32 %105, %110
%112 = load i32, i32* %9
%113 = srem i32 %112, 8
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %114
store i32 %111, i32* %115
br label %116
116: ; preds = %100, %96
%117 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%118 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %117, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %10, i32* %12)
%119 = icmp eq i32 %118, 3
br i1 %119, label %120, label %132
120: ; preds = %116
%121 = load i32, i32* %10
%122 = srem i32 %121, 8
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %123
%125 = load i32, i32* %124
%126 = load i32, i32* %12
%127 = sub nsw i32 %125, %126
%128 = load i32, i32* %9
%129 = srem i32 %128, 8
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %130
store i32 %127, i32* %131
br label %132
132: ; preds = %120, %116
%133 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%134 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %133, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
%135 = icmp eq i32 %134, 3
br i1 %135, label %136, label %152
136: ; preds = %132
%137 = load i32, i32* %10
%138 = srem i32 %137, 8
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %139
%141 = load i32, i32* %140
%142 = load i32, i32* %11
%143 = srem i32 %142, 8
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %144
%146 = load i32, i32* %145
%147 = and i32 %141, %146
%148 = load i32, i32* %9
%149 = srem i32 %148, 8
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %150
store i32 %147, i32* %151
br label %152
152: ; preds = %136, %132
%153 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%154 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %153, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32* %9, i32* %10, i32* %12)
%155 = icmp eq i32 %154, 3
br i1 %155, label %156, label %168
156: ; preds = %152
%157 = load i32, i32* %10
%158 = srem i32 %157, 8
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %159
%161 = load i32, i32* %160
%162 = load i32, i32* %12
%163 = and i32 %161, %162
%164 = load i32, i32* %9
%165 = srem i32 %164, 8
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %166
store i32 %163, i32* %167
br label %168
168: ; preds = %156, %152
%169 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%170 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %169, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
%171 = icmp eq i32 %170, 3
br i1 %171, label %172, label %188
172: ; preds = %168
%173 = load i32, i32* %10
%174 = srem i32 %173, 8
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %175
%177 = load i32, i32* %176
%178 = load i32, i32* %11
%179 = srem i32 %178, 8
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %180
%182 = load i32, i32* %181
%183 = or i32 %177, %182
%184 = load i32, i32* %9
%185 = srem i32 %184, 8
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %186
store i32 %183, i32* %187
br label %188
188: ; preds = %172, %168
%189 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%190 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %189, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32* %9, i32* %10, i32* %12)
%191 = icmp eq i32 %190, 3
br i1 %191, label %192, label %204
192: ; preds = %188
%193 = load i32, i32* %10
%194 = srem i32 %193, 8
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %195
%197 = load i32, i32* %196
%198 = load i32, i32* %12
%199 = or i32 %197, %198
%200 = load i32, i32* %9
%201 = srem i32 %200, 8
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %202
store i32 %199, i32* %203
br label %204
204: ; preds = %192, %188
%205 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%206 = call i32 @strlen(i8* %205)
%207 = sub nsw i32 %206, 1
%208 = icmp sgt i32 0, %207
br i1 %208, label %209, label %210
209: ; preds = %204
br label %214
210: ; preds = %204
%211 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%212 = call i32 @strlen(i8* %211)
%213 = sub nsw i32 %212, 1
br label %214
214: ; preds = %210, %209
%215 = phi i32 [ 0, %209 ], [ %213, %210 ]
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %216
store i8 0, i8* %217
store i32 0, i32* %8
br label %218
218: ; preds = %239, %214
%219 = load i32, i32* %8
%220 = icmp slt i32 %219, 8
br i1 %220, label %221, label %242
221: ; preds = %218
%222 = load i32, i32* %8
%223 = load i32, i32* %8
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 %224
%226 = load i32, i32* %225
%227 = load i32, i32* %8
%228 = icmp eq i32 %227, 7
br i1 %228, label %229, label %231
229: ; preds = %221
%230 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
br label %232
231: ; preds = %221
br label %232
232: ; preds = %231, %229
%233 = phi i8* [ %230, %229 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), %231 ]
%234 = load i32, i32* %8
%235 = icmp eq i32 %234, 7
%236 = zext i1 %235 to i64
%237 = select i1 %235, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0)
%238 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %222, i32 %226, i8* %233, i8* %237)
br label %239
239: ; preds = %232
%240 = load i32, i32* %8
%241 = add nsw i32 %240, 1
store i32 %241, i32* %8
br label %218
242: ; preds = %218
br label %243
243: ; preds = %242
%244 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%245 = load i32, i32* @stdin
%246 = call i64 @fgets(i8* %244, i32 1000, i32 %245)
%247 = icmp ne i64 %246, 0
br i1 %247, label %46, label %248
248: ; preds = %243
%249 = load i32, i32* %3
ret i32 %249
}

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
@.str.1 = [12 x i8] c"mov r%d,r%d\00"
@.str.2 = [16 x i8] c"add r%d,r%d,r%d\00"
@.str.3 = [16 x i8] c"addi r%d,r%d,%d\00"
@.str.4 = [16 x i8] c"sub r%d,r%d,r%d\00"
@.str.5 = [16 x i8] c"subi r%d,r%d,%d\00"
@.str.6 = [16 x i8] c"and r%d,r%d,r%d\00"
@.str.7 = [16 x i8] c"andi r%d,r%d,%d\00"
@.str.8 = [15 x i8] c"or r%d,r%d,r%d\00"
@.str.9 = [15 x i8] c"ori r%d,r%d,%d\00"
@.str.10 = [18 x i8] c"reg%1d=%02x %s %s\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [2 x i8] c" \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x i32]
%4 = alloca [1000 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast [8 x i32]* %3 to i8*
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = icmp eq i32 %0, 2
br i1 %15, label %16, label %29
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %29
21: ; preds = %16
%22 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
%24 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
%25 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
%28 = bitcast [8 x i32]* %3 to i8*
br label %45
29: ; preds = %2, %16
%30 = tail call i32 (...) @rand()
%31 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
store i32 %30, i32* %31
%32 = tail call i32 (...) @rand()
%33 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
store i32 %32, i32* %33
%34 = tail call i32 (...) @rand()
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
store i32 %34, i32* %35
%36 = tail call i32 (...) @rand()
%37 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
store i32 %36, i32* %37
%38 = tail call i32 (...) @rand()
%39 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
store i32 %38, i32* %39
%40 = tail call i32 (...) @rand()
%41 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
store i32 %40, i32* %41
%42 = tail call i32 (...) @rand()
%43 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
store i32 %42, i32* %43
%44 = tail call i32 (...) @rand()
br label %45
45: ; preds = %21, %29
%46 = phi i32* [ %43, %29 ], [ %27, %21 ]
%47 = phi i32* [ %39, %29 ], [ %25, %21 ]
%48 = phi i32* [ %35, %29 ], [ %23, %21 ]
%49 = phi i32* [ %33, %29 ], [ %22, %21 ]
%50 = phi i32* [ %37, %29 ], [ %24, %21 ]
%51 = phi i32* [ %41, %29 ], [ %26, %21 ]
%52 = phi i32 [ %44, %29 ], [ 0, %21 ]
%53 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%54 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
store i32 %52, i32* %54
store i8 0, i8* %10
br label %55
55: ; preds = %210, %45
%56 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %68
58: ; preds = %55
%59 = load i32, i32* %6
%60 = srem i32 %59, 8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %5
%65 = srem i32 %64, 8
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %66
store i32 %63, i32* %67
br label %68
68: ; preds = %58, %55
%69 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%70 = icmp eq i32 %69, 3
br i1 %70, label %71, label %87
71: ; preds = %68
%72 = load i32, i32* %6
%73 = srem i32 %72, 8
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = load i32, i32* %7
%78 = srem i32 %77, 8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = add nsw i32 %81, %76
%83 = load i32, i32* %5
%84 = srem i32 %83, 8
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %85
store i32 %82, i32* %86
br label %87
87: ; preds = %71, %68
%88 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %6, i32* %8)
%89 = icmp eq i32 %88, 3
br i1 %89, label %90, label %102
90: ; preds = %87
%91 = load i32, i32* %6
%92 = srem i32 %91, 8
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %93
%95 = load i32, i32* %94
%96 = load i32, i32* %8
%97 = add nsw i32 %96, %95
%98 = load i32, i32* %5
%99 = srem i32 %98, 8
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %100
store i32 %97, i32* %101
br label %102
102: ; preds = %90, %87
%103 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%104 = icmp eq i32 %103, 3
br i1 %104, label %105, label %121
105: ; preds = %102
%106 = load i32, i32* %6
%107 = srem i32 %106, 8
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = load i32, i32* %7
%112 = srem i32 %111, 8
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = sub nsw i32 %110, %115
%117 = load i32, i32* %5
%118 = srem i32 %117, 8
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %119
store i32 %116, i32* %120
br label %121
121: ; preds = %105, %102
%122 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %6, i32* %8)
%123 = icmp eq i32 %122, 3
br i1 %123, label %124, label %136
124: ; preds = %121
%125 = load i32, i32* %6
%126 = srem i32 %125, 8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %127
%129 = load i32, i32* %128
%130 = load i32, i32* %8
%131 = sub nsw i32 %129, %130
%132 = load i32, i32* %5
%133 = srem i32 %132, 8
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %134
store i32 %131, i32* %135
br label %136
136: ; preds = %124, %121
%137 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%138 = icmp eq i32 %137, 3
br i1 %138, label %139, label %155
139: ; preds = %136
%140 = load i32, i32* %6
%141 = srem i32 %140, 8
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %142
%144 = load i32, i32* %143
%145 = load i32, i32* %7
%146 = srem i32 %145, 8
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %147
%149 = load i32, i32* %148
%150 = and i32 %149, %144
%151 = load i32, i32* %5
%152 = srem i32 %151, 8
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %153
store i32 %150, i32* %154
br label %155
155: ; preds = %139, %136
%156 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32* %5, i32* %6, i32* %8)
%157 = icmp eq i32 %156, 3
br i1 %157, label %158, label %170
158: ; preds = %155
%159 = load i32, i32* %6
%160 = srem i32 %159, 8
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %161
%163 = load i32, i32* %162
%164 = load i32, i32* %8
%165 = and i32 %164, %163
%166 = load i32, i32* %5
%167 = srem i32 %166, 8
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %168
store i32 %165, i32* %169
br label %170
170: ; preds = %158, %155
%171 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%172 = icmp eq i32 %171, 3
br i1 %172, label %173, label %189
173: ; preds = %170
%174 = load i32, i32* %6
%175 = srem i32 %174, 8
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %176
%178 = load i32, i32* %177
%179 = load i32, i32* %7
%180 = srem i32 %179, 8
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %181
%183 = load i32, i32* %182
%184 = or i32 %183, %178
%185 = load i32, i32* %5
%186 = srem i32 %185, 8
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %187
store i32 %184, i32* %188
br label %189
189: ; preds = %173, %170
%190 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32* %5, i32* %6, i32* %8)
%191 = icmp eq i32 %190, 3
br i1 %191, label %192, label %204
192: ; preds = %189
%193 = load i32, i32* %6
%194 = srem i32 %193, 8
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %195
%197 = load i32, i32* %196
%198 = load i32, i32* %8
%199 = or i32 %198, %197
%200 = load i32, i32* %5
%201 = srem i32 %200, 8
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %202
store i32 %199, i32* %203
br label %204
204: ; preds = %192, %189
%205 = call i32 @strlen(i8* %10)
%206 = icmp slt i32 %205, 1
br i1 %206, label %210, label %207
207: ; preds = %204
%208 = call i32 @strlen(i8* %10)
%209 = add nsw i32 %208, -1
br label %210
210: ; preds = %204, %207
%211 = phi i32 [ %209, %207 ], [ 0, %204 ]
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %212
store i8 0, i8* %213
%214 = load i32, i32* %53
%215 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 0, i32 %214, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%216 = load i32, i32* %49
%217 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 %216, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%218 = load i32, i32* %48
%219 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 2, i32 %218, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%220 = load i32, i32* %50
%221 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 3, i32 %220, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%222 = load i32, i32* %47
%223 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 4, i32 %222, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%224 = load i32, i32* %51
%225 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 5, i32 %224, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%226 = load i32, i32* %46
%227 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 6, i32 %226, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%228 = load i32, i32* %54
%229 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 7, i32 %228, i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%230 = load i32, i32* @stdin
%231 = call i64 @fgets(i8* %10, i32 1000, i32 %230)
%232 = icmp eq i64 %231, 0
br i1 %232, label %233, label %55
233: ; preds = %210
ret i32 0
}