#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 /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int atoi(char *);
int /*<<< orphan*/ bestmove(int **, int, int *, char *, int *, int);
int /*<<< orphan*/ domove(int, char, int **, int);
int /*<<< orphan*/ draw(int **, int, int, int, int, int, int, int);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int getopt(int, char **, char *);
scalar_t__ islegal(int, char, int **, int);
int nextturn(int **, int);
char *optarg;
scalar_t__ opterr;
int optind;
char optopt;
int /*<<< orphan*/ printf(char *, char, int);
int /*<<< orphan*/ printmsg(char *, int);
int /*<<< orphan*/ printturn(int);
int /*<<< orphan*/ quit(int, int);
scalar_t__ scanf(char *, char *, int *);
int /*<<< orphan*/ showscore(int **);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
char *strdup(char *);
int /*<<< orphan*/ strtok(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ usage();
int won(int **);
int main(int argc, char **argv) {
  char msg[80];
  int v_flag = 0, c_flag = 0, u_flag = 0, d_flag = 0, r_flag = 0, l_flag = 0,
      s_flag = 0, L_flag = 0, H_flag = 0;
  char *s_tart = NULL;
  int player[2] = {0, 0};
  int c, complvl = 2, turn = 0;
  opterr = 0;
  while ((c = getopt(argc, argv, "hs:t:vcLHudrlA::B::")) != -1)
    switch (c) {
    case 'h':
      usage();
      quit(1, L_flag);
    case 'v':
      v_flag = 1;
      break;
    case 'c':
      c_flag = 1;
      break;
    case 'u':
      u_flag = 1;
      break;
    case 'd':
      d_flag = 1;
      break;
    case 'r':
      r_flag = 1;
      break;
    case 'l':
      l_flag = 1;
      break;
    case 'L':
      L_flag = 1;
      break;
    case 'H':
      H_flag = 1;
      break;
    case 's':
      s_tart = optarg;
      s_flag = 1;
      break;
    case 'A':
      if (optarg)
        complvl = atoi(optarg);
      player[0] = 1;
      if (complvl < 1 || complvl > 9) {
        sprintf(
            msg,
            "Invalid level: %s. Level must be between 1 and %d (inclusive).",
            optarg, 9);
        printmsg(msg, 5);
        usage();
        quit(5, L_flag);
      }
      break;
    case 'B':
      if (optarg)
        complvl = atoi(optarg);
      player[1] = 1;
      if (complvl < 1 || complvl > 9) {
        sprintf(
            msg,
            "Invalid level: %s. Level must be between 1 and %d (inclusive).",
            optarg, 9);
        printmsg(msg, 5);
        usage();
        quit(5, L_flag);
      }
      break;
    case '?':
      if (optopt == 's' || optopt == 't' || optopt == 'A' || optopt == 'B')
        printmsg("Option -s requires an argument.", 5);
      else {
        sprintf(msg, "Unknown option -%c", optopt);
        printmsg(msg, 5);
        usage();
        return 1;
      }
      break;
    default:
      printmsg("Unknown commmand line option caused an unknown error", 5);
      usage();
      return 1;
    }
  if (optind < argc) {
    sprintf(msg, "Unknow additional parameter: %s", argv[optind]);
    printmsg(msg, 5);
    usage();
    return 5;
  }
  int board[8][8];
  int i, j;
  if (s_flag) {
    FILE *start = fopen(s_tart, "r");
    if (start == NULL) {
      sprintf(msg, "Can't read file: %s", s_tart);
      printmsg(msg, 3);
      return 3;
    }
    char *temp[8];
    i = 0;
    char line[10];
    char *eof;
    while ((eof = fgets(line, 10, start)) != NULL) {
      strtok(line, "\n");
      temp[i] = strdup(line);
      i++;
    }
    if (i != 8) {
      printmsg("Invalid input file", 3);
      return 3;
    }
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++)
        switch (temp[i][j]) {
        case 'O':
          board[i][j] = 0;
          break;
        case 'X':
          board[i][j] = 1;
          break;
        case '.':
          board[i][j] = 2;
          break;
        default:
          sprintf(msg,
                  "Invalid input file, invalid char at position i=%d j=%d "
                  "which was %cEND",
                  i, j, temp[i][j]);
          printmsg(msg, 3);
          return 3;
        }
  } else {
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++)
        board[i][j] = 2;
    board[3][3] = 0;
    board[4][3] = 1;
    board[4][4] = 0;
    board[3][4] = 1;
  }
  char col;
  int row;
  int dummyscore;
  draw(board, turn, u_flag, d_flag, r_flag, l_flag, c_flag, H_flag);
  printturn(turn);
  srand(time(NULL));
  while (won(board) == 2) {
    if (player[turn] == 0) {
      if (scanf(" %c %d", &col, &row) == EOF)
        break;
      if ((!(97 <= col && col <= 104) && !(65 <= col && col <= 72)) ||
          !(1 <= row && row <= 8)) {
        sprintf(msg, "Out of bounds: row=%d column=%c.", 8 - row, col);
        printmsg(msg, 3);
        continue;
      }
      col %= 65;
      col %= 32;
      row = 8 - row;
    } else {
      if (turn == 0)
        bestmove(board, turn, &row, &col, &dummyscore, complvl);
      else
        bestmove(board, turn, &row, &col, &dummyscore, complvl);
      printf("Computer's move: %c%d\n", col + 65, 8 - row);
    }
    if (islegal(row, col, board, turn)) {
      domove(row, col, board, turn);
      turn = nextturn(board, turn);
      if (v_flag) {
        draw(board, turn, u_flag, d_flag, r_flag, l_flag, c_flag, H_flag);
        printturn(turn);
      }
      showscore(board);
    } else {
      sprintf(msg, "Invalid move: row=%d column=%c", 8 - row, col + 65);
      printmsg(msg, 2);
    }
  }
  sprintf(msg, "%s won",
          won(board) == 0   ? "Green"
          : won(board) == 1 ? "Red"
                            : "Nobody");
  printmsg(msg, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movq   $0x0,-0x90(%rbp)
lea    -0x98(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1060 <memset@plt>
movl   $0x2,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    0x2cbc(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdc7(%rip),%rdx
call   1130 <getopt@plt>
mov    %eax,-0x9c(%rbp)
cmp    $0xffffffff,%eax
je     15e4 <main+0x374>
mov    -0x9c(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x230(%rbp)
sub    $0x37,%eax
ja     15bb <main+0x34b>
mov    -0x230(%rbp),%rax
lea    0xcaa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10f0 <usage@plt>
mov    -0x80(%rbp),%esi
mov    $0x1,%edi
call   1050 <quit@plt>
movl   $0x1,-0x64(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x68(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x6c(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x70(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x74(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x78(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x80(%rbp)
jmp    15df <main+0x36f>
movl   $0x1,-0x84(%rbp)
jmp    15df <main+0x36f>
mov    0x2c1b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    15df <main+0x36f>
mov    0x2bfe(%rip),%rax
cmpq   $0x0,(%rax)
je     1419 <main+0x1a9>
mov    0x2bed(%rip),%rax
mov    (%rax),%rdi
call   1140 <atoi@plt>
mov    %eax,-0xa0(%rbp)
movl   $0x1,-0x98(%rbp)
cmpl   $0x1,-0xa0(%rbp)
jl     143d <main+0x1cd>
cmpl   $0x9,-0xa0(%rbp)
jle    1480 <main+0x210>
lea    -0x60(%rbp),%rdi
mov    0x2bb0(%rip),%rax
mov    (%rax),%rdx
lea    0xca2(%rip),%rsi
mov    $0x9,%ecx
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
mov    $0x0,%al
call   10f0 <usage@plt>
mov    -0x80(%rbp),%esi
mov    $0x5,%edi
call   1050 <quit@plt>
jmp    15df <main+0x36f>
mov    0x2b6c(%rip),%rax
cmpq   $0x0,(%rax)
je     14ab <main+0x23b>
mov    0x2b5b(%rip),%rax
mov    (%rax),%rdi
call   1140 <atoi@plt>
mov    %eax,-0xa0(%rbp)
movl   $0x1,-0x94(%rbp)
cmpl   $0x1,-0xa0(%rbp)
jl     14cf <main+0x25f>
cmpl   $0x9,-0xa0(%rbp)
jle    1512 <main+0x2a2>
lea    -0x60(%rbp),%rdi
mov    0x2b1e(%rip),%rax
mov    (%rax),%rdx
lea    0xc10(%rip),%rsi
mov    $0x9,%ecx
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
mov    $0x0,%al
call   10f0 <usage@plt>
mov    -0x80(%rbp),%esi
mov    $0x5,%edi
call   1050 <quit@plt>
jmp    15df <main+0x36f>
mov    0x2ac2(%rip),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     1563 <main+0x2f3>
mov    0x2aaf(%rip),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
je     1563 <main+0x2f3>
mov    0x2a9c(%rip),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
je     1563 <main+0x2f3>
mov    0x2a89(%rip),%rax
movsbl (%rax),%eax
cmp    $0x42,%eax
jne    1579 <main+0x309>
lea    0xbc9(%rip),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
jmp    15b6 <main+0x346>
lea    -0x60(%rbp),%rdi
mov    0x2a5c(%rip),%rax
movsbl (%rax),%edx
lea    0xbc5(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
mov    $0x0,%al
call   10f0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
jmp    15df <main+0x36f>
lea    0xba4(%rip),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
mov    $0x0,%al
call   10f0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
jmp    130b <main+0x9b>
mov    0x29e5(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    163b <main+0x3cb>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x29cb(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb88(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x5,%esi
call   10d0 <printmsg@plt>
mov    $0x0,%al
call   10f0 <usage@plt>
movl   $0x5,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
cmpl   $0x0,-0x7c(%rbp)
je     18c8 <main+0x658>
mov    -0x90(%rbp),%rdi
lea    0xb46(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x1c0(%rbp)
cmpq   $0x0,-0x1c0(%rbp)
jne    16a0 <main+0x430>
lea    -0x60(%rbp),%rdi
mov    -0x90(%rbp),%rdx
lea    0xb3c(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x3,%esi
call   10d0 <printmsg@plt>
movl   $0x3,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
movl   $0x0,-0x1b4(%rbp)
lea    -0x20a(%rbp),%rdi
mov    -0x1c0(%rbp),%rdx
mov    $0xa,%esi
call   1090 <fgets@plt>
mov    %rax,-0x218(%rbp)
cmp    $0x0,%rax
je     1718 <main+0x4a8>
lea    -0x20a(%rbp),%rdi
lea    0xb85(%rip),%rsi
call   1120 <strtok@plt>
lea    -0x20a(%rbp),%rdi
call   1180 <strdup@plt>
mov    %rax,%rcx
movslq -0x1b4(%rbp),%rax
mov    %rcx,-0x200(%rbp,%rax,8)
ff
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    16aa <main+0x43a>
cmpl   $0x8,-0x1b4(%rbp)
je     1742 <main+0x4d2>
lea    0xaa3(%rip),%rdi
mov    $0x3,%esi
call   10d0 <printmsg@plt>
movl   $0x3,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x8,-0x1b4(%rbp)
jge    18c3 <main+0x653>
movl   $0x0,-0x1b8(%rbp)
cmpl   $0x8,-0x1b8(%rbp)
jge    18aa <main+0x63a>
movslq -0x1b4(%rbp),%rax
mov    -0x200(%rbp,%rax,8),%rax
ff
movslq -0x1b8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x234(%rbp)
sub    $0x2e,%eax
je     1816 <main+0x5a6>
jmp    179e <main+0x52e>
mov    -0x234(%rbp),%eax
sub    $0x4f,%eax
je     17c6 <main+0x556>
jmp    17b2 <main+0x542>
mov    -0x234(%rbp),%eax
sub    $0x58,%eax
je     17ee <main+0x57e>
jmp    183e <main+0x5ce>
movslq -0x1b4(%rbp),%rcx
lea    -0x1b0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x1b8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    1891 <main+0x621>
movslq -0x1b4(%rbp),%rcx
lea    -0x1b0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x1b8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    1891 <main+0x621>
movslq -0x1b4(%rbp),%rcx
lea    -0x1b0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x1b8(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
jmp    1891 <main+0x621>
lea    -0x60(%rbp),%rdi
mov    -0x1b4(%rbp),%edx
mov    -0x1b8(%rbp),%ecx
movslq -0x1b4(%rbp),%rax
mov    -0x200(%rbp,%rax,8),%rax
ff
movslq -0x1b8(%rbp),%rsi
movsbl (%rax,%rsi,1),%r8d
lea    0x972(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x3,%esi
call   10d0 <printmsg@plt>
movl   $0x3,-0x4(%rbp)
jmp    1d0b <main+0xa9b>
jmp    1896 <main+0x626>
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%rbp)
jmp    1763 <main+0x4f3>
jmp    18af <main+0x63f>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    174c <main+0x4dc>
jmp    196e <main+0x6fe>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x8,-0x1b4(%rbp)
jge    1946 <main+0x6d6>
movl   $0x0,-0x1b8(%rbp)
cmpl   $0x8,-0x1b8(%rbp)
jge    192d <main+0x6bd>
movslq -0x1b4(%rbp),%rcx
lea    -0x1b0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x1b8(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%rbp)
jmp    18e9 <main+0x679>
jmp    1932 <main+0x6c2>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    18d2 <main+0x662>
movl   $0x0,-0x144(%rbp)
movl   $0x1,-0x124(%rbp)
movl   $0x0,-0x120(%rbp)
movl   $0x1,-0x140(%rbp)
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x6c(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x78(%rbp),%r9d
mov    -0x68(%rbp),%r10d
mov    -0x84(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <draw@plt>
mov    -0xa4(%rbp),%edi
call   10c0 <printturn@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    -0x1b0(%rbp),%rdi
call   1150 <won@plt>
cmp    $0x2,%eax
jne    1c7d <main+0xa0d>
movslq -0xa4(%rbp),%rax
cmpl   $0x0,-0x98(%rbp,%rax,4)
jne    1af5 <main+0x885>
lea    0x83d(%rip),%rdi
lea    -0x219(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1100 <scanf@plt>
mov    0x25d2(%rip),%rcx
cmp    (%rcx),%rax
jne    1a14 <main+0x7a4>
jmp    1c7d <main+0xa0d>
movsbl -0x219(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1a38 <main+0x7c8>
movsbl -0x219(%rbp),%eax
cmp    $0x68,%eax
jle    1a5c <main+0x7ec>
movsbl -0x219(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1a7a <main+0x80a>
movsbl -0x219(%rbp),%eax
cmp    $0x48,%eax
jg     1a7a <main+0x80a>
mov    $0x1,%eax
cmp    -0x220(%rbp),%eax
jg     1a7a <main+0x80a>
cmpl   $0x8,-0x220(%rbp)
jle    1ab1 <main+0x841>
lea    -0x60(%rbp),%rdi
mov    $0x8,%edx
sub    -0x220(%rbp),%edx
movsbl -0x219(%rbp),%ecx
lea    0x799(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x3,%esi
call   10d0 <printmsg@plt>
jmp    19bb <main+0x74b>
movsbl -0x219(%rbp),%eax
mov    $0x41,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x219(%rbp)
movsbl -0x219(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x219(%rbp)
mov    $0x8,%eax
sub    -0x220(%rbp),%eax
mov    %eax,-0x220(%rbp)
jmp    1b87 <main+0x917>
cmpl   $0x0,-0xa4(%rbp)
jne    1b35 <main+0x8c5>
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0xa0(%rbp),%r9d
lea    -0x220(%rbp),%rdx
lea    -0x219(%rbp),%rcx
lea    -0x224(%rbp),%r8
call   10a0 <bestmove@plt>
jmp    1b63 <main+0x8f3>
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0xa0(%rbp),%r9d
lea    -0x220(%rbp),%rdx
lea    -0x219(%rbp),%rcx
lea    -0x224(%rbp),%r8
call   10a0 <bestmove@plt>
movsbl -0x219(%rbp),%eax
add    $0x41,%eax
mov    $0x8,%edx
sub    -0x220(%rbp),%edx
lea    0x6d2(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0x220(%rbp),%edi
mov    -0x219(%rbp),%al
lea    -0x1b0(%rbp),%rdx
mov    -0xa4(%rbp),%ecx
movsbl %al,%esi
call   1160 <islegal@plt>
cmp    $0x0,%rax
je     1c43 <main+0x9d3>
mov    -0x220(%rbp),%edi
mov    -0x219(%rbp),%al
lea    -0x1b0(%rbp),%rdx
mov    -0xa4(%rbp),%ecx
movsbl %al,%esi
call   1070 <domove@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   10e0 <nextturn@plt>
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1c32 <main+0x9c2>
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x6c(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x78(%rbp),%r9d
mov    -0x68(%rbp),%r10d
mov    -0x84(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <draw@plt>
mov    -0xa4(%rbp),%edi
call   10c0 <printturn@plt>
lea    -0x1b0(%rbp),%rdi
call   1190 <showscore@plt>
jmp    1c78 <main+0xa08>
lea    -0x60(%rbp),%rdi
mov    $0x8,%edx
sub    -0x220(%rbp),%edx
movsbl -0x219(%rbp),%ecx
add    $0x41,%ecx
lea    0x605(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x2,%esi
call   10d0 <printmsg@plt>
jmp    19bb <main+0x74b>
lea    -0x60(%rbp),%rax
mov    %rax,-0x240(%rbp)
lea    -0x1b0(%rbp),%rdi
call   1150 <won@plt>
cmp    $0x0,%eax
jne    1cb0 <main+0xa40>
lea    0x5ea(%rip),%rax
mov    %rax,-0x248(%rbp)
jmp    1cda <main+0xa6a>
lea    -0x1b0(%rbp),%rdi
call   1150 <won@plt>
mov    %eax,%edx
lea    0x5d3(%rip),%rax
lea    0x5c8(%rip),%rcx
cmp    $0x1,%edx
cmove  %rcx,%rax
mov    %rax,-0x248(%rbp)
mov    -0x240(%rbp),%rdi
mov    -0x248(%rbp),%rdx
lea    0x598(%rip),%rsi
mov    $0x0,%al
call   1170 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x1,%esi
call   10d0 <printmsg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,0x58(%rsp)
mov    %edi,%r14d
mov    0x2d40(%rip),%rax
movq   $0x0,(%rax)
mov    $0x2,%eax
mov    %rax,0x28(%rsp)
lea    0xd78(%rip),%r12
movl   $0x0,0x34(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x50(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
xor    %r13d,%r13d
jmp    1310 <main+0xb0>
mov    0x2cff(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x50(%rsp)
movl   $0x1,0x30(%rsp)
mov    %ebp,%r13d
nopl   0x0(%rax)
mov    %r13d,%ebp
mov    %r14d,%edi
mov    0x58(%rsp),%rsi
lea    0xece(%rip),%rdx
call   1120 <getopt@plt>
add    $0x1,%eax
cmp    $0x77,%eax
ja     1558 <main+0x2f8>
mov    $0x1,%r13d
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    0x2c97(%rip),%rax
movsbl (%rax),%edx
lea    -0x41(%rdx),%eax
cmp    $0x33,%al
ja     1619 <main+0x3b9>
movzbl %al,%eax
movabs $0xc000000000003,%rcx
bt     %rax,%rcx
jae    1619 <main+0x3b9>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
call   10c0 <printmsg@plt>
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
mov    0x2c6d(%rip),%rax
mov    (%rax),%r15
test   %r15,%r15
je     13a0 <main+0x140>
mov    %r15,%rdi
call   1130 <atoi@plt>
mov    %rax,0x28(%rsp)
mov    0x28(%rsp),%rax
add    $0xfffffff6,%eax
movl   $0x1,0x34(%rsp)
mov    %ebp,%r13d
cmp    $0xfffffff6,%eax
ja     1310 <main+0xb0>
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
lea    0xe36(%rip),%rsi
mov    %r15,%rdx
mov    $0x9,%ecx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %rbx,%rdi
jmp    143e <main+0x1de>
mov    0x2c0f(%rip),%rax
mov    (%rax),%rbx
test   %rbx,%rbx
je     13fe <main+0x19e>
mov    %rbx,%rdi
call   1130 <atoi@plt>
mov    %rax,0x28(%rsp)
mov    0x28(%rsp),%rax
add    $0xfffffff6,%eax
movl   $0x1,0x24(%rsp)
mov    %ebp,%r13d
cmp    $0xfffffff6,%eax
ja     1310 <main+0xb0>
lea    0xb0(%rsp),%r15
mov    %r15,%rdi
lea    0xdd8(%rip),%rsi
mov    %rbx,%rdx
mov    $0x9,%ecx
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   10c0 <printmsg@plt>
xor    %eax,%eax
call   10e0 <usage@plt>
mov    $0x5,%edi
mov    0x10(%rsp),%esi
call   1050 <quit@plt>
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
mov    $0x1,%eax
mov    %rax,0x40(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
movl   $0x1,0x10(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
mov    $0x1,%eax
mov    %rax,0x38(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
movl   $0x1,0x1c(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
xor    %eax,%eax
call   10e0 <usage@plt>
mov    $0x1,%r13d
mov    $0x1,%edi
mov    0x10(%rsp),%esi
call   1050 <quit@plt>
jmp    1310 <main+0xb0>
movl   $0x1,0x14(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
movl   $0x1,0x18(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
movl   $0x1,0x20(%rsp)
mov    %ebp,%r13d
jmp    1310 <main+0xb0>
mov    0x24(%rsp),%eax
mov    %eax,0x4c(%rsp)
mov    0x34(%rsp),%eax
mov    %eax,0x48(%rsp)
mov    0x2ac0(%rip),%rax
movslq (%rax),%rax
cmp    %r14d,%eax
jge    157a <main+0x31a>
mov    0x58(%rsp),%rcx
mov    (%rcx,%rax,8),%rdx
lea    0xd83(%rip),%rsi
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    $0x5,%ebx
mov    %rbp,%rdi
mov    $0x5,%esi
call   10c0 <printmsg@plt>
xor    %eax,%eax
call   10e0 <usage@plt>
jmp    1baa <main+0x94a>
lea    0xd17(%rip),%rdi
mov    $0x5,%esi
call   10c0 <printmsg@plt>
xor    %eax,%eax
call   10e0 <usage@plt>
mov    $0x1,%ebx
jmp    1baa <main+0x94a>
cmpl   $0x0,0x30(%rsp)
je     1642 <main+0x3e2>
lea    0xd1d(%rip),%rsi
mov    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1100 <fopen@plt>
test   %rax,%rax
je     1b05 <main+0x8a5>
mov    %rax,%r15
lea    0x64(%rsp),%rdi
mov    $0xa,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1af4 <main+0x894>
xor    %ebx,%ebx
lea    0xdad(%rip),%r14
lea    0x64(%rsp),%r12
xchg   %ax,%ax
mov    %r12,%rdi
mov    %r14,%rsi
call   1110 <strtok@plt>
mov    %r12,%rdi
call   1170 <strdup@plt>
mov    %rax,0x70(%rsp,%rbx,8)
add    $0x1,%rbx
mov    %r12,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
jne    15d0 <main+0x370>
cmp    $0x8,%ebx
jne    1af4 <main+0x894>
lea    0x11c(%rsp),%rax
xor    %edx,%edx
jmp    1986 <main+0x726>
mov    0x24(%rsp),%eax
mov    %eax,0x4c(%rsp)
lea    0xc3b(%rip),%rsi
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %rbx,%rdi
jmp    155f <main+0x2ff>
movaps 0x9b7(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1f0(%rsp)
movl   $0x0,0x16c(%rsp)
movl   $0x1,0x18c(%rsp)
movl   $0x0,0x190(%rsp)
movl   $0x1,0x170(%rsp)
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
push   0x40(%rsp)
push   0x40(%rsp)
call   1030 <draw@plt>
add    $0x10,%rsp
xor    %edi,%edi
call   10b0 <printturn@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    %rbx,%rdi
call   1140 <won@plt>
cmp    $0x2,%eax
jne    1934 <main+0x6d4>
lea    0xf(%rsp),%r15
lea    0x70(%rsp),%r13
lea    0xb0(%rsp),%rbx
lea    0x100(%rsp),%r12
xor    %r14d,%r14d
movslq %r14d,%rax
cmpl   $0x0,0x48(%rsp,%rax,4)
je     1876 <main+0x616>
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r13,%rdx
mov    %r15,%rcx
lea    0x64(%rsp),%r8
mov    0x28(%rsp),%r9
call   1090 <bestmove@plt>
mov    0xf(%rsp),%al
add    $0x41,%al
mov    $0x8,%edx
sub    0x70(%rsp),%edx
movsbl %al,%esi
lea    0xbb7(%rip),%rdi
call   1040 <printf@plt>
mov    0x70(%rsp),%edi
mov    0xf(%rsp),%cl
movsbl %cl,%esi
mov    %r12,%rdx
mov    %r14d,%ecx
call   1150 <islegal@plt>
mov    0x70(%rsp),%edi
test   %rax,%rax
je     18f6 <main+0x696>
movsbl 0xf(%rsp),%esi
mov    %r12,%rdx
mov    %r14d,%ecx
call   1060 <domove@plt>
mov    %r12,%rdi
mov    %r14d,%esi
call   10d0 <nextturn@plt>
mov    %eax,%r14d
test   %ebp,%ebp
je     1825 <main+0x5c5>
mov    %r12,%rdi
mov    %r14d,%esi
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
push   0x40(%rsp)
push   0x40(%rsp)
call   1030 <draw@plt>
add    $0x10,%rsp
mov    %r14d,%edi
call   10b0 <printturn@plt>
mov    %r12,%rdi
call   1180 <showscore@plt>
jmp    1923 <main+0x6c3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x8,%edx
sub    %eax,%edx
mov    %rbx,%rdi
lea    0xaef(%rip),%rsi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   10c0 <printmsg@plt>
mov    %r12,%rdi
call   1140 <won@plt>
cmp    $0x2,%eax
jne    1934 <main+0x6d4>
lea    0xabc(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   10f0 <scanf@plt>
mov    0x2749(%rip),%rcx
cmp    (%rcx),%rax
je     1934 <main+0x6d4>
movsbl 0xf(%rsp),%ecx
lea    -0x61(%rcx),%eax
cmp    $0x8,%al
jae    18b0 <main+0x650>
mov    0x70(%rsp),%eax
jmp    18bc <main+0x65c>
nopw   0x0(%rax,%rax,1)
lea    -0x41(%rcx),%edx
mov    0x70(%rsp),%eax
cmp    $0x7,%dl
ja     1840 <main+0x5e0>
test   %eax,%eax
jle    1840 <main+0x5e0>
cmp    $0x9,%eax
jae    1840 <main+0x5e0>
movzbl %cl,%ecx
imul   $0xfd,%ecx,%edx
shr    $0xe,%edx
mov    %edx,%esi
shl    $0x6,%esi
or     %edx,%esi
sub    %sil,%cl
and    $0x1f,%cl
mov    %cl,0xf(%rsp)
mov    $0x8,%edi
sub    %eax,%edi
mov    %edi,0x70(%rsp)
jmp    17b7 <main+0x557>
mov    $0x8,%edx
sub    %edi,%edx
movsbl 0xf(%rsp),%ecx
add    $0x41,%ecx
mov    %rbx,%rdi
lea    0xa69(%rip),%rsi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   10c0 <printmsg@plt>
mov    %r12,%rdi
call   1140 <won@plt>
cmp    $0x2,%eax
je     1768 <main+0x508>
lea    0x100(%rsp),%rdi
call   1140 <won@plt>
test   %eax,%eax
je     1b23 <main+0x8c3>
lea    0x100(%rsp),%rdi
call   1140 <won@plt>
cmp    $0x1,%eax
lea    0xa44(%rip),%rax
lea    0xa41(%rip),%rdx
cmove  %rax,%rdx
jmp    1b2a <main+0x8ca>
xor    %ecx,%ecx
mov    %ecx,(%rax)
add    $0x1,%rdx
add    $0x20,%rax
cmp    $0x8,%rdx
je     16f5 <main+0x495>
mov    0x70(%rsp,%rdx,8),%r8
movzbl (%r8),%ebx
movsbl %bl,%edi
cmp    $0x2e,%edi
je     19b1 <main+0x751>
mov    $0x0,%ecx
cmp    $0x4f,%edi
je     19b6 <main+0x756>
cmp    $0x58,%edi
jne    1b4f <main+0x8ef>
mov    $0x1,%ecx
jmp    19b6 <main+0x756>
mov    $0x2,%ecx
mov    %ecx,-0x1c(%rax)
movzbl 0x1(%r8),%ebx
movsbl %bl,%edi
mov    $0x2,%ecx
mov    $0x2,%esi
cmp    $0x2e,%edi
je     19e7 <main+0x787>
cmp    $0x4f,%edi
je     19e5 <main+0x785>
cmp    $0x58,%edi
jne    1b53 <main+0x8f3>
mov    $0x1,%esi
jmp    19e7 <main+0x787>
xor    %esi,%esi
mov    %esi,-0x18(%rax)
movzbl 0x2(%r8),%ebx
movsbl %bl,%esi
cmp    $0x2e,%esi
je     1a0e <main+0x7ae>
cmp    $0x4f,%esi
je     1a0c <main+0x7ac>
cmp    $0x58,%esi
jne    1b7b <main+0x91b>
mov    $0x1,%ecx
jmp    1a0e <main+0x7ae>
xor    %ecx,%ecx
mov    %ecx,-0x14(%rax)
movzbl 0x3(%r8),%ebx
movsbl %bl,%edi
mov    $0x2,%ecx
mov    $0x2,%esi
cmp    $0x2e,%edi
je     1a3f <main+0x7df>
cmp    $0x4f,%edi
je     1a3d <main+0x7dd>
cmp    $0x58,%edi
jne    1b5a <main+0x8fa>
mov    $0x1,%esi
jmp    1a3f <main+0x7df>
xor    %esi,%esi
mov    %esi,-0x10(%rax)
movzbl 0x4(%r8),%ebx
movsbl %bl,%edi
cmp    $0x2e,%edi
je     1a66 <main+0x806>
cmp    $0x4f,%edi
je     1a64 <main+0x804>
cmp    $0x58,%edi
jne    1b61 <main+0x901>
mov    $0x1,%ecx
jmp    1a66 <main+0x806>
xor    %ecx,%ecx
mov    %ecx,-0xc(%rax)
movzbl 0x5(%r8),%ebx
movsbl %bl,%edi
mov    $0x2,%ecx
mov    $0x2,%esi
cmp    $0x2e,%edi
je     1a97 <main+0x837>
cmp    $0x4f,%edi
je     1a95 <main+0x835>
cmp    $0x58,%edi
jne    1b68 <main+0x908>
mov    $0x1,%esi
jmp    1a97 <main+0x837>
xor    %esi,%esi
mov    %esi,-0x8(%rax)
movzbl 0x6(%r8),%ebx
movsbl %bl,%edi
cmp    $0x2e,%edi
je     1abe <main+0x85e>
cmp    $0x4f,%edi
je     1abc <main+0x85c>
cmp    $0x58,%edi
jne    1b6f <main+0x90f>
mov    $0x1,%ecx
jmp    1abe <main+0x85e>
xor    %ecx,%ecx
mov    %ecx,-0x4(%rax)
movzbl 0x7(%r8),%ebx
movsbl %bl,%ecx
cmp    $0x2e,%ecx
je     1aea <main+0x88a>
cmp    $0x4f,%ecx
je     1970 <main+0x710>
cmp    $0x58,%ecx
jne    1b76 <main+0x916>
mov    $0x1,%ecx
jmp    1972 <main+0x712>
mov    $0x2,%ecx
jmp    1972 <main+0x712>
lea    0x7e4(%rip),%rdi
mov    $0x3,%ebx
jmp    1ba0 <main+0x940>
lea    0x7bf(%rip),%rsi
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
jmp    1b98 <main+0x938>
lea    0x874(%rip),%rdx
lea    0x866(%rip),%rsi
xor    %ebx,%ebx
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
jmp    1ba5 <main+0x945>
xor    %ecx,%ecx
jmp    1b7b <main+0x91b>
mov    $0x1,%ecx
jmp    1b7b <main+0x91b>
mov    $0x3,%ecx
jmp    1b7b <main+0x91b>
mov    $0x4,%ecx
jmp    1b7b <main+0x91b>
mov    $0x5,%ecx
jmp    1b7b <main+0x91b>
mov    $0x6,%ecx
jmp    1b7b <main+0x91b>
mov    $0x7,%ecx
movsbl %bl,%r8d
lea    0x76c(%rip),%rsi
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1160 <sprintf@plt>
mov    $0x3,%ebx
mov    %rbp,%rdi
mov    $0x3,%esi
call   10c0 <printmsg@plt>
mov    %ebx,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@opterr = global i64 0
@.str = [20 x i8] c"hs:t:vcLHudrlA::B::\00"
@optarg = global i8* null
@.str.1 = [63 x i8] c"Invalid level: %s. Level must be between 1 and %d (inclusive).\00"
@optopt = global i8 0
@.str.2 = [32 x i8] c"Option -s requires an argument.\00"
@.str.3 = [19 x i8] c"Unknown option -%c\00"
@.str.4 = [53 x i8] c"Unknown commmand line option caused an unknown error\00"
@optind = global i32 0
@.str.5 = [32 x i8] c"Unknow additional parameter: %s\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [20 x i8] c"Can't read file: %s\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [19 x i8] c"Invalid input file\00"
@.str.10 = [71 x i8] c"Invalid input file, invalid char at position i=%d j=%d which was %cEND\00"
@.str.11 = [7 x i8] c" %c %d\00"
@EOF = global i64 0
@.str.12 = [33 x i8] c"Out of bounds: row=%d column=%c.\00"
@.str.13 = [23 x i8] c"Computer's move: %c%d\0A\00"
@.str.14 = [31 x i8] c"Invalid move: row=%d column=%c\00"
@.str.15 = [7 x i8] c"%s won\00"
@.str.16 = [6 x i8] c"Green\00"
@.str.17 = [4 x i8] c"Red\00"
@.str.18 = [7 x i8] c"Nobody\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca [2 x i32]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [8 x [8 x i32]]
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32*
%25 = alloca [8 x i8*]
%26 = alloca [10 x i8]
%27 = alloca i8*
%28 = alloca i8
%29 = alloca i32
%30 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i8* null, i8** %16
%31 = bitcast [2 x i32]* %17 to i8*
store i32 2, i32* %19
store i32 0, i32* %20
store i64 0, i64* @opterr
br label %32
32: ; preds = %129, %2
%33 = load i32, i32* %4
%34 = load i8**, i8*** %5
%35 = call i32 @getopt(i32 %33, i8** %34, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %35, i32* %18
%36 = icmp ne i32 %35, -1
br i1 %36, label %37, label %130
37: ; preds = %32
%38 = load i32, i32* %18
switch i32 %38, label %126 [
i32 104, label %39
i32 118, label %43
i32 99, label %44
i32 117, label %45
i32 100, label %46
i32 114, label %47
i32 108, label %48
i32 76, label %49
i32 72, label %50
i32 115, label %51
i32 65, label %53
i32 66, label %76
i32 63, label %99
]
39: ; preds = %37
%40 = call i32 (...) @usage()
%41 = load i32, i32* %14
%42 = call i32 @quit(i32 1, i32 %41)
br label %43
43: ; preds = %37, %39
store i32 1, i32* %7
br label %129
44: ; preds = %37
store i32 1, i32* %8
br label %129
45: ; preds = %37
store i32 1, i32* %9
br label %129
46: ; preds = %37
store i32 1, i32* %10
br label %129
47: ; preds = %37
store i32 1, i32* %11
br label %129
48: ; preds = %37
store i32 1, i32* %12
br label %129
49: ; preds = %37
store i32 1, i32* %14
br label %129
50: ; preds = %37
store i32 1, i32* %15
br label %129
51: ; preds = %37
%52 = load i8*, i8** @optarg
store i8* %52, i8** %16
store i32 1, i32* %13
br label %129
53: ; preds = %37
%54 = load i8*, i8** @optarg
%55 = icmp ne i8* %54, null
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i8*, i8** @optarg
%58 = call i32 @atoi(i8* %57)
store i32 %58, i32* %19
br label %59
59: ; preds = %56, %53
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
store i32 1, i32* %60
%61 = load i32, i32* %19
%62 = icmp slt i32 %61, 1
br i1 %62, label %66, label %63
63: ; preds = %59
%64 = load i32, i32* %19
%65 = icmp sgt i32 %64, 9
br i1 %65, label %66, label %75
66: ; preds = %63, %59
%67 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%68 = load i8*, i8** @optarg
%69 = call i32 (i8*, i8*, ...) @sprintf(i8* %67, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %68, i32 9)
%70 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%71 = call i32 @printmsg(i8* %70, i32 5)
%72 = call i32 (...) @usage()
%73 = load i32, i32* %14
%74 = call i32 @quit(i32 5, i32 %73)
br label %75
75: ; preds = %66, %63
br label %129
76: ; preds = %37
%77 = load i8*, i8** @optarg
%78 = icmp ne i8* %77, null
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = load i8*, i8** @optarg
%81 = call i32 @atoi(i8* %80)
store i32 %81, i32* %19
br label %82
82: ; preds = %79, %76
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 1
store i32 1, i32* %83
%84 = load i32, i32* %19
%85 = icmp slt i32 %84, 1
br i1 %85, label %89, label %86
86: ; preds = %82
%87 = load i32, i32* %19
%88 = icmp sgt i32 %87, 9
br i1 %88, label %89, label %98
89: ; preds = %86, %82
%90 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%91 = load i8*, i8** @optarg
%92 = call i32 (i8*, i8*, ...) @sprintf(i8* %90, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %91, i32 9)
%93 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%94 = call i32 @printmsg(i8* %93, i32 5)
%95 = call i32 (...) @usage()
%96 = load i32, i32* %14
%97 = call i32 @quit(i32 5, i32 %96)
br label %98
98: ; preds = %89, %86
br label %129
99: ; preds = %37
%100 = load i8, i8* @optopt
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 115
br i1 %102, label %115, label %103
103: ; preds = %99
%104 = load i8, i8* @optopt
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 116
br i1 %106, label %115, label %107
107: ; preds = %103
%108 = load i8, i8* @optopt
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 65
br i1 %110, label %115, label %111
111: ; preds = %107
%112 = load i8, i8* @optopt
%113 = sext i8 %112 to i32
%114 = icmp eq i32 %113, 66
br i1 %114, label %115, label %117
115: ; preds = %111, %107, %103, %99
%116 = call i32 @printmsg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 5)
br label %125
117: ; preds = %111
%118 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%119 = load i8, i8* @optopt
%120 = sext i8 %119 to i32
%121 = call i32 (i8*, i8*, ...) @sprintf(i8* %118, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %120)
%122 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%123 = call i32 @printmsg(i8* %122, i32 5)
%124 = call i32 (...) @usage()
store i32 1, i32* %3
br label %439
125: ; preds = %115
br label %129
126: ; preds = %37
%127 = call i32 @printmsg(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i32 5)
%128 = call i32 (...) @usage()
store i32 1, i32* %3
br label %439
129: ; preds = %125, %98, %75, %51, %50, %49, %48, %47, %46, %45, %44, %43
br label %32
130: ; preds = %32
%131 = load i32, i32* @optind
%132 = load i32, i32* %4
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %145
134: ; preds = %130
%135 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%136 = load i8**, i8*** %5
%137 = load i32, i32* @optind
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %136, i64 %138
%140 = load i8*, i8** %139
%141 = call i32 (i8*, i8*, ...) @sprintf(i8* %135, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %140)
%142 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%143 = call i32 @printmsg(i8* %142, i32 5)
%144 = call i32 (...) @usage()
store i32 5, i32* %3
br label %439
145: ; preds = %130
%146 = load i32, i32* %13
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %244
148: ; preds = %145
%149 = load i8*, i8** %16
%150 = call i32* @fopen(i8* %149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %150, i32** %24
%151 = load i32*, i32** %24
%152 = icmp eq i32* %151, null
br i1 %152, label %153, label %159
153: ; preds = %148
%154 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%155 = load i8*, i8** %16
%156 = call i32 (i8*, i8*, ...) @sprintf(i8* %154, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* %155)
%157 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%158 = call i32 @printmsg(i8* %157, i32 3)
store i32 3, i32* %3
br label %439
159: ; preds = %148
store i32 0, i32* %22
br label %160
160: ; preds = %165, %159
%161 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%162 = load i32*, i32** %24
%163 = call i8* @fgets(i8* %161, i32 10, i32* %162)
store i8* %163, i8** %27
%164 = icmp ne i8* %163, null
br i1 %164, label %165, label %175
165: ; preds = %160
%166 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%167 = call i32 @strtok(i8* %166, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%168 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%169 = call i8* @strdup(i8* %168)
%170 = load i32, i32* %22
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [8 x i8*], [8 x i8*]* %25, i64 0, i64 %171
store i8* %169, i8** %172
%173 = load i32, i32* %22
%174 = add nsw i32 %173, 1
store i32 %174, i32* %22
br label %160
175: ; preds = %160
%176 = load i32, i32* %22
%177 = icmp ne i32 %176, 8
br i1 %177, label %178, label %180
178: ; preds = %175
%179 = call i32 @printmsg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 3)
store i32 3, i32* %3
br label %439
180: ; preds = %175
store i32 0, i32* %22
br label %181
181: ; preds = %240, %180
%182 = load i32, i32* %22
%183 = icmp slt i32 %182, 8
br i1 %183, label %184, label %243
184: ; preds = %181
store i32 0, i32* %23
br label %185
185: ; preds = %236, %184
%186 = load i32, i32* %23
%187 = icmp slt i32 %186, 8
br i1 %187, label %188, label %239
188: ; preds = %185
%189 = load i32, i32* %22
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [8 x i8*], [8 x i8*]* %25, i64 0, i64 %190
%192 = load i8*, i8** %191
%193 = load i32, i32* %23
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i8, i8* %192, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
switch i32 %197, label %219 [
i32 79, label %198
i32 88, label %205
i32 46, label %212
]
198: ; preds = %188
%199 = load i32, i32* %22
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 %200
%202 = load i32, i32* %23
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [8 x i32], [8 x i32]* %201, i64 0, i64 %203
store i32 0, i32* %204
br label %235
205: ; preds = %188
%206 = load i32, i32* %22
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 %207
%209 = load i32, i32* %23
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [8 x i32], [8 x i32]* %208, i64 0, i64 %210
store i32 1, i32* %211
br label %235
212: ; preds = %188
%213 = load i32, i32* %22
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 %214
%216 = load i32, i32* %23
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [8 x i32], [8 x i32]* %215, i64 0, i64 %217
store i32 2, i32* %218
br label %235
219: ; preds = %188
%220 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%221 = load i32, i32* %22
%222 = load i32, i32* %23
%223 = load i32, i32* %22
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [8 x i8*], [8 x i8*]* %25, i64 0, i64 %224
%226 = load i8*, i8** %225
%227 = load i32, i32* %23
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i8, i8* %226, i64 %228
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = call i32 (i8*, i8*, ...) @sprintf(i8* %220, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.10, i64 0, i64 0), i32 %221, i32 %222, i32 %231)
%233 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%234 = call i32 @printmsg(i8* %233, i32 3)
store i32 3, i32* %3
br label %439
235: ; preds = %212, %205, %198
br label %236
236: ; preds = %235
%237 = load i32, i32* %23
%238 = add nsw i32 %237, 1
store i32 %238, i32* %23
br label %185
239: ; preds = %185
br label %240
240: ; preds = %239
%241 = load i32, i32* %22
%242 = add nsw i32 %241, 1
store i32 %242, i32* %22
br label %181
243: ; preds = %181
br label %275
244: ; preds = %145
store i32 0, i32* %22
br label %245
245: ; preds = %263, %244
%246 = load i32, i32* %22
%247 = icmp slt i32 %246, 8
br i1 %247, label %248, label %266
248: ; preds = %245
store i32 0, i32* %23
br label %249
249: ; preds = %259, %248
%250 = load i32, i32* %23
%251 = icmp slt i32 %250, 8
br i1 %251, label %252, label %262
252: ; preds = %249
%253 = load i32, i32* %22
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 %254
%256 = load i32, i32* %23
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds [8 x i32], [8 x i32]* %255, i64 0, i64 %257
store i32 2, i32* %258
br label %259
259: ; preds = %252
%260 = load i32, i32* %23
%261 = add nsw i32 %260, 1
store i32 %261, i32* %23
br label %249
262: ; preds = %249
br label %263
263: ; preds = %262
%264 = load i32, i32* %22
%265 = add nsw i32 %264, 1
store i32 %265, i32* %22
br label %245
266: ; preds = %245
%267 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 3
%268 = getelementptr inbounds [8 x i32], [8 x i32]* %267, i64 0, i64 3
store i32 0, i32* %268
%269 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 4
%270 = getelementptr inbounds [8 x i32], [8 x i32]* %269, i64 0, i64 3
store i32 1, i32* %270
%271 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 4
%272 = getelementptr inbounds [8 x i32], [8 x i32]* %271, i64 0, i64 4
store i32 0, i32* %272
%273 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 3
%274 = getelementptr inbounds [8 x i32], [8 x i32]* %273, i64 0, i64 4
store i32 1, i32* %274
br label %275
275: ; preds = %266, %243
%276 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%277 = bitcast [8 x i32]* %276 to i32**
%278 = load i32, i32* %20
%279 = load i32, i32* %9
%280 = load i32, i32* %10
%281 = load i32, i32* %11
%282 = load i32, i32* %12
%283 = load i32, i32* %8
%284 = load i32, i32* %15
%285 = call i32 @draw(i32** %277, i32 %278, i32 %279, i32 %280, i32 %281, i32 %282, i32 %283, i32 %284)
%286 = load i32, i32* %20
%287 = call i32 @printturn(i32 %286)
%288 = call i32 @time(i32* null)
%289 = call i32 @srand(i32 %288)
br label %290
290: ; preds = %419, %328, %275
%291 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%292 = bitcast [8 x i32]* %291 to i32**
%293 = call i32 @won(i32** %292)
%294 = icmp eq i32 %293, 2
br i1 %294, label %295, label %420
295: ; preds = %290
%296 = load i32, i32* %20
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 %297
%299 = load i32, i32* %298
%300 = icmp eq i32 %299, 0
br i1 %300, label %301, label %348
301: ; preds = %295
%302 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %28, i32* %29)
%303 = load i64, i64* @EOF
%304 = icmp eq i64 %302, %303
br i1 %304, label %305, label %306
305: ; preds = %301
br label %420
306: ; preds = %301
%307 = load i8, i8* %28
%308 = sext i8 %307 to i32
%309 = icmp sle i32 97, %308
br i1 %309, label %310, label %314
310: ; preds = %306
%311 = load i8, i8* %28
%312 = sext i8 %311 to i32
%313 = icmp sle i32 %312, 104
br i1 %313, label %322, label %314
314: ; preds = %310, %306
%315 = load i8, i8* %28
%316 = sext i8 %315 to i32
%317 = icmp sle i32 65, %316
br i1 %317, label %318, label %328
318: ; preds = %314
%319 = load i8, i8* %28
%320 = sext i8 %319 to i32
%321 = icmp sle i32 %320, 72
br i1 %321, label %322, label %328
322: ; preds = %318, %310
%323 = load i32, i32* %29
%324 = icmp sle i32 1, %323
br i1 %324, label %325, label %328
325: ; preds = %322
%326 = load i32, i32* %29
%327 = icmp sle i32 %326, 8
br i1 %327, label %337, label %328
328: ; preds = %325, %322, %318, %314
%329 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%330 = load i32, i32* %29
%331 = sub nsw i32 8, %330
%332 = load i8, i8* %28
%333 = sext i8 %332 to i32
%334 = call i32 (i8*, i8*, ...) @sprintf(i8* %329, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %331, i32 %333)
%335 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%336 = call i32 @printmsg(i8* %335, i32 3)
br label %290
337: ; preds = %325
%338 = load i8, i8* %28
%339 = sext i8 %338 to i32
%340 = srem i32 %339, 65
%341 = trunc i32 %340 to i8
store i8 %341, i8* %28
%342 = load i8, i8* %28
%343 = sext i8 %342 to i32
%344 = srem i32 %343, 32
%345 = trunc i32 %344 to i8
store i8 %345, i8* %28
%346 = load i32, i32* %29
%347 = sub nsw i32 8, %346
store i32 %347, i32* %29
br label %371
348: ; preds = %295
%349 = load i32, i32* %20
%350 = icmp eq i32 %349, 0
br i1 %350, label %351, label %357
351: ; preds = %348
%352 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%353 = bitcast [8 x i32]* %352 to i32**
%354 = load i32, i32* %20
%355 = load i32, i32* %19
%356 = call i32 @bestmove(i32** %353, i32 %354, i32* %29, i8* %28, i32* %30, i32 %355)
br label %363
357: ; preds = %348
%358 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%359 = bitcast [8 x i32]* %358 to i32**
%360 = load i32, i32* %20
%361 = load i32, i32* %19
%362 = call i32 @bestmove(i32** %359, i32 %360, i32* %29, i8* %28, i32* %30, i32 %361)
br label %363
363: ; preds = %357, %351
%364 = load i8, i8* %28
%365 = sext i8 %364 to i32
%366 = add nsw i32 %365, 65
%367 = trunc i32 %366 to i8
%368 = load i32, i32* %29
%369 = sub nsw i32 8, %368
%370 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8 signext %367, i32 %369)
br label %371
371: ; preds = %363, %337
%372 = load i32, i32* %29
%373 = load i8, i8* %28
%374 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%375 = bitcast [8 x i32]* %374 to i32**
%376 = load i32, i32* %20
%377 = call i64 @islegal(i32 %372, i8 signext %373, i32** %375, i32 %376)
%378 = icmp ne i64 %377, 0
br i1 %378, label %379, label %409
379: ; preds = %371
%380 = load i32, i32* %29
%381 = load i8, i8* %28
%382 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%383 = bitcast [8 x i32]* %382 to i32**
%384 = load i32, i32* %20
%385 = call i32 @domove(i32 %380, i8 signext %381, i32** %383, i32 %384)
%386 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%387 = bitcast [8 x i32]* %386 to i32**
%388 = load i32, i32* %20
%389 = call i32 @nextturn(i32** %387, i32 %388)
store i32 %389, i32* %20
%390 = load i32, i32* %7
%391 = icmp ne i32 %390, 0
br i1 %391, label %392, label %405
392: ; preds = %379
%393 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%394 = bitcast [8 x i32]* %393 to i32**
%395 = load i32, i32* %20
%396 = load i32, i32* %9
%397 = load i32, i32* %10
%398 = load i32, i32* %11
%399 = load i32, i32* %12
%400 = load i32, i32* %8
%401 = load i32, i32* %15
%402 = call i32 @draw(i32** %394, i32 %395, i32 %396, i32 %397, i32 %398, i32 %399, i32 %400, i32 %401)
%403 = load i32, i32* %20
%404 = call i32 @printturn(i32 %403)
br label %405
405: ; preds = %392, %379
%406 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%407 = bitcast [8 x i32]* %406 to i32**
%408 = call i32 @showscore(i32** %407)
br label %419
409: ; preds = %371
%410 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%411 = load i32, i32* %29
%412 = sub nsw i32 8, %411
%413 = load i8, i8* %28
%414 = sext i8 %413 to i32
%415 = add nsw i32 %414, 65
%416 = call i32 (i8*, i8*, ...) @sprintf(i8* %410, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %412, i32 %415)
%417 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%418 = call i32 @printmsg(i8* %417, i32 2)
br label %419
419: ; preds = %409, %405
br label %290
420: ; preds = %305, %290
%421 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%422 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%423 = bitcast [8 x i32]* %422 to i32**
%424 = call i32 @won(i32** %423)
%425 = icmp eq i32 %424, 0
br i1 %425, label %426, label %427
426: ; preds = %420
br label %434
427: ; preds = %420
%428 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %21, i64 0, i64 0
%429 = bitcast [8 x i32]* %428 to i32**
%430 = call i32 @won(i32** %429)
%431 = icmp eq i32 %430, 1
%432 = zext i1 %431 to i64
%433 = select i1 %431, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
br label %434
434: ; preds = %427, %426
%435 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %426 ], [ %433, %427 ]
%436 = call i32 (i8*, i8*, ...) @sprintf(i8* %421, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %435)
%437 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%438 = call i32 @printmsg(i8* %437, i32 1)
store i32 0, i32* %3
br label %439
439: ; preds = %434, %219, %178, %153, %134, %126, %117
%440 = load i32, i32* %3
ret i32 %440
}

LLVM IR (-O2):
@opterr = global i64 0
@.str = [20 x i8] c"hs:t:vcLHudrlA::B::\00"
@optarg = global i8* null
@.str.1 = [63 x i8] c"Invalid level: %s. Level must be between 1 and %d (inclusive).\00"
@optopt = global i8 0
@.str.2 = [32 x i8] c"Option -s requires an argument.\00"
@.str.3 = [19 x i8] c"Unknown option -%c\00"
@.str.4 = [53 x i8] c"Unknown commmand line option caused an unknown error\00"
@optind = global i32 0
@.str.5 = [32 x i8] c"Unknow additional parameter: %s\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [20 x i8] c"Can't read file: %s\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [19 x i8] c"Invalid input file\00"
@.str.10 = [71 x i8] c"Invalid input file, invalid char at position i=%d j=%d which was %cEND\00"
@.str.11 = [7 x i8] c" %c %d\00"
@EOF = global i64 0
@.str.12 = [33 x i8] c"Out of bounds: row=%d column=%c.\00"
@.str.13 = [23 x i8] c"Computer's move: %c%d\0A\00"
@.str.14 = [31 x i8] c"Invalid move: row=%d column=%c\00"
@.str.15 = [7 x i8] c"%s won\00"
@.str.16 = [6 x i8] c"Green\00"
@.str.17 = [4 x i8] c"Red\00"
@.str.18 = [7 x i8] c"Nobody\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [80 x i8]
%4 = alloca i64
%5 = bitcast i64* %4 to [2 x i32]*
%6 = alloca [8 x [8 x i32]]
%7 = alloca [8 x i8*]
%8 = alloca [10 x i8]
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%13 = bitcast i64* %4 to i8*
store i64 0, i64* @opterr
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%15 = bitcast i64* %4 to i32*
br label %16
16: ; preds = %34, %2
%17 = phi i32 [ 0, %2 ], [ %35, %34 ]
%18 = phi i32 [ 0, %2 ], [ %36, %34 ]
%19 = phi i32 [ 0, %2 ], [ %37, %34 ]
%20 = phi i32 [ 0, %2 ], [ %38, %34 ]
%21 = phi i32 [ 0, %2 ], [ %39, %34 ]
%22 = phi i32 [ 0, %2 ], [ %40, %34 ]
%23 = phi i32 [ 0, %2 ], [ %41, %34 ]
%24 = phi i32 [ 0, %2 ], [ %42, %34 ]
%25 = phi i32 [ 0, %2 ], [ %43, %34 ]
%26 = phi i8* [ null, %2 ], [ %44, %34 ]
%27 = phi i32 [ 0, %2 ], [ %45, %34 ]
%28 = phi i32 [ 2, %2 ], [ %46, %34 ]
%29 = phi i32 [ 0, %2 ], [ %47, %34 ]
%30 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
switch i32 %30, label %94 [
i32 -1, label %97
i32 104, label %31
i32 118, label %34
i32 99, label %48
i32 117, label %49
i32 100, label %50
i32 114, label %51
i32 108, label %52
i32 76, label %53
i32 72, label %54
i32 115, label %55
i32 65, label %57
i32 66, label %71
i32 63, label %85
]
31: ; preds = %16
%32 = call i32 (...) @usage()
%33 = call i32 @quit(i32 1, i32 %24)
br label %34
34: ; preds = %31, %16, %80, %76, %66, %62, %87, %55, %54, %53, %52, %51, %50, %49, %48
%35 = phi i32 [ %17, %87 ], [ %17, %80 ], [ %17, %76 ], [ 1, %66 ], [ 1, %62 ], [ %17, %55 ], [ %17, %54 ], [ %17, %53 ], [ %17, %52 ], [ %17, %51 ], [ %17, %50 ], [ %17, %49 ], [ %17, %48 ], [ %17, %16 ], [ %17, %31 ]
%36 = phi i32 [ %18, %87 ], [ 1, %80 ], [ 1, %76 ], [ %18, %66 ], [ %18, %62 ], [ %18, %55 ], [ %18, %54 ], [ %18, %53 ], [ %18, %52 ], [ %18, %51 ], [ %18, %50 ], [ %18, %49 ], [ %18, %48 ], [ %18, %16 ], [ %18, %31 ]
%37 = phi i32 [ %19, %87 ], [ %19, %80 ], [ %19, %76 ], [ %19, %66 ], [ %19, %62 ], [ %19, %55 ], [ %19, %54 ], [ %19, %53 ], [ %19, %52 ], [ %19, %51 ], [ %19, %50 ], [ 1, %49 ], [ %19, %48 ], [ %19, %16 ], [ %19, %31 ]
%38 = phi i32 [ %20, %87 ], [ %20, %80 ], [ %20, %76 ], [ %20, %66 ], [ %20, %62 ], [ %20, %55 ], [ %20, %54 ], [ %20, %53 ], [ %20, %52 ], [ %20, %51 ], [ 1, %50 ], [ %20, %49 ], [ %20, %48 ], [ %20, %16 ], [ %20, %31 ]
%39 = phi i32 [ %21, %87 ], [ %21, %80 ], [ %21, %76 ], [ %21, %66 ], [ %21, %62 ], [ %21, %55 ], [ %21, %54 ], [ %21, %53 ], [ %21, %52 ], [ 1, %51 ], [ %21, %50 ], [ %21, %49 ], [ %21, %48 ], [ %21, %16 ], [ %21, %31 ]
%40 = phi i32 [ %22, %87 ], [ %22, %80 ], [ %22, %76 ], [ %22, %66 ], [ %22, %62 ], [ %22, %55 ], [ %22, %54 ], [ %22, %53 ], [ 1, %52 ], [ %22, %51 ], [ %22, %50 ], [ %22, %49 ], [ %22, %48 ], [ %22, %16 ], [ %22, %31 ]
%41 = phi i32 [ %23, %87 ], [ %23, %80 ], [ %23, %76 ], [ %23, %66 ], [ %23, %62 ], [ 1, %55 ], [ %23, %54 ], [ %23, %53 ], [ %23, %52 ], [ %23, %51 ], [ %23, %50 ], [ %23, %49 ], [ %23, %48 ], [ %23, %16 ], [ %23, %31 ]
%42 = phi i32 [ %24, %87 ], [ %24, %80 ], [ %24, %76 ], [ %24, %66 ], [ %24, %62 ], [ %24, %55 ], [ %24, %54 ], [ 1, %53 ], [ %24, %52 ], [ %24, %51 ], [ %24, %50 ], [ %24, %49 ], [ %24, %48 ], [ %24, %16 ], [ %24, %31 ]
%43 = phi i32 [ %25, %87 ], [ %25, %80 ], [ %25, %76 ], [ %25, %66 ], [ %25, %62 ], [ %25, %55 ], [ 1, %54 ], [ %25, %53 ], [ %25, %52 ], [ %25, %51 ], [ %25, %50 ], [ %25, %49 ], [ %25, %48 ], [ %25, %16 ], [ %25, %31 ]
%44 = phi i8* [ %26, %87 ], [ %26, %80 ], [ %26, %76 ], [ %26, %66 ], [ %26, %62 ], [ %56, %55 ], [ %26, %54 ], [ %26, %53 ], [ %26, %52 ], [ %26, %51 ], [ %26, %50 ], [ %26, %49 ], [ %26, %48 ], [ %26, %16 ], [ %26, %31 ]
%45 = phi i32 [ %27, %87 ], [ %27, %80 ], [ %27, %76 ], [ %27, %66 ], [ %27, %62 ], [ %27, %55 ], [ %27, %54 ], [ %27, %53 ], [ %27, %52 ], [ %27, %51 ], [ %27, %50 ], [ %27, %49 ], [ 1, %48 ], [ %27, %16 ], [ %27, %31 ]
%46 = phi i32 [ %28, %87 ], [ %77, %80 ], [ %77, %76 ], [ %63, %66 ], [ %63, %62 ], [ %28, %55 ], [ %28, %54 ], [ %28, %53 ], [ %28, %52 ], [ %28, %51 ], [ %28, %50 ], [ %28, %49 ], [ %28, %48 ], [ %28, %16 ], [ %28, %31 ]
%47 = phi i32 [ %29, %87 ], [ %29, %80 ], [ %29, %76 ], [ %29, %66 ], [ %29, %62 ], [ %29, %55 ], [ %29, %54 ], [ %29, %53 ], [ %29, %52 ], [ %29, %51 ], [ %29, %50 ], [ %29, %49 ], [ %29, %48 ], [ 1, %16 ], [ 1, %31 ]
br label %16
48: ; preds = %16
br label %34
49: ; preds = %16
br label %34
50: ; preds = %16
br label %34
51: ; preds = %16
br label %34
52: ; preds = %16
br label %34
53: ; preds = %16
br label %34
54: ; preds = %16
br label %34
55: ; preds = %16
%56 = load i8*, i8** @optarg
br label %34
57: ; preds = %16
%58 = load i8*, i8** @optarg
%59 = icmp eq i8* %58, null
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = call i32 @atoi(i8* %58)
br label %62
62: ; preds = %60, %57
%63 = phi i32 [ %61, %60 ], [ %28, %57 ]
%64 = add i32 %63, -10
%65 = icmp ult i32 %64, -9
br i1 %65, label %66, label %34
66: ; preds = %62
%67 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %58, i32 9)
%68 = call i32 @printmsg(i8* %12, i32 5)
%69 = call i32 (...) @usage()
%70 = call i32 @quit(i32 5, i32 %24)
br label %34
71: ; preds = %16
%72 = load i8*, i8** @optarg
%73 = icmp eq i8* %72, null
br i1 %73, label %76, label %74
74: ; preds = %71
%75 = call i32 @atoi(i8* %72)
br label %76
76: ; preds = %74, %71
%77 = phi i32 [ %75, %74 ], [ %28, %71 ]
%78 = add i32 %77, -10
%79 = icmp ult i32 %78, -9
br i1 %79, label %80, label %34
80: ; preds = %76
%81 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %72, i32 9)
%82 = call i32 @printmsg(i8* %12, i32 5)
%83 = call i32 (...) @usage()
%84 = call i32 @quit(i32 5, i32 %24)
br label %34
85: ; preds = %16
%86 = load i8, i8* @optopt
switch i8 %86, label %89 [
i8 116, label %87
i8 115, label %87
i8 66, label %87
i8 65, label %87
]
87: ; preds = %85, %85, %85, %85
%88 = call i32 @printmsg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 5)
br label %34
89: ; preds = %85
store i32 %18, i32* %14
%90 = sext i8 %86 to i32
%91 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %90)
%92 = call i32 @printmsg(i8* %12, i32 5)
%93 = call i32 (...) @usage()
br label %346
94: ; preds = %16
%95 = call i32 @printmsg(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i32 5)
%96 = call i32 (...) @usage()
br label %346
97: ; preds = %16
store i32 %18, i32* %14
store i32 %17, i32* %15
%98 = load i32, i32* @optind
%99 = icmp slt i32 %98, %0
br i1 %99, label %100, label %107
100: ; preds = %97
%101 = sext i32 %98 to i64
%102 = getelementptr inbounds i8*, i8** %1, i64 %101
%103 = load i8*, i8** %102
%104 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* %103)
%105 = call i32 @printmsg(i8* %12, i32 5)
%106 = call i32 (...) @usage()
br label %346
107: ; preds = %97
%108 = bitcast [8 x [8 x i32]]* %6 to i8*
%109 = icmp eq i32 %23, 0
br i1 %109, label %212, label %110
110: ; preds = %107
%111 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%112 = icmp eq i32* %111, null
br i1 %112, label %113, label %116
113: ; preds = %110
%114 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* %26)
%115 = call i32 @printmsg(i8* %12, i32 3)
br label %344
116: ; preds = %110
%117 = bitcast [8 x i8*]* %7 to i8*
%118 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%119 = call i8* @fgets(i8* %118, i32 10, i32* %111)
%120 = icmp eq i8* %119, null
br i1 %120, label %132, label %121
121: ; preds = %116, %121
%122 = phi i64 [ %126, %121 ], [ 0, %116 ]
%123 = call i32 @strtok(i8* %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%124 = call i8* @strdup(i8* %118)
%125 = getelementptr inbounds [8 x i8*], [8 x i8*]* %7, i64 0, i64 %122
store i8* %124, i8** %125
%126 = add nuw i64 %122, 1
%127 = call i8* @fgets(i8* %118, i32 10, i32* %111)
%128 = icmp eq i8* %127, null
br i1 %128, label %129, label %121
129: ; preds = %121
%130 = trunc i64 %126 to i32
%131 = icmp eq i32 %130, 8
br i1 %131, label %134, label %132
132: ; preds = %116, %129
%133 = call i32 @printmsg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 3)
br label %210
134: ; preds = %129, %205
%135 = phi i64 [ %208, %205 ], [ 0, %129 ]
%136 = getelementptr inbounds [8 x i8*], [8 x i8*]* %7, i64 0, i64 %135
%137 = load i8*, i8** %136
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
switch i32 %139, label %142 [
i32 79, label %149
i32 88, label %140
i32 46, label %141
]
140: ; preds = %134
br label %149
141: ; preds = %134
br label %149
142: ; preds = %134, %149, %157, %165, %173, %181, %189, %197
%143 = phi i8 [ %201, %197 ], [ %193, %189 ], [ %185, %181 ], [ %177, %173 ], [ %169, %165 ], [ %161, %157 ], [ %153, %149 ], [ %138, %134 ]
%144 = phi i32 [ 7, %197 ], [ 6, %189 ], [ 5, %181 ], [ 4, %173 ], [ 3, %165 ], [ 2, %157 ], [ 1, %149 ], [ 0, %134 ]
%145 = sext i8 %143 to i32
%146 = trunc i64 %135 to i32
%147 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.10, i64 0, i64 0), i32 %146, i32 %144, i32 %145)
%148 = call i32 @printmsg(i8* %12, i32 3)
br label %210
149: ; preds = %134, %140, %141
%150 = phi i32 [ 1, %140 ], [ 2, %141 ], [ 0, %134 ]
%151 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 0
store i32 %150, i32* %151
%152 = getelementptr inbounds i8, i8* %137, i64 1
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
switch i32 %154, label %142 [
i32 79, label %156
i32 88, label %155
i32 46, label %157
]
155: ; preds = %149
br label %157
156: ; preds = %149
br label %157
157: ; preds = %149, %156, %155
%158 = phi i32 [ 0, %156 ], [ 1, %155 ], [ 2, %149 ]
%159 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 1
store i32 %158, i32* %159
%160 = getelementptr inbounds i8, i8* %137, i64 2
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
switch i32 %162, label %142 [
i32 79, label %164
i32 88, label %163
i32 46, label %165
]
163: ; preds = %157
br label %165
164: ; preds = %157
br label %165
165: ; preds = %157, %164, %163
%166 = phi i32 [ 0, %164 ], [ 1, %163 ], [ 2, %157 ]
%167 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 2
store i32 %166, i32* %167
%168 = getelementptr inbounds i8, i8* %137, i64 3
%169 = load i8, i8* %168
%170 = sext i8 %169 to i32
switch i32 %170, label %142 [
i32 79, label %172
i32 88, label %171
i32 46, label %173
]
171: ; preds = %165
br label %173
172: ; preds = %165
br label %173
173: ; preds = %165, %172, %171
%174 = phi i32 [ 0, %172 ], [ 1, %171 ], [ 2, %165 ]
%175 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 3
store i32 %174, i32* %175
%176 = getelementptr inbounds i8, i8* %137, i64 4
%177 = load i8, i8* %176
%178 = sext i8 %177 to i32
switch i32 %178, label %142 [
i32 79, label %180
i32 88, label %179
i32 46, label %181
]
179: ; preds = %173
br label %181
180: ; preds = %173
br label %181
181: ; preds = %173, %180, %179
%182 = phi i32 [ 0, %180 ], [ 1, %179 ], [ 2, %173 ]
%183 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 4
store i32 %182, i32* %183
%184 = getelementptr inbounds i8, i8* %137, i64 5
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
switch i32 %186, label %142 [
i32 79, label %188
i32 88, label %187
i32 46, label %189
]
187: ; preds = %181
br label %189
188: ; preds = %181
br label %189
189: ; preds = %181, %188, %187
%190 = phi i32 [ 0, %188 ], [ 1, %187 ], [ 2, %181 ]
%191 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 5
store i32 %190, i32* %191
%192 = getelementptr inbounds i8, i8* %137, i64 6
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
switch i32 %194, label %142 [
i32 79, label %196
i32 88, label %195
i32 46, label %197
]
195: ; preds = %189
br label %197
196: ; preds = %189
br label %197
197: ; preds = %189, %196, %195
%198 = phi i32 [ 0, %196 ], [ 1, %195 ], [ 2, %189 ]
%199 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 6
store i32 %198, i32* %199
%200 = getelementptr inbounds i8, i8* %137, i64 7
%201 = load i8, i8* %200
%202 = sext i8 %201 to i32
switch i32 %202, label %142 [
i32 79, label %204
i32 88, label %203
i32 46, label %205
]
203: ; preds = %197
br label %205
204: ; preds = %197
br label %205
205: ; preds = %197, %204, %203
%206 = phi i32 [ 0, %204 ], [ 1, %203 ], [ 2, %197 ]
%207 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 %135, i64 7
store i32 %206, i32* %207
%208 = add nuw nsw i64 %135, 1
%209 = icmp eq i64 %208, 8
br i1 %209, label %211, label %134
210: ; preds = %132, %142
br label %344
211: ; preds = %205
br label %248
212: ; preds = %107
%213 = bitcast [8 x [8 x i32]]* %6 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %213
%214 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 0, i64 4
%215 = bitcast i32* %214 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %215
%216 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 1, i64 0
%217 = bitcast i32* %216 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %217
%218 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 1, i64 4
%219 = bitcast i32* %218 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %219
%220 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 2, i64 0
%221 = bitcast i32* %220 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %221
%222 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 2, i64 4
%223 = bitcast i32* %222 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %223
%224 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 3, i64 0
%225 = bitcast i32* %224 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %225
%226 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 3, i64 4
%227 = bitcast i32* %226 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %227
%228 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 4, i64 0
%229 = bitcast i32* %228 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %229
%230 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 4, i64 4
%231 = bitcast i32* %230 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %231
%232 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 5, i64 0
%233 = bitcast i32* %232 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %233
%234 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 5, i64 4
%235 = bitcast i32* %234 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %235
%236 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 6, i64 0
%237 = bitcast i32* %236 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %237
%238 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 6, i64 4
%239 = bitcast i32* %238 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %239
%240 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 7, i64 0
%241 = bitcast i32* %240 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %241
%242 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 7, i64 4
%243 = bitcast i32* %242 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %243
%244 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 3, i64 3
store i32 0, i32* %244
%245 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 4, i64 3
store i32 1, i32* %245
%246 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 4, i64 4
store i32 0, i32* %246
%247 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 3, i64 4
store i32 1, i32* %247
br label %248
248: ; preds = %211, %212
%249 = bitcast i32* %10 to i8*
%250 = bitcast i32* %11 to i8*
%251 = bitcast [8 x [8 x i32]]* %6 to i32**
%252 = call i32 @draw(i32** %251, i32 0, i32 %19, i32 %20, i32 %21, i32 %22, i32 %27, i32 %25)
%253 = call i32 @printturn(i32 0)
%254 = call i32 @time(i32* null)
%255 = call i32 @srand(i32 %254)
%256 = call i32 @won(i32** %251)
%257 = icmp eq i32 %256, 2
br i1 %257, label %258, label %333
258: ; preds = %248
%259 = icmp eq i32 %29, 0
br label %260
260: ; preds = %258, %329
%261 = phi i32 [ 0, %258 ], [ %330, %329 ]
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %262
%264 = load i32, i32* %263
%265 = icmp eq i32 %264, 0
br i1 %265, label %266, label %298
266: ; preds = %260, %286
%267 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8* %9, i32* %10)
%268 = load i64, i64* @EOF
%269 = icmp eq i64 %267, %268
br i1 %269, label %333, label %270
270: ; preds = %266
%271 = load i8, i8* %9
%272 = add i8 %271, -97
%273 = icmp ult i8 %272, 8
br i1 %273, label %280, label %274
274: ; preds = %270
%275 = add i8 %271, -65
%276 = icmp ult i8 %275, 8
%277 = load i32, i32* %10
%278 = icmp sgt i32 %277, 0
%279 = select i1 %276, i1 %278, i1 false
br i1 %279, label %283, label %286
280: ; preds = %270
%281 = load i32, i32* %10
%282 = icmp sgt i32 %281, 0
br i1 %282, label %283, label %286
283: ; preds = %274, %280
%284 = phi i32 [ %277, %274 ], [ %281, %280 ]
%285 = icmp ult i32 %284, 9
br i1 %285, label %294, label %286
286: ; preds = %283, %280, %274
%287 = phi i32 [ %284, %283 ], [ %281, %280 ], [ %277, %274 ]
%288 = sub nsw i32 8, %287
%289 = sext i8 %271 to i32
%290 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %288, i32 %289)
%291 = call i32 @printmsg(i8* %12, i32 3)
%292 = call i32 @won(i32** %251)
%293 = icmp eq i32 %292, 2
br i1 %293, label %266, label %333
294: ; preds = %283
%295 = urem i8 %271, 65
%296 = and i8 %295, 31
store i8 %296, i8* %9
%297 = sub nuw nsw i32 8, %284
store i32 %297, i32* %10
br label %307
298: ; preds = %260
%299 = call i32 @bestmove(i32** %251, i32 %261, i32* %10, i8* %9, i32* %11, i32 %28)
%300 = load i8, i8* %9
%301 = add i8 %300, 65
%302 = load i32, i32* %10
%303 = sub nsw i32 8, %302
%304 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8 signext %301, i32 %303)
%305 = load i32, i32* %10
%306 = load i8, i8* %9
br label %307
307: ; preds = %298, %294
%308 = phi i8 [ %306, %298 ], [ %296, %294 ]
%309 = phi i32 [ %305, %298 ], [ %297, %294 ]
%310 = call i64 @islegal(i32 %309, i8 signext %308, i32** %251, i32 %261)
%311 = icmp eq i64 %310, 0
%312 = load i32, i32* %10
br i1 %311, label %322, label %313
313: ; preds = %307
%314 = load i8, i8* %9
%315 = call i32 @domove(i32 %312, i8 signext %314, i32** %251, i32 %261)
%316 = call i32 @nextturn(i32** %251, i32 %261)
br i1 %259, label %320, label %317
317: ; preds = %313
%318 = call i32 @draw(i32** %251, i32 %316, i32 %19, i32 %20, i32 %21, i32 %22, i32 %27, i32 %25)
%319 = call i32 @printturn(i32 %316)
br label %320
320: ; preds = %317, %313
%321 = call i32 @showscore(i32** %251)
br label %329
322: ; preds = %307
%323 = sub nsw i32 8, %312
%324 = load i8, i8* %9
%325 = sext i8 %324 to i32
%326 = add nsw i32 %325, 65
%327 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %323, i32 %326)
%328 = call i32 @printmsg(i8* %12, i32 2)
br label %329
329: ; preds = %322, %320
%330 = phi i32 [ %316, %320 ], [ %261, %322 ]
%331 = call i32 @won(i32** %251)
%332 = icmp eq i32 %331, 2
br i1 %332, label %260, label %333
333: ; preds = %329, %286, %266, %248
%334 = call i32 @won(i32** %251)
%335 = icmp eq i32 %334, 0
br i1 %335, label %340, label %336
336: ; preds = %333
%337 = call i32 @won(i32** %251)
%338 = icmp eq i32 %337, 1
%339 = select i1 %338, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0)
br label %340
340: ; preds = %333, %336
%341 = phi i8* [ %339, %336 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %333 ]
%342 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %341)
%343 = call i32 @printmsg(i8* %12, i32 1)
br label %344
344: ; preds = %210, %113, %340
%345 = phi i32 [ 0, %340 ], [ 3, %113 ], [ 3, %210 ]
br label %346
346: ; preds = %344, %100, %94, %89
%347 = phi i32 [ 1, %94 ], [ 1, %89 ], [ 5, %100 ], [ %345, %344 ]
ret i32 %347
}