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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ computer_move(char **, int **, char);
int /*<<< orphan*/ display(char **);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ make_move(char **, int, char, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
char tolower(char);
scalar_t__ valid_moves(char **, int **, char);
int main() {
  char board[6][6] = {0};
  int moves[6][6] = {0};
  int row = 0;
  int col = 0;
  int no_of_games = 0;
  int no_of_moves = 0;
  int invalid_moves = 0;
  int comp_score = 0;
  int user_score = 0;
  char y = 0;
  int x = 0;
  char again = 0;
  int player = 0;
  printf("\nREVERSI\n\n");
  printf("You can go first on the first game, then we will take turns.\n");
  printf("   You will be white - (O)\n   I will be black   - (@).\n");
  printf("Select a square for your move by typing a digit for the row\n "
         "and a letter for the column with no spaces between.\n");
  printf("\nGood luck!  Press Enter to start.\n");
  scanf("%c", &again);
  do {
    player = ++no_of_games % 2;
    no_of_moves = 4;
    for (row = 0; row < 6; row++)
      for (col = 0; col < 6; col++)
        board[row][col] = ' ';
    board[6 / 2 - 1][6 / 2 - 1] = board[6 / 2][6 / 2] = '@';
    board[6 / 2 - 1][6 / 2] = board[6 / 2][6 / 2 - 1] = 'o';
    do {
      display(board);
      if (player++ % 2) {
        if (valid_moves(board, moves, 'O')) {
          for (;;) {
            fflush(stdin);
            printf("Please enter your move (row column): ");
            scanf("%d%c", &x, &y);
            y = tolower(y) - 'a';
            x--;
            if (x >= 0 && y >= 0 && x < 6 && y < 6 && moves[x][y]) {
              make_move(board, x, y, 'O');
              no_of_moves++;
              break;
            } else
              printf("Not a valid move, try again.\n");
          }
        } else if (++invalid_moves < 2) {
          fflush(stdin);
          printf("\nYou have to pass, press return");
          scanf("%c", &again);
        } else
          printf("\nNeither of us can go, so the game is over.\n");
      } else {
        if (valid_moves(board, moves, '@')) {
          invalid_moves = 0;
          computer_move(board, moves, '@');
          no_of_moves++;
        } else {
          if (++invalid_moves < 2)
            printf("\nI have to pass, your go\n");
          else
            printf("\nNeither of us can go, so the game is over.\n");
        }
      }
    } while (no_of_moves < 6 * 6 && invalid_moves < 2);
    display(board);
    comp_score = user_score = 0;
    for (row = 0; row < 6; row++)
      for (col = 0; col < 6; col++) {
        comp_score += board[row][col] == '@';
        user_score += board[row][col] == 'O';
      }
    printf("The final score is:\n");
    printf("Computer %d\n    User %d\n\n", comp_score, user_score);
    fflush(stdin);
    printf("Do you want to play again (y/n): ");
    scanf("%c", &again);
  } while (tolower(again) == 'y');
  printf("\nGoodbye\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1060 <memset@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x90,%edx
call   1060 <memset@plt>
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc8(%rbp)
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0xdc(%rbp)
movb   $0x0,-0xdd(%rbp)
movl   $0x0,-0xe4(%rbp)
movb   $0x0,-0xe5(%rbp)
movl   $0x0,-0xec(%rbp)
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0xe5(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xec(%rbp)
movl   $0x4,-0xd0(%rbp)
movl   $0x0,-0xc4(%rbp)
cmpl   $0x6,-0xc4(%rbp)
jge    1327 <main+0x197>
movl   $0x0,-0xc8(%rbp)
cmpl   $0x6,-0xc8(%rbp)
jge    130e <main+0x17e>
movslq -0xc4(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc8(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    12d0 <main+0x140>
jmp    1313 <main+0x183>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    12b9 <main+0x129>
movb   $0x40,-0x1b(%rbp)
movb   $0x40,-0x22(%rbp)
movb   $0x6f,-0x1c(%rbp)
movb   $0x6f,-0x21(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <display@plt>
mov    -0xec(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xec(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     14f3 <main+0x363>
lea    -0x30(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x4f,%edx
call   10b0 <valid_moves@plt>
cmp    $0x0,%rax
je     148d <main+0x2fd>
jmp    1386 <main+0x1f6>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd94(%rip),%rdi
lea    -0xe4(%rbp),%rsi
lea    -0xdd(%rbp),%rdx
mov    $0x0,%al
call   10a0 <scanf@plt>
movsbl -0xdd(%rbp),%edi
call   1080 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
mov    %al,-0xdd(%rbp)
mov    -0xe4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jl     1475 <main+0x2e5>
movsbl -0xdd(%rbp),%eax
cmp    $0x0,%eax
jl     1475 <main+0x2e5>
cmpl   $0x6,-0xe4(%rbp)
jge    1475 <main+0x2e5>
movsbl -0xdd(%rbp),%eax
cmp    $0x6,%eax
jge    1475 <main+0x2e5>
movslq -0xe4(%rbp),%rcx
lea    -0xc0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsbq -0xdd(%rbp),%rcx
ff
cmpl   $0x0,(%rax,%rcx,4)
je     1475 <main+0x2e5>
lea    -0x30(%rbp),%rdi
mov    -0xe4(%rbp),%esi
mov    $0x4f,%ecx
movsbl -0xdd(%rbp),%edx
call   1030 <make_move@plt>
mov    -0xd0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd0(%rbp)
jmp    1488 <main+0x2f8>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1386 <main+0x1f6>
jmp    14ee <main+0x35e>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
cmp    $0x2,%eax
jge    14db <main+0x34b>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc77(%rip),%rdi
lea    -0xe5(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
jmp    14e9 <main+0x359>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14ee <main+0x35e>
jmp    1588 <main+0x3f8>
lea    -0x30(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x40,%edx
call   10b0 <valid_moves@plt>
cmp    $0x0,%rax
je     1545 <main+0x3b5>
movl   $0x0,-0xd4(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x40,%edx
call   1070 <computer_move@plt>
mov    -0xd0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd0(%rbp)
jmp    1583 <main+0x3f3>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
cmp    $0x2,%eax
jge    1570 <main+0x3e0>
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    157e <main+0x3ee>
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1583 <main+0x3f3>
jmp    1588 <main+0x3f8>
jmp    158d <main+0x3fd>
xor    %eax,%eax
cmpl   $0x24,-0xd0(%rbp)
mov    %al,-0xed(%rbp)
jge    15b2 <main+0x422>
cmpl   $0x2,-0xd4(%rbp)
setl   %al
mov    %al,-0xed(%rbp)
mov    -0xed(%rbp),%al
test   $0x1,%al
jne    1337 <main+0x1a7>
lea    -0x30(%rbp),%rdi
call   1040 <display@plt>
movl   $0x0,-0xdc(%rbp)
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0xc4(%rbp)
cmpl   $0x6,-0xc4(%rbp)
jge    16a0 <main+0x510>
movl   $0x0,-0xc8(%rbp)
cmpl   $0x6,-0xc8(%rbp)
jge    1687 <main+0x4f7>
movslq -0xc4(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xd8(%rbp),%eax
mov    %eax,-0xd8(%rbp)
movslq -0xc4(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movslq -0xc8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xdc(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    15fe <main+0x46e>
jmp    168c <main+0x4fc>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    15e7 <main+0x457>
lea    0xb20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xd8(%rbp),%esi
mov    -0xdc(%rbp),%edx
lea    0xb1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2919(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xb19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xa54(%rip),%rdi
lea    -0xe5(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
movsbl -0xe5(%rbp),%edi
call   1080 <tolower@plt>
movsbl %al,%eax
cmp    $0x79,%eax
je     1288 <main+0xf8>
lea    0xb00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movb   $0x0,0x7(%rsp)
movl   $0x0,0xc(%rsp)
movb   $0x0,0x6(%rsp)
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeea(%rip),%rdi
call   1040 <puts@plt>
lea    0xf15(%rip),%rdi
call   1040 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe20(%rip),%rdi
lea    0x6(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0x20(%rsp),%rbp
lea    0x50(%rsp),%r12
lea    0xe01(%rip),%r13
lea    0xc(%rsp),%r14
lea    0x7(%rsp),%r15
xor    %ebx,%ebx
xor    %eax,%eax
mov    %rax,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
movaps 0xd86(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movl   $0x20202020,0x40(%rsp)
20
mov    %ebx,0x1c(%rsp)
and    $0x1,%ebx
movw   $0x6f40,0x2e(%rsp)
movw   $0x406f,0x34(%rsp)
mov    $0x4,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,0x8(%rsp)
mov    %rbp,%rdi
call   1050 <display@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
test   $0x1,%bl
jne    1300 <main+0x170>
mov    $0x40,%edx
call   10b0 <valid_moves@plt>
test   %rax,%rax
je     13f9 <main+0x269>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    $0x40,%edx
call   1070 <computer_move@plt>
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
xor    %eax,%eax
jmp    1423 <main+0x293>
nopl   0x0(%rax,%rax,1)
mov    $0x4f,%edx
call   10b0 <valid_moves@plt>
test   %rax,%rax
jne    136c <main+0x1dc>
mov    0x10(%rsp),%rax
lea    0x1(%rax),%r12d
test   %eax,%eax
jg     1440 <main+0x2b0>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xd26(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd15(%rip),%rdi
lea    0x6(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
jmp    1412 <main+0x282>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    0x2c75(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xcaf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10a0 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1080 <tolower@plt>
add    $0x9f,%al
mov    %al,0x7(%rsp)
mov    0xc(%rsp),%ecx
lea    -0x1(%rcx),%esi
mov    %esi,0xc(%rsp)
cmp    $0x6,%ecx
jg     1360 <main+0x1d0>
test   %ecx,%ecx
jle    1360 <main+0x1d0>
test   %al,%al
js     1360 <main+0x1d0>
cmp    $0x5,%al
jg     1360 <main+0x1d0>
mov    %esi,%ecx
movzbl %al,%edx
lea    (%rcx,%rcx,2),%rcx
lea    (%rsp,%rcx,8),%rcx
add    $0x50,%rcx
cmpl   $0x0,(%rcx,%rdx,4)
je     1360 <main+0x1d0>
movsbl %al,%edx
mov    %rbp,%rdi
mov    $0x4f,%ecx
call   1030 <make_move@plt>
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
mov    0x10(%rsp),%rax
jmp    1423 <main+0x293>
mov    0x10(%rsp),%rax
lea    0x1(%rax),%r12d
test   %eax,%eax
jg     1440 <main+0x2b0>
lea    0xdd9(%rip),%rdi
call   1040 <puts@plt>
mov    %r12d,%eax
lea    0x20(%rsp),%rbp
lea    0x50(%rsp),%r12
mov    0x8(%rsp),%ecx
cmp    $0x23,%ecx
mov    %rax,0x10(%rsp)
jg     1459 <main+0x2c9>
add    $0x1,%ebx
cmp    $0x2,%eax
jl     12b0 <main+0x120>
jmp    1459 <main+0x2c9>
nopl   0x0(%rax,%rax,1)
lea    0xdb8(%rip),%rdi
call   1040 <puts@plt>
mov    %r12d,%eax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <display@plt>
xor    %ebx,%ebx
mov    $0x5,%eax
xor    %r12d,%r12d
movdqa 0xb9d(%rip),%xmm2
movdqa 0xba5(%rip),%xmm3
nopl   0x0(%rax,%rax,1)
movd   0x1b(%rsp,%rax,1),%xmm0
movzbl 0x1f(%rsp,%rax,1),%ecx
movzbl 0x20(%rsp,%rax,1),%r8d
xor    %esi,%esi
cmp    $0x40,%cl
sete   %sil
xor    %ebp,%ebp
cmp    $0x4f,%cl
sete   %bpl
xor    %edi,%edi
cmp    $0x40,%r8b
sete   %dil
movdqa %xmm0,%xmm1
pcmpeqb %xmm2,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
movmskps %xmm1,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
add    %esi,%ecx
add    %edi,%ecx
add    %ecx,%r12d
xor    %esi,%esi
cmp    $0x4f,%r8b
sete   %sil
pcmpeqb %xmm3,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
add    %ebp,%ecx
add    %esi,%ecx
add    %ecx,%ebx
add    $0x6,%rax
cmp    $0x29,%rax
jne    1480 <main+0x2f0>
lea    0xc88(%rip),%rdi
call   1040 <puts@plt>
lea    0xb2e(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2a88(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xb27(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xadc(%rip),%rdi
lea    0x6(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
movsbl 0x6(%rsp),%edi
call   1080 <tolower@plt>
cmp    $0x79,%al
lea    0x20(%rsp),%rbp
lea    0x50(%rsp),%r12
mov    0x1c(%rsp),%ebx
je     1270 <main+0xe0>
lea    0xc2e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0AREVERSI\0A\0A\00"
@.str.1 = [62 x i8] c"You can go first on the first game, then we will take turns.\0A\00"
@.str.2 = [56 x i8] c" You will be white - (O)\0A I will be black - (@).\0A\00"
@.str.3 = [114 x i8] c"Select a square for your move by typing a digit for the row\0A and a letter for the column with no spaces between.\0A\00"
@.str.4 = [36 x i8] c"\0AGood luck! Press Enter to start.\0A\00"
@.str.5 = [3 x i8] c"%c\00"
@stdin = global i32 0
@.str.6 = [38 x i8] c"Please enter your move (row column): \00"
@.str.7 = [5 x i8] c"%d%c\00"
@.str.8 = [30 x i8] c"Not a valid move, try again.\0A\00"
@.str.9 = [32 x i8] c"\0AYou have to pass, press return\00"
@.str.10 = [45 x i8] c"\0ANeither of us can go, so the game is over.\0A\00"
@.str.11 = [26 x i8] c"\0AI have to pass, your go\0A\00"
@.str.12 = [21 x i8] c"The final score is:\0A\00"
@.str.13 = [26 x i8] c"Computer %d\0A User %d\0A\0A\00"
@.str.14 = [34 x i8] c"Do you want to play again (y/n): \00"
@.str.15 = [10 x i8] c"\0AGoodbye\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x [6 x i8]]
%3 = alloca [6 x [6 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i32
%13 = alloca i8
%14 = alloca i32
store i32 0, i32* %1
%15 = bitcast [6 x [6 x i8]]* %2 to i8*
%16 = bitcast [6 x [6 x i32]]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8 0, i8* %11
store i32 0, i32* %12
store i8 0, i8* %13
store i32 0, i32* %14
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
br label %23
23: ; preds = %218, %0
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
%26 = srem i32 %25, 2
store i32 %26, i32* %14
store i32 4, i32* %7
store i32 0, i32* %4
br label %27
27: ; preds = %45, %23
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 6
br i1 %29, label %30, label %48
30: ; preds = %27
store i32 0, i32* %5
br label %31
31: ; preds = %41, %30
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 6
br i1 %33, label %34, label %44
34: ; preds = %31
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 %36
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [6 x i8], [6 x i8]* %37, i64 0, i64 %39
store i8 32, i8* %40
br label %41
41: ; preds = %34
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %31
44: ; preds = %31
br label %45
45: ; preds = %44
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %27
48: ; preds = %27
%49 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 3
%50 = getelementptr inbounds [6 x i8], [6 x i8]* %49, i64 0, i64 3
store i8 64, i8* %50
%51 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 2
%52 = getelementptr inbounds [6 x i8], [6 x i8]* %51, i64 0, i64 2
store i8 64, i8* %52
%53 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 3
%54 = getelementptr inbounds [6 x i8], [6 x i8]* %53, i64 0, i64 2
store i8 111, i8* %54
%55 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 2
%56 = getelementptr inbounds [6 x i8], [6 x i8]* %55, i64 0, i64 3
store i8 111, i8* %56
br label %57
57: ; preds = %164, %48
%58 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%59 = bitcast [6 x i8]* %58 to i8**
%60 = call i32 @display(i8** %59)
%61 = load i32, i32* %14
%62 = add nsw i32 %61, 1
store i32 %62, i32* %14
%63 = srem i32 %61, 2
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %132
65: ; preds = %57
%66 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%67 = bitcast [6 x i8]* %66 to i8**
%68 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 0
%69 = bitcast [6 x i32]* %68 to i32**
%70 = call i64 @valid_moves(i8** %67, i32** %69, i8 signext 79)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %119
72: ; preds = %65
br label %73
73: ; preds = %117, %72
%74 = load i32, i32* @stdin
%75 = call i32 @fflush(i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%77 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32* %12, i8* %11)
%78 = load i8, i8* %11
%79 = call signext i8 @tolower(i8 signext %78)
%80 = sext i8 %79 to i32
%81 = sub nsw i32 %80, 97
%82 = trunc i32 %81 to i8
store i8 %82, i8* %11
%83 = load i32, i32* %12
%84 = add nsw i32 %83, -1
store i32 %84, i32* %12
%85 = load i32, i32* %12
%86 = icmp sge i32 %85, 0
br i1 %86, label %87, label %115
87: ; preds = %73
%88 = load i8, i8* %11
%89 = sext i8 %88 to i32
%90 = icmp sge i32 %89, 0
br i1 %90, label %91, label %115
91: ; preds = %87
%92 = load i32, i32* %12
%93 = icmp slt i32 %92, 6
br i1 %93, label %94, label %115
94: ; preds = %91
%95 = load i8, i8* %11
%96 = sext i8 %95 to i32
%97 = icmp slt i32 %96, 6
br i1 %97, label %98, label %115
98: ; preds = %94
%99 = load i32, i32* %12
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %100
%102 = load i8, i8* %11
%103 = sext i8 %102 to i64
%104 = getelementptr inbounds [6 x i32], [6 x i32]* %101, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %115
107: ; preds = %98
%108 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%109 = bitcast [6 x i8]* %108 to i8**
%110 = load i32, i32* %12
%111 = load i8, i8* %11
%112 = call i32 @make_move(i8** %109, i32 %110, i8 signext %111, i8 signext 79)
%113 = load i32, i32* %7
%114 = add nsw i32 %113, 1
store i32 %114, i32* %7
br label %118
115: ; preds = %98, %94, %91, %87, %73
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
br label %117
117: ; preds = %115
br label %73
118: ; preds = %107
br label %131
119: ; preds = %65
%120 = load i32, i32* %8
%121 = add nsw i32 %120, 1
store i32 %121, i32* %8
%122 = icmp slt i32 %121, 2
br i1 %122, label %123, label %128
123: ; preds = %119
%124 = load i32, i32* @stdin
%125 = call i32 @fflush(i32 %124)
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%127 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
br label %130
128: ; preds = %119
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0))
br label %130
130: ; preds = %128, %123
br label %131
131: ; preds = %130, %118
br label %157
132: ; preds = %57
%133 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%134 = bitcast [6 x i8]* %133 to i8**
%135 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 0
%136 = bitcast [6 x i32]* %135 to i32**
%137 = call i64 @valid_moves(i8** %134, i32** %136, i8 signext 64)
%138 = icmp ne i64 %137, 0
br i1 %138, label %139, label %147
139: ; preds = %132
store i32 0, i32* %8
%140 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%141 = bitcast [6 x i8]* %140 to i8**
%142 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 0
%143 = bitcast [6 x i32]* %142 to i32**
%144 = call i32 @computer_move(i8** %141, i32** %143, i8 signext 64)
%145 = load i32, i32* %7
%146 = add nsw i32 %145, 1
store i32 %146, i32* %7
br label %156
147: ; preds = %132
%148 = load i32, i32* %8
%149 = add nsw i32 %148, 1
store i32 %149, i32* %8
%150 = icmp slt i32 %149, 2
br i1 %150, label %151, label %153
151: ; preds = %147
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %155
153: ; preds = %147
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0))
br label %155
155: ; preds = %153, %151
br label %156
156: ; preds = %155, %139
br label %157
157: ; preds = %156, %131
br label %158
158: ; preds = %157
%159 = load i32, i32* %7
%160 = icmp slt i32 %159, 36
br i1 %160, label %161, label %164
161: ; preds = %158
%162 = load i32, i32* %8
%163 = icmp slt i32 %162, 2
br label %164
164: ; preds = %161, %158
%165 = phi i1 [ false, %158 ], [ %163, %161 ]
br i1 %165, label %57, label %166
166: ; preds = %164
%167 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 0
%168 = bitcast [6 x i8]* %167 to i8**
%169 = call i32 @display(i8** %168)
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %4
br label %170
170: ; preds = %206, %166
%171 = load i32, i32* %4
%172 = icmp slt i32 %171, 6
br i1 %172, label %173, label %209
173: ; preds = %170
store i32 0, i32* %5
br label %174
174: ; preds = %202, %173
%175 = load i32, i32* %5
%176 = icmp slt i32 %175, 6
br i1 %176, label %177, label %205
177: ; preds = %174
%178 = load i32, i32* %4
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 %179
%181 = load i32, i32* %5
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [6 x i8], [6 x i8]* %180, i64 0, i64 %182
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %185, 64
%187 = zext i1 %186 to i32
%188 = load i32, i32* %9
%189 = add nsw i32 %188, %187
store i32 %189, i32* %9
%190 = load i32, i32* %4
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %2, i64 0, i64 %191
%193 = load i32, i32* %5
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [6 x i8], [6 x i8]* %192, i64 0, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 79
%199 = zext i1 %198 to i32
%200 = load i32, i32* %10
%201 = add nsw i32 %200, %199
store i32 %201, i32* %10
br label %202
202: ; preds = %177
%203 = load i32, i32* %5
%204 = add nsw i32 %203, 1
store i32 %204, i32* %5
br label %174
205: ; preds = %174
br label %206
206: ; preds = %205
%207 = load i32, i32* %4
%208 = add nsw i32 %207, 1
store i32 %208, i32* %4
br label %170
209: ; preds = %170
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
%211 = load i32, i32* %9
%212 = load i32, i32* %10
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %211, i32 %212)
%214 = load i32, i32* @stdin
%215 = call i32 @fflush(i32 %214)
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
%217 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
br label %218
218: ; preds = %209
%219 = load i8, i8* %13
%220 = call signext i8 @tolower(i8 signext %219)
%221 = sext i8 %220 to i32
%222 = icmp eq i32 %221, 121
br i1 %222, label %23, label %223
223: ; preds = %218
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%225 = load i32, i32* %1
ret i32 %225
}

LLVM IR (-O2):
@.str.5 = [3 x i8] c"%c\00"
@stdin = global i32 0
@.str.6 = [38 x i8] c"Please enter your move (row column): \00"
@.str.7 = [5 x i8] c"%d%c\00"
@.str.9 = [32 x i8] c"\0AYou have to pass, press return\00"
@.str.13 = [26 x i8] c"Computer %d\0A User %d\0A\0A\00"
@.str.14 = [34 x i8] c"Do you want to play again (y/n): \00"
@str = [10 x i8] c"\0AREVERSI\0A\00"
@str.16 = [61 x i8] c"You can go first on the first game, then we will take turns.\00"
@str.17 = [55 x i8] c" You will be white - (O)\0A I will be black - (@).\00"
@str.18 = [113 x i8] c"Select a square for your move by typing a digit for the row\0A and a letter for the column with no spaces between.\00"
@str.19 = [35 x i8] c"\0AGood luck! Press Enter to start.\00"
@str.21 = [20 x i8] c"The final score is:\00"
@str.22 = [9 x i8] c"\0AGoodbye\00"
@str.23 = [25 x i8] c"\0AI have to pass, your go\00"
@str.24 = [44 x i8] c"\0ANeither of us can go, so the game is over.\00"
@str.25 = [29 x i8] c"Not a valid move, try again.\00"
define i32 @main() {
%1 = alloca [6 x [6 x i8]]
%2 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 0, i64 0
%3 = alloca [6 x [6 x i32]]
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8
%7 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 0, i64 0
%8 = bitcast [6 x [6 x i32]]* %3 to i8*
store i8 0, i8* %4
%9 = bitcast i32* %5 to i8*
store i32 0, i32* %5
store i8 0, i8* %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.16, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.17, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @str.18, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.19, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%16 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 3, i64 3
%17 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 2, i64 2
%18 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 3, i64 2
%19 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 2, i64 3
%20 = bitcast [6 x [6 x i8]]* %1 to i8**
%21 = bitcast [6 x [6 x i32]]* %3 to i32**
br label %22
22: ; preds = %133, %0
%23 = phi i32 [ 0, %0 ], [ %25, %133 ]
%24 = phi i32 [ 0, %0 ], [ %96, %133 ]
%25 = add nuw nsw i32 %23, 1
%26 = and i32 %25, 1
store i8 64, i8* %16
store i8 64, i8* %17
store i8 111, i8* %18
store i8 111, i8* %19
br label %27
27: ; preds = %85, %22
%28 = phi i32 [ 4, %22 ], [ %86, %85 ]
%29 = phi i32 [ %24, %22 ], [ %87, %85 ]
%30 = phi i32 [ %26, %22 ], [ %32, %85 ]
%31 = call i32 @display(i8** %20)
%32 = add nuw nsw i32 %30, 1
%33 = and i32 %30, 1
%34 = icmp eq i32 %33, 0
br i1 %34, label %74, label %35
35: ; preds = %27
%36 = call i64 @valid_moves(i8** %20, i32** %21, i8 signext 79)
%37 = icmp eq i64 %36, 0
br i1 %37, label %66, label %38
38: ; preds = %35, %64
%39 = load i32, i32* @stdin
%40 = call i32 @fflush(i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32* %5, i8* %4)
%43 = load i8, i8* %4
%44 = call signext i8 @tolower(i8 signext %43)
%45 = add i8 %44, -97
store i8 %45, i8* %4
%46 = load i32, i32* %5
%47 = add nsw i32 %46, -1
store i32 %47, i32* %5
%48 = icmp sgt i32 %46, 0
%49 = icmp sgt i8 %45, -1
%50 = select i1 %48, i1 %49, i1 false
%51 = icmp slt i32 %46, 7
%52 = and i1 %51, %50
%53 = icmp slt i8 %45, 6
%54 = select i1 %52, i1 %53, i1 false
br i1 %54, label %55, label %64
55: ; preds = %38
%56 = zext i32 %47 to i64
%57 = zext i8 %45 to i64
%58 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %56, i64 %57
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %55
%62 = call i32 @make_move(i8** %20, i32 %47, i8 signext %45, i8 signext 79)
%63 = add nsw i32 %28, 1
br label %85
64: ; preds = %55, %38
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.25, i64 0, i64 0))
br label %38
66: ; preds = %35
%67 = add nsw i32 %29, 1
%68 = icmp slt i32 %29, 1
br i1 %68, label %69, label %91
69: ; preds = %66
%70 = load i32, i32* @stdin
%71 = call i32 @fflush(i32 %70)
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%73 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
br label %85
74: ; preds = %27
%75 = call i64 @valid_moves(i8** %20, i32** %21, i8 signext 64)
%76 = icmp eq i64 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = call i32 @computer_move(i8** %20, i32** %21, i8 signext 64)
%79 = add nsw i32 %28, 1
br label %85
80: ; preds = %74
%81 = add nsw i32 %29, 1
%82 = icmp slt i32 %29, 1
br i1 %82, label %83, label %91
83: ; preds = %80
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.23, i64 0, i64 0))
br label %85
85: ; preds = %69, %61, %83, %77
%86 = phi i32 [ %63, %61 ], [ %28, %69 ], [ %79, %77 ], [ %28, %83 ]
%87 = phi i32 [ %29, %61 ], [ %67, %69 ], [ 0, %77 ], [ %81, %83 ]
%88 = icmp slt i32 %86, 36
%89 = icmp slt i32 %87, 2
%90 = select i1 %88, i1 %89, i1 false
br i1 %90, label %27, label %95
91: ; preds = %80, %66
%92 = phi i8* [ getelementptr inbounds ([44 x i8], [44 x i8]* @str.24, i64 0, i64 0), %66 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @str.24, i64 0, i64 0), %80 ]
%93 = phi i32 [ %67, %66 ], [ %81, %80 ]
%94 = call i32 @puts(i8* dereferenceable(1) %92)
br label %95
95: ; preds = %85, %91
%96 = phi i32 [ %93, %91 ], [ %87, %85 ]
%97 = call i32 @display(i8** %20)
br label %98
98: ; preds = %95, %98
%99 = phi i64 [ 0, %95 ], [ %131, %98 ]
%100 = phi i32 [ 0, %95 ], [ %130, %98 ]
%101 = phi i32 [ 0, %95 ], [ %122, %98 ]
%102 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 %99, i64 0
%103 = bitcast i8* %102 to <4 x i8>*
%104 = load <4 x i8>, <4 x i8>* %103
%105 = icmp eq <4 x i8> %104, <i8 64, i8 64, i8 64, i8 64>
%106 = icmp eq <4 x i8> %104, <i8 79, i8 79, i8 79, i8 79>
%107 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 %99, i64 4
%108 = load i8, i8* %107
%109 = icmp eq i8 %108, 64
%110 = zext i1 %109 to i32
%111 = icmp eq i8 %108, 79
%112 = zext i1 %111 to i32
%113 = getelementptr inbounds [6 x [6 x i8]], [6 x [6 x i8]]* %1, i64 0, i64 %99, i64 5
%114 = load i8, i8* %113
%115 = icmp eq i8 %114, 64
%116 = zext i1 %115 to i32
%117 = bitcast <4 x i1> %105 to i4
%118 = call i4 @llvm.ctpop.i4(i4 %117)
%119 = zext i4 %118 to i32
%120 = add nuw nsw i32 %119, %110
%121 = add nuw nsw i32 %120, %116
%122 = add nuw nsw i32 %121, %101
%123 = icmp eq i8 %114, 79
%124 = zext i1 %123 to i32
%125 = bitcast <4 x i1> %106 to i4
%126 = call i4 @llvm.ctpop.i4(i4 %125)
%127 = zext i4 %126 to i32
%128 = add nuw nsw i32 %127, %112
%129 = add nuw nsw i32 %128, %124
%130 = add nuw nsw i32 %129, %100
%131 = add nuw nsw i64 %99, 1
%132 = icmp eq i64 %131, 6
br i1 %132, label %133, label %98
133: ; preds = %98
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.21, i64 0, i64 0))
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %122, i32 %130)
%136 = load i32, i32* @stdin
%137 = call i32 @fflush(i32 %136)
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
%139 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%140 = load i8, i8* %6
%141 = call signext i8 @tolower(i8 signext %140)
%142 = icmp eq i8 %141, 121
br i1 %142, label %22, label %143
143: ; preds = %133
%144 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.22, i64 0, i64 0))
ret i32 0
}