#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*/ display(char **);
char getchar();
int main(void) {
  while (1) {
    for (int count = 0; count < 3; count++) {
      char play[3][3] = {{' ', ' ', ' '}, {' ', ' ', ' '}, {' ', ' ', ' '}};
      for (int count1 = 0; count1 < 3; count1++) {
        display(play);
        play[count][count1] = getchar();
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ae <main+0x8e>
mov    0xeb9(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xeb7(%rip),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    119b <main+0x7b>
lea    -0x11(%rbp),%rdi
call   1030 <display@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%dl
movslq -0x8(%rbp),%rcx
lea    -0x11(%rbp),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115b <main+0x3b>
jmp    11a0 <main+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x2020202020202020,%r14
20 20 20
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,0x8(%rsp)
movb   $0x20,0x10(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x9(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,0x8(%rsp)
movb   $0x20,0x10(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0xb(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,0x8(%rsp)
movb   $0x20,0x10(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0xe(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0xf(%rsp)
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@__const.main.play = [3 x [3 x i8]] [[3 x i8] c" ", [3 x i8] c" ", [3 x i8] c" "]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x [3 x i8]]
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %0, %32
store i32 0, i32* %2
br label %6
6: ; preds = %29, %5
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %32
9: ; preds = %6
%10 = bitcast [3 x [3 x i8]]* %3 to i8*
store i32 0, i32* %4
br label %11
11: ; preds = %25, %9
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0
%16 = bitcast [3 x i8]* %15 to i8**
%17 = call i32 @display(i8** %16)
%18 = call signext i8 (...) @getchar()
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 %20
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %21, i64 0, i64 %23
store i8 %18, i8* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %11
28: ; preds = %11
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %6
32: ; preds = %6
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x i8]]
%2 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [3 x [3 x i8]]* %1 to i8**
%4 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0, i64 1
%5 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 1, i64 0
%6 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 1, i64 1
%7 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 2, i64 0
%8 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 2, i64 1
br label %9
9: ; preds = %9, %0
%10 = call i32 @display(i8** %3)
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %2
%12 = call i32 @display(i8** %3)
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %4
%14 = call i32 @display(i8** %3)
%15 = call signext i8 (...) @getchar()
%16 = call i32 @display(i8** %3)
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %5
%18 = call i32 @display(i8** %3)
%19 = call signext i8 (...) @getchar()
store i8 %19, i8* %6
%20 = call i32 @display(i8** %3)
%21 = call signext i8 (...) @getchar()
%22 = call i32 @display(i8** %3)
%23 = call signext i8 (...) @getchar()
store i8 %23, i8* %7
%24 = call i32 @display(i8** %3)
%25 = call signext i8 (...) @getchar()
store i8 %25, i8* %8
%26 = call i32 @display(i8** %3)
%27 = call signext i8 (...) @getchar()
br label %9
}