#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__ strncmp(char *, char *, int);
int readboard(int b[8][8], int *view, int *color, char *line) {
  static int i = 0;
  int j;
  static int state = 0;
  if (state == 0) {
    if ((strncmp((&line[0]), ("   ~~~~~~~~~~~~~~~ "), (19)) == 0)) {
      i = 0;
      state = 1;
      *view = 2;
      *color = 2;
      return 0;
    } else if ((strncmp((&line[0]), ("*  ~~~~~~~~~~~~~~~ "), (19)) == 0)) {
      i = 0;
      state = 1;
      *view = 1;
      *color = 1;
      return 0;
    }
  }
  if (state == 1 && i == 8) {
    state = 0;
    i = 0;
    return 9;
  }
  if (state == 1 && *view == 2) {
    for (j = 3; j < 18; j += 2) {
      if ((strncmp((&line[j]), ("  "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 0;
      else if ((strncmp((&line[j]), ("- "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 16;
      else if ((strncmp((&line[j]), ("b "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 2 | 4;
      else if ((strncmp((&line[j]), ("w "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 1 | 4;
      else if ((strncmp((&line[j]), ("B "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 2 | 8;
      else if ((strncmp((&line[j]), ("W "), (2)) == 0))
        b[(j - 3) / 2][7 - i] = 1 | 8;
      else
        state = 0;
    }
    i++;
  } else if (state == 1 && *view == 1) {
    for (j = 3; j < 18; j += 2) {
      if ((strncmp((&line[j]), ("  "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 0;
      else if ((strncmp((&line[j]), ("- "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 16;
      else if ((strncmp((&line[j]), ("b "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 2 | 4;
      else if ((strncmp((&line[j]), ("w "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 1 | 4;
      else if ((strncmp((&line[j]), ("B "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 2 | 8;
      else if ((strncmp((&line[j]), ("W "), (2)) == 0))
        b[7 - (j - 3) / 2][i] = 1 | 8;
      else
        state = 0;
    }
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<readboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x0,0x2efe(%rip)
jne    11e8 <readboard+0xd8>
mov    -0x28(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    118b <readboard+0x7b>
movl   $0x0,0x2ecb(%rip)
movl   $0x1,0x2ec5(%rip)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    17e9 <readboard+0x6d9>
mov    -0x28(%rbp),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x13,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11de <readboard+0xce>
movl   $0x0,0x2e78(%rip)
movl   $0x1,0x2e72(%rip)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    17e9 <readboard+0x6d9>
jmp    11e3 <readboard+0xd3>
jmp    11e8 <readboard+0xd8>
cmpl   $0x1,0x2e41(%rip)
jne    1222 <readboard+0x112>
cmpl   $0x8,0x2e30(%rip)
jne    1222 <readboard+0x112>
movl   $0x0,0x2e24(%rip)
movl   $0x0,0x2e16(%rip)
movl   $0x9,-0x4(%rbp)
jmp    17e9 <readboard+0x6d9>
cmpl   $0x1,0x2e07(%rip)
jne    14fb <readboard+0x3eb>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jne    14fb <readboard+0x3eb>
movl   $0x3,-0x2c(%rbp)
cmpl   $0x12,-0x2c(%rbp)
jge    14e7 <readboard+0x3d7>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xdc9(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12b3 <readboard+0x1a3>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2d88(%rip),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    14d4 <readboard+0x3c4>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xd66(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1319 <readboard+0x209>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2d22(%rip),%ecx
movslq %ecx,%rcx
movl   $0x10,(%rax,%rcx,4)
jmp    14cf <readboard+0x3bf>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xd03(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    137f <readboard+0x26f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2cbc(%rip),%ecx
movslq %ecx,%rcx
movl   $0x6,(%rax,%rcx,4)
jmp    14ca <readboard+0x3ba>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xca0(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13e5 <readboard+0x2d5>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2c56(%rip),%ecx
movslq %ecx,%rcx
movl   $0x5,(%rax,%rcx,4)
jmp    14c5 <readboard+0x3b5>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xc3d(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    144b <readboard+0x33b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2bf0(%rip),%ecx
movslq %ecx,%rcx
movl   $0xa,(%rax,%rcx,4)
jmp    14c0 <readboard+0x3b0>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xbda(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    14b1 <readboard+0x3a1>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    0x2b8a(%rip),%ecx
movslq %ecx,%rcx
movl   $0x9,(%rax,%rcx,4)
jmp    14bb <readboard+0x3ab>
movl   $0x0,0x2b75(%rip)
jmp    14c0 <readboard+0x3b0>
jmp    14c5 <readboard+0x3b5>
jmp    14ca <readboard+0x3ba>
jmp    14cf <readboard+0x3bf>
jmp    14d4 <readboard+0x3c4>
jmp    14d9 <readboard+0x3c9>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    1243 <readboard+0x133>
mov    0x2b3f(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2b36(%rip)
jmp    17e0 <readboard+0x6d0>
cmpl   $0x1,0x2b2e(%rip)
jne    17db <readboard+0x6cb>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jne    17db <readboard+0x6cb>
movl   $0x3,-0x2c(%rbp)
cmpl   $0x12,-0x2c(%rbp)
jge    17cc <readboard+0x6bc>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xaf0(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    158c <readboard+0x47c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x68(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x2aac(%rip),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    17b9 <readboard+0x6a9>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xa8d(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    15f2 <readboard+0x4e2>
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x70(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x2a46(%rip),%rcx
movl   $0x10,(%rax,%rcx,4)
jmp    17b4 <readboard+0x6a4>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0xa2a(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1658 <readboard+0x548>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x78(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x29e0(%rip),%rcx
movl   $0x6,(%rax,%rcx,4)
jmp    17af <readboard+0x69f>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0x9c7(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    16be <readboard+0x5ae>
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x80(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x297a(%rip),%rcx
movl   $0x5,(%rax,%rcx,4)
jmp    17aa <readboard+0x69a>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0x964(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    172a <readboard+0x61a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x88(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x290e(%rip),%rcx
movl   $0xa,(%rax,%rcx,4)
jmp    17a5 <readboard+0x695>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
lea    0x8fb(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1796 <readboard+0x686>
mov    -0x10(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x90(%rbp),%rax
mov    $0x7,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq 0x28a2(%rip),%rcx
movl   $0x9,(%rax,%rcx,4)
jmp    17a0 <readboard+0x690>
movl   $0x0,0x2890(%rip)
jmp    17a5 <readboard+0x695>
jmp    17aa <readboard+0x69a>
jmp    17af <readboard+0x69f>
jmp    17b4 <readboard+0x6a4>
jmp    17b9 <readboard+0x6a9>
jmp    17be <readboard+0x6ae>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    151c <readboard+0x40c>
mov    0x285a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2851(%rip)
jmp    17e0 <readboard+0x6d0>
mov    0x2846(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readboard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rsi,%rbp
mov    %rdi,%r14
cmpb   $0x0,0x2f05(%rip)
je     133c <readboard+0x22c>
mov    0x2ef5(%rip),%eax
cmp    $0x8,%eax
je     138f <readboard+0x27f>
mov    0x0(%rbp),%ecx
cmp    $0x2,%ecx
je     13f4 <readboard+0x2e4>
cmp    $0x1,%ecx
jne    160a <readboard+0x4fa>
add    $0x3,%r12
xor    %r13d,%r13d
lea    0xec5(%rip),%r15
lea    0xec1(%rip),%rbx
jmp    11ac <readboard+0x9c>
nopl   0x0(%rax)
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2ea3(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x0,(%rax,%rcx,4)
lea    0x2(%r13),%rax
add    $0x3,%r13
cmp    $0x10,%r13
mov    %rax,%r13
jae    15fb <readboard+0x4eb>
lea    (%r12,%r13,1),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1170 <readboard+0x60>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1260 <readboard+0x150>
mov    %rbp,%rdi
lea    0xe46(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     128c <readboard+0x17c>
mov    %rbp,%rdi
lea    0xe2c(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12b8 <readboard+0x1a8>
mov    %rbp,%rdi
lea    0xe12(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12e4 <readboard+0x1d4>
mov    %rbp,%rdi
lea    0xdf8(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1310 <readboard+0x200>
movb   $0x0,0x2dd7(%rip)
jmp    1197 <readboard+0x87>
xchg   %ax,%ax
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2db3(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x10,(%rax,%rcx,4)
jmp    1197 <readboard+0x87>
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2d87(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x6,(%rax,%rcx,4)
jmp    1197 <readboard+0x87>
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2d5b(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x5,(%rax,%rcx,4)
jmp    1197 <readboard+0x87>
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2d2f(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0xa,(%rax,%rcx,4)
jmp    1197 <readboard+0x87>
mov    %r13d,%eax
shr    $0x7,%al
add    %r13b,%al
sar    %al
mov    $0x7,%cl
sub    %al,%cl
movzbl %cl,%eax
movslq 0x2d03(%rip),%rcx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x9,(%rax,%rcx,4)
jmp    1197 <readboard+0x87>
mov    %rdx,%rbx
lea    0xcba(%rip),%rsi
mov    %r12,%rdi
mov    $0x13,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     13aa <readboard+0x29a>
lea    0xcb5(%rip),%rsi
mov    %r12,%rdi
mov    $0x13,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     13cf <readboard+0x2bf>
mov    0x2cb9(%rip),%cl
mov    0x2caf(%rip),%eax
cmp    $0x1,%cl
jne    1619 <readboard+0x509>
cmp    $0x8,%eax
jne    1619 <readboard+0x509>
movb   $0x0,0x2c9a(%rip)
movl   $0x0,0x2c8c(%rip)
mov    $0x9,%eax
jmp    160a <readboard+0x4fa>
movl   $0x0,0x2c78(%rip)
movb   $0x1,0x2c75(%rip)
movl   $0x2,0x0(%rbp)
movl   $0x2,(%rbx)
xor    %eax,%eax
jmp    160a <readboard+0x4fa>
movl   $0x0,0x2c53(%rip)
movb   $0x1,0x2c50(%rip)
movl   $0x1,0x0(%rbp)
movl   $0x1,(%rbx)
xor    %eax,%eax
jmp    160a <readboard+0x4fa>
add    $0x3,%r12
xor    %ebp,%ebp
lea    0xc27(%rip),%r15
lea    0xc23(%rip),%rbx
jmp    144f <readboard+0x33f>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2c08(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x0,(%rax,%rdx,4)
lea    0x2(%rbp),%rax
add    $0x3,%rbp
cmp    $0x10,%rbp
mov    %rax,%rbp
jae    15fb <readboard+0x4eb>
lea    (%r12,%rbp,1),%r13
mov    %r13,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1410 <readboard+0x300>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1510 <readboard+0x400>
mov    %r13,%rdi
lea    0xba3(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     153f <readboard+0x42f>
mov    %r13,%rdi
lea    0xb89(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     156e <readboard+0x45e>
mov    %r13,%rdi
lea    0xb6f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     159d <readboard+0x48d>
mov    %r13,%rdi
lea    0xb55(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     15cc <readboard+0x4bc>
movb   $0x0,0x2b34(%rip)
jmp    143a <readboard+0x32a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2b08(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x10,(%rax,%rdx,4)
jmp    143a <readboard+0x32a>
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2ad9(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x6,(%rax,%rdx,4)
jmp    143a <readboard+0x32a>
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2aaa(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x5,(%rax,%rdx,4)
jmp    143a <readboard+0x32a>
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2a7b(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0xa,(%rax,%rdx,4)
jmp    143a <readboard+0x32a>
mov    %ebp,%eax
shr    $0x7,%al
add    %bpl,%al
sar    %al
movzbl %al,%eax
movslq 0x2a4c(%rip),%rcx
mov    $0x7,%edx
sub    %rcx,%rdx
shl    $0x5,%rax
add    %r14,%rax
movl   $0x9,(%rax,%rdx,4)
jmp    143a <readboard+0x32a>
mov    0x2a2b(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2a22(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %cl,%cl
jne    1140 <readboard+0x30>
jmp    160a <readboard+0x4fa>

LLVM IR (-O0):
@readboard.i = internal global i32 0
@readboard.state = internal global i32 0
@.str = [20 x i8] c" ~~~~~~~~~~~~~~~ \00"
@.str.1 = [20 x i8] c"* ~~~~~~~~~~~~~~~ \00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [3 x i8] c"- \00"
@.str.4 = [3 x i8] c"b \00"
@.str.5 = [3 x i8] c"w \00"
@.str.6 = [3 x i8] c"B \00"
@.str.7 = [3 x i8] c"W \00"
define i32 @readboard([8 x i32]* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca [8 x i32]*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
store [8 x i32]* %0, [8 x i32]** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
%11 = load i32, i32* @readboard.state
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %4
%14 = load i8*, i8** %9
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
store i32 0, i32* @readboard.i
store i32 1, i32* @readboard.state
%19 = load i32*, i32** %7
store i32 2, i32* %19
%20 = load i32*, i32** %8
store i32 2, i32* %20
store i32 0, i32* %5
br label %305
21: ; preds = %13
%22 = load i8*, i8** %9
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = call i64 @strncmp(i8* %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 19)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %21
store i32 0, i32* @readboard.i
store i32 1, i32* @readboard.state
%27 = load i32*, i32** %7
store i32 1, i32* %27
%28 = load i32*, i32** %8
store i32 1, i32* %28
store i32 0, i32* %5
br label %305
29: ; preds = %21
br label %30
30: ; preds = %29
br label %31
31: ; preds = %30, %4
%32 = load i32, i32* @readboard.state
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = load i32, i32* @readboard.i
%36 = icmp eq i32 %35, 8
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 0, i32* @readboard.state
store i32 0, i32* @readboard.i
store i32 9, i32* %5
br label %305
38: ; preds = %34, %31
%39 = load i32, i32* @readboard.state
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %170
41: ; preds = %38
%42 = load i32*, i32** %7
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %170
45: ; preds = %41
store i32 3, i32* %10
br label %46
46: ; preds = %164, %45
%47 = load i32, i32* %10
%48 = icmp slt i32 %47, 18
br i1 %48, label %49, label %167
49: ; preds = %46
%50 = load i8*, i8** %9
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = call i64 @strncmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %67
56: ; preds = %49
%57 = load [8 x i32]*, [8 x i32]** %6
%58 = load i32, i32* %10
%59 = sub nsw i32 %58, 3
%60 = sdiv i32 %59, 2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %57, i64 %61
%63 = load i32, i32* @readboard.i
%64 = sub nsw i32 7, %63
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [8 x i32], [8 x i32]* %62, i64 0, i64 %65
store i32 0, i32* %66
br label %163
67: ; preds = %49
%68 = load i8*, i8** %9
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = call i64 @strncmp(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %85
74: ; preds = %67
%75 = load [8 x i32]*, [8 x i32]** %6
%76 = load i32, i32* %10
%77 = sub nsw i32 %76, 3
%78 = sdiv i32 %77, 2
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [8 x i32], [8 x i32]* %75, i64 %79
%81 = load i32, i32* @readboard.i
%82 = sub nsw i32 7, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %80, i64 0, i64 %83
store i32 16, i32* %84
br label %162
85: ; preds = %67
%86 = load i8*, i8** %9
%87 = load i32, i32* %10
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = call i64 @strncmp(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %103
92: ; preds = %85
%93 = load [8 x i32]*, [8 x i32]** %6
%94 = load i32, i32* %10
%95 = sub nsw i32 %94, 3
%96 = sdiv i32 %95, 2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [8 x i32], [8 x i32]* %93, i64 %97
%99 = load i32, i32* @readboard.i
%100 = sub nsw i32 7, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [8 x i32], [8 x i32]* %98, i64 0, i64 %101
store i32 6, i32* %102
br label %161
103: ; preds = %85
%104 = load i8*, i8** %9
%105 = load i32, i32* %10
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %104, i64 %106
%108 = call i64 @strncmp(i8* %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %121
110: ; preds = %103
%111 = load [8 x i32]*, [8 x i32]** %6
%112 = load i32, i32* %10
%113 = sub nsw i32 %112, 3
%114 = sdiv i32 %113, 2
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [8 x i32], [8 x i32]* %111, i64 %115
%117 = load i32, i32* @readboard.i
%118 = sub nsw i32 7, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [8 x i32], [8 x i32]* %116, i64 0, i64 %119
store i32 5, i32* %120
br label %160
121: ; preds = %103
%122 = load i8*, i8** %9
%123 = load i32, i32* %10
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %122, i64 %124
%126 = call i64 @strncmp(i8* %125, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%127 = icmp eq i64 %126, 0
br i1 %127, label %128, label %139
128: ; preds = %121
%129 = load [8 x i32]*, [8 x i32]** %6
%130 = load i32, i32* %10
%131 = sub nsw i32 %130, 3
%132 = sdiv i32 %131, 2
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [8 x i32], [8 x i32]* %129, i64 %133
%135 = load i32, i32* @readboard.i
%136 = sub nsw i32 7, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [8 x i32], [8 x i32]* %134, i64 0, i64 %137
store i32 10, i32* %138
br label %159
139: ; preds = %121
%140 = load i8*, i8** %9
%141 = load i32, i32* %10
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = call i64 @strncmp(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %157
146: ; preds = %139
%147 = load [8 x i32]*, [8 x i32]** %6
%148 = load i32, i32* %10
%149 = sub nsw i32 %148, 3
%150 = sdiv i32 %149, 2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [8 x i32], [8 x i32]* %147, i64 %151
%153 = load i32, i32* @readboard.i
%154 = sub nsw i32 7, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [8 x i32], [8 x i32]* %152, i64 0, i64 %155
store i32 9, i32* %156
br label %158
157: ; preds = %139
store i32 0, i32* @readboard.state
br label %158
158: ; preds = %157, %146
br label %159
159: ; preds = %158, %128
br label %160
160: ; preds = %159, %110
br label %161
161: ; preds = %160, %92
br label %162
162: ; preds = %161, %74
br label %163
163: ; preds = %162, %56
br label %164
164: ; preds = %163
%165 = load i32, i32* %10
%166 = add nsw i32 %165, 2
store i32 %166, i32* %10
br label %46
167: ; preds = %46
%168 = load i32, i32* @readboard.i
%169 = add nsw i32 %168, 1
store i32 %169, i32* @readboard.i
br label %303
170: ; preds = %41, %38
%171 = load i32, i32* @readboard.state
%172 = icmp eq i32 %171, 1
br i1 %172, label %173, label %302
173: ; preds = %170
%174 = load i32*, i32** %7
%175 = load i32, i32* %174
%176 = icmp eq i32 %175, 1
br i1 %176, label %177, label %302
177: ; preds = %173
store i32 3, i32* %10
br label %178
178: ; preds = %296, %177
%179 = load i32, i32* %10
%180 = icmp slt i32 %179, 18
br i1 %180, label %181, label %299
181: ; preds = %178
%182 = load i8*, i8** %9
%183 = load i32, i32* %10
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i8, i8* %182, i64 %184
%186 = call i64 @strncmp(i8* %185, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%187 = icmp eq i64 %186, 0
br i1 %187, label %188, label %199
188: ; preds = %181
%189 = load [8 x i32]*, [8 x i32]** %6
%190 = load i32, i32* %10
%191 = sub nsw i32 %190, 3
%192 = sdiv i32 %191, 2
%193 = sub nsw i32 7, %192
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [8 x i32], [8 x i32]* %189, i64 %194
%196 = load i32, i32* @readboard.i
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [8 x i32], [8 x i32]* %195, i64 0, i64 %197
store i32 0, i32* %198
br label %295
199: ; preds = %181
%200 = load i8*, i8** %9
%201 = load i32, i32* %10
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %200, i64 %202
%204 = call i64 @strncmp(i8* %203, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%205 = icmp eq i64 %204, 0
br i1 %205, label %206, label %217
206: ; preds = %199
%207 = load [8 x i32]*, [8 x i32]** %6
%208 = load i32, i32* %10
%209 = sub nsw i32 %208, 3
%210 = sdiv i32 %209, 2
%211 = sub nsw i32 7, %210
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [8 x i32], [8 x i32]* %207, i64 %212
%214 = load i32, i32* @readboard.i
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [8 x i32], [8 x i32]* %213, i64 0, i64 %215
store i32 16, i32* %216
br label %294
217: ; preds = %199
%218 = load i8*, i8** %9
%219 = load i32, i32* %10
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8, i8* %218, i64 %220
%222 = call i64 @strncmp(i8* %221, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%223 = icmp eq i64 %222, 0
br i1 %223, label %224, label %235
224: ; preds = %217
%225 = load [8 x i32]*, [8 x i32]** %6
%226 = load i32, i32* %10
%227 = sub nsw i32 %226, 3
%228 = sdiv i32 %227, 2
%229 = sub nsw i32 7, %228
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [8 x i32], [8 x i32]* %225, i64 %230
%232 = load i32, i32* @readboard.i
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [8 x i32], [8 x i32]* %231, i64 0, i64 %233
store i32 6, i32* %234
br label %293
235: ; preds = %217
%236 = load i8*, i8** %9
%237 = load i32, i32* %10
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i8, i8* %236, i64 %238
%240 = call i64 @strncmp(i8* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%241 = icmp eq i64 %240, 0
br i1 %241, label %242, label %253
242: ; preds = %235
%243 = load [8 x i32]*, [8 x i32]** %6
%244 = load i32, i32* %10
%245 = sub nsw i32 %244, 3
%246 = sdiv i32 %245, 2
%247 = sub nsw i32 7, %246
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds [8 x i32], [8 x i32]* %243, i64 %248
%250 = load i32, i32* @readboard.i
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [8 x i32], [8 x i32]* %249, i64 0, i64 %251
store i32 5, i32* %252
br label %292
253: ; preds = %235
%254 = load i8*, i8** %9
%255 = load i32, i32* %10
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds i8, i8* %254, i64 %256
%258 = call i64 @strncmp(i8* %257, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%259 = icmp eq i64 %258, 0
br i1 %259, label %260, label %271
260: ; preds = %253
%261 = load [8 x i32]*, [8 x i32]** %6
%262 = load i32, i32* %10
%263 = sub nsw i32 %262, 3
%264 = sdiv i32 %263, 2
%265 = sub nsw i32 7, %264
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds [8 x i32], [8 x i32]* %261, i64 %266
%268 = load i32, i32* @readboard.i
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds [8 x i32], [8 x i32]* %267, i64 0, i64 %269
store i32 10, i32* %270
br label %291
271: ; preds = %253
%272 = load i8*, i8** %9
%273 = load i32, i32* %10
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds i8, i8* %272, i64 %274
%276 = call i64 @strncmp(i8* %275, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%277 = icmp eq i64 %276, 0
br i1 %277, label %278, label %289
278: ; preds = %271
%279 = load [8 x i32]*, [8 x i32]** %6
%280 = load i32, i32* %10
%281 = sub nsw i32 %280, 3
%282 = sdiv i32 %281, 2
%283 = sub nsw i32 7, %282
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds [8 x i32], [8 x i32]* %279, i64 %284
%286 = load i32, i32* @readboard.i
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds [8 x i32], [8 x i32]* %285, i64 0, i64 %287
store i32 9, i32* %288
br label %290
289: ; preds = %271
store i32 0, i32* @readboard.state
br label %290
290: ; preds = %289, %278
br label %291
291: ; preds = %290, %260
br label %292
292: ; preds = %291, %242
br label %293
293: ; preds = %292, %224
br label %294
294: ; preds = %293, %206
br label %295
295: ; preds = %294, %188
br label %296
296: ; preds = %295
%297 = load i32, i32* %10
%298 = add nsw i32 %297, 2
store i32 %298, i32* %10
br label %178
299: ; preds = %178
%300 = load i32, i32* @readboard.i
%301 = add nsw i32 %300, 1
store i32 %301, i32* @readboard.i
br label %302
302: ; preds = %299, %173, %170
br label %303
303: ; preds = %302, %167
%304 = load i32, i32* @readboard.i
store i32 %304, i32* %5
br label %305
305: ; preds = %303, %37, %26, %18
%306 = load i32, i32* %5
ret i32 %306
}

LLVM IR (-O2):
@readboard.i = internal unnamed_addr global i32 0
@readboard.state = internal unnamed_addr global i1 false
@.str = [20 x i8] c" ~~~~~~~~~~~~~~~ \00"
@.str.1 = [20 x i8] c"* ~~~~~~~~~~~~~~~ \00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [3 x i8] c"- \00"
@.str.4 = [3 x i8] c"b \00"
@.str.5 = [3 x i8] c"w \00"
@.str.6 = [3 x i8] c"B \00"
@.str.7 = [3 x i8] c"W \00"
define i32 @readboard([8 x i32]* nocapture writeonly %0, i32* nocapture %1, i32* nocapture writeonly %2, i8* %3) {
%5 = load i1, i1* @readboard.state
br i1 %5, label %19, label %6
6: ; preds = %4
%7 = tail call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* @readboard.i
store i1 true, i1* @readboard.state
store i32 2, i32* %1
store i32 2, i32* %2
br label %189
10: ; preds = %6
%11 = tail call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 19)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* @readboard.i
store i1 true, i1* @readboard.state
store i32 1, i32* %1
store i32 1, i32* %2
br label %189
14: ; preds = %10
%15 = load i1, i1* @readboard.state
%16 = load i32, i32* @readboard.i
%17 = icmp eq i32 %16, 8
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %22, label %23
19: ; preds = %4
%20 = load i32, i32* @readboard.i
%21 = icmp eq i32 %20, 8
br i1 %21, label %22, label %24
22: ; preds = %19, %14
store i1 false, i1* @readboard.state
store i32 0, i32* @readboard.i
br label %189
23: ; preds = %14
br i1 %15, label %24, label %189
24: ; preds = %19, %23
%25 = phi i32 [ %16, %23 ], [ %20, %19 ]
%26 = load i32, i32* %1
switch i32 %26, label %189 [
i32 2, label %27
i32 1, label %108
]
27: ; preds = %24, %102
%28 = phi i64 [ %103, %102 ], [ 3, %24 ]
%29 = getelementptr inbounds i8, i8* %3, i64 %28
%30 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %27
%33 = trunc i64 %28 to i8
%34 = add nsw i8 %33, -3
%35 = sdiv i8 %34, 2
%36 = zext i8 %35 to i64
%37 = load i32, i32* @readboard.i
%38 = sub nsw i32 7, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %36, i64 %39
store i32 0, i32* %40
br label %102
41: ; preds = %27
%42 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %41
%45 = trunc i64 %28 to i8
%46 = add nsw i8 %45, -3
%47 = sdiv i8 %46, 2
%48 = zext i8 %47 to i64
%49 = load i32, i32* @readboard.i
%50 = sub nsw i32 7, %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %48, i64 %51
store i32 16, i32* %52
br label %102
53: ; preds = %41
%54 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %65
56: ; preds = %53
%57 = trunc i64 %28 to i8
%58 = add nsw i8 %57, -3
%59 = sdiv i8 %58, 2
%60 = zext i8 %59 to i64
%61 = load i32, i32* @readboard.i
%62 = sub nsw i32 7, %61
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %60, i64 %63
store i32 6, i32* %64
br label %102
65: ; preds = %53
%66 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %77
68: ; preds = %65
%69 = trunc i64 %28 to i8
%70 = add nsw i8 %69, -3
%71 = sdiv i8 %70, 2
%72 = zext i8 %71 to i64
%73 = load i32, i32* @readboard.i
%74 = sub nsw i32 7, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %72, i64 %75
store i32 5, i32* %76
br label %102
77: ; preds = %65
%78 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %89
80: ; preds = %77
%81 = trunc i64 %28 to i8
%82 = add nsw i8 %81, -3
%83 = sdiv i8 %82, 2
%84 = zext i8 %83 to i64
%85 = load i32, i32* @readboard.i
%86 = sub nsw i32 7, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %84, i64 %87
store i32 10, i32* %88
br label %102
89: ; preds = %77
%90 = tail call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %101
92: ; preds = %89
%93 = trunc i64 %28 to i8
%94 = add nsw i8 %93, -3
%95 = sdiv i8 %94, 2
%96 = zext i8 %95 to i64
%97 = load i32, i32* @readboard.i
%98 = sub nsw i32 7, %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %96, i64 %99
store i32 9, i32* %100
br label %102
101: ; preds = %89
store i1 false, i1* @readboard.state
br label %102
102: ; preds = %32, %56, %80, %101, %92, %68, %44
%103 = add nuw nsw i64 %28, 2
%104 = icmp ult i64 %28, 16
br i1 %104, label %27, label %105
105: ; preds = %102
%106 = load i32, i32* @readboard.i
%107 = add nsw i32 %106, 1
store i32 %107, i32* @readboard.i
br label %189
108: ; preds = %24, %183
%109 = phi i64 [ %184, %183 ], [ 3, %24 ]
%110 = getelementptr inbounds i8, i8* %3, i64 %109
%111 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %122
113: ; preds = %108
%114 = trunc i64 %109 to i8
%115 = add nsw i8 %114, -3
%116 = sdiv i8 %115, -2
%117 = add nsw i8 %116, 7
%118 = zext i8 %117 to i64
%119 = load i32, i32* @readboard.i
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %118, i64 %120
store i32 0, i32* %121
br label %183
122: ; preds = %108
%123 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %134
125: ; preds = %122
%126 = trunc i64 %109 to i8
%127 = add nsw i8 %126, -3
%128 = sdiv i8 %127, -2
%129 = add nsw i8 %128, 7
%130 = zext i8 %129 to i64
%131 = load i32, i32* @readboard.i
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %130, i64 %132
store i32 16, i32* %133
br label %183
134: ; preds = %122
%135 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %146
137: ; preds = %134
%138 = trunc i64 %109 to i8
%139 = add nsw i8 %138, -3
%140 = sdiv i8 %139, -2
%141 = add nsw i8 %140, 7
%142 = zext i8 %141 to i64
%143 = load i32, i32* @readboard.i
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %142, i64 %144
store i32 6, i32* %145
br label %183
146: ; preds = %134
%147 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%148 = icmp eq i64 %147, 0
br i1 %148, label %149, label %158
149: ; preds = %146
%150 = trunc i64 %109 to i8
%151 = add nsw i8 %150, -3
%152 = sdiv i8 %151, -2
%153 = add nsw i8 %152, 7
%154 = zext i8 %153 to i64
%155 = load i32, i32* @readboard.i
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %154, i64 %156
store i32 5, i32* %157
br label %183
158: ; preds = %146
%159 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%160 = icmp eq i64 %159, 0
br i1 %160, label %161, label %170
161: ; preds = %158
%162 = trunc i64 %109 to i8
%163 = add nsw i8 %162, -3
%164 = sdiv i8 %163, -2
%165 = add nsw i8 %164, 7
%166 = zext i8 %165 to i64
%167 = load i32, i32* @readboard.i
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %166, i64 %168
store i32 10, i32* %169
br label %183
170: ; preds = %158
%171 = tail call i64 @strncmp(i8* %110, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%172 = icmp eq i64 %171, 0
br i1 %172, label %173, label %182
173: ; preds = %170
%174 = trunc i64 %109 to i8
%175 = add nsw i8 %174, -3
%176 = sdiv i8 %175, -2
%177 = add nsw i8 %176, 7
%178 = zext i8 %177 to i64
%179 = load i32, i32* @readboard.i
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %178, i64 %180
store i32 9, i32* %181
br label %183
182: ; preds = %170
store i1 false, i1* @readboard.state
br label %183
183: ; preds = %113, %137, %161, %182, %173, %149, %125
%184 = add nuw nsw i64 %109, 2
%185 = icmp ult i64 %109, 16
br i1 %185, label %108, label %186
186: ; preds = %183
%187 = load i32, i32* @readboard.i
%188 = add nsw i32 %187, 1
store i32 %188, i32* @readboard.i
br label %189
189: ; preds = %24, %105, %186, %23, %22, %13, %9
%190 = phi i32 [ 0, %9 ], [ 0, %13 ], [ 9, %22 ], [ %16, %23 ], [ %188, %186 ], [ %107, %105 ], [ %25, %24 ]
ret i32 %190
}