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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ ckgame(char, char);
int /*<<< orphan*/ domove(char, char);
int /*<<< orphan*/ human(char, char);
int /*<<< orphan*/ printboard();
int main() {
  printboard();
  while (ckgame('X', 'O') == 0) {
    human('X', 'O');
    printboard();
    if (ckgame('X', 'O') != 0)
      return (0);
    domove('O', 'X');
    printboard();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <printboard@plt>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1060 <ckgame@plt>
cmp    $0x0,%rax
jne    11c5 <main+0x85>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1030 <human@plt>
mov    $0x0,%al
call   1050 <printboard@plt>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1060 <ckgame@plt>
cmp    $0x0,%rax
je     11aa <main+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    11c5 <main+0x85>
mov    $0x4f,%edi
mov    $0x58,%esi
call   1040 <domove@plt>
mov    $0x0,%al
call   1050 <printboard@plt>
jmp    1156 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printboard@plt>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1060 <ckgame@plt>
test   %rax,%rax
jne    11a6 <main+0x66>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1030 <human@plt>
xor    %eax,%eax
call   1050 <printboard@plt>
mov    $0x58,%edi
mov    $0x4f,%esi
call   1060 <ckgame@plt>
test   %rax,%rax
jne    11a6 <main+0x66>
mov    $0x4f,%edi
mov    $0x58,%esi
call   1040 <domove@plt>
jmp    1150 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @printboard()
br label %3
3: ; preds = %12, %0
%4 = call i64 @ckgame(i8 signext 88, i8 signext 79)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i32 @human(i8 signext 88, i8 signext 79)
%8 = call i32 (...) @printboard()
%9 = call i64 @ckgame(i8 signext 88, i8 signext 79)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 0, i32* %1
br label %15
12: ; preds = %6
%13 = call i32 @domove(i8 signext 79, i8 signext 88)
%14 = call i32 (...) @printboard()
br label %3
15: ; preds = %11, %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printboard()
%2 = tail call i64 @ckgame(i8 signext 88, i8 signext 79)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %0, %9
%5 = tail call i32 @human(i8 signext 88, i8 signext 79)
%6 = tail call i32 (...) @printboard()
%7 = tail call i64 @ckgame(i8 signext 88, i8 signext 79)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = tail call i32 @domove(i8 signext 79, i8 signext 88)
%11 = tail call i32 (...) @printboard()
%12 = tail call i64 @ckgame(i8 signext 88, i8 signext 79)
%13 = icmp eq i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %9, %4, %0
ret i32 0
}