#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*/ mostrar(char **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int r, l, c;
  char mesa[3][3] = {{'.', '.', '.'}, {'.', '.', '.'}, {'.', '.', '.'}};
  mostrar(mesa, 3);
  for (r = 1; r <= 9; r++) {
    printf("Informe sua jogada(l  c):");
    scanf("%d %d", &l, &c);
    l--;
    c--;
    if (r % 2 == 1)
      mesa[l][c] = 'X';
    else
      mesa[l][c] = 'O';
    mostrar(mesa, 3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
mov    $0x3,%esi
call   1050 <mostrar@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     1207 <main+0xd7>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11d4 <main+0xa4>
movslq -0xc(%rbp),%rcx
lea    -0x19(%rbp),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
jmp    11eb <main+0xbb>
movslq -0xc(%rbp),%rcx
lea    -0x19(%rbp),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
lea    -0x19(%rbp),%rdi
mov    $0x3,%esi
call   1050 <mostrar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1168 <main+0x38>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0x2e2e2e2e2e2e2e2e,%rax
2e 2e 2e
mov    %rax,0x8(%rsp)
movb   $0x2e,0x10(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x3,%esi
call   1050 <mostrar@plt>
mov    $0x1,%ebp
lea    0xe90(%rip),%r15
lea    0xea3(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbx
nop
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
add    $0xffffffffffffffff,%rax
mov    %eax,0x4(%rsp)
movslq (%rsp),%rcx
lea    -0x1(%rcx),%rdx
mov    %edx,(%rsp)
xor    %edx,%edx
test   $0x1,%bpl
lea    (%rax,%rax,2),%rax
lea    0x8(%rsp,%rax,1),%rax
setne  %dl
lea    (%rdx,%rdx,8),%edx
add    $0x4f,%edx
mov    %dl,-0x1(%rcx,%rax,1)
mov    %r14,%rdi
mov    $0x3,%esi
call   1050 <mostrar@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.mesa = [3 x [3 x i8]] [[3 x i8] c"...", [3 x i8] c"...", [3 x i8] c"..."]
@.str = [26 x i8] c"Informe sua jogada(l c):\00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x [3 x i8]]
store i32 0, i32* %1
%6 = bitcast [3 x [3 x i8]]* %5 to i8*
%7 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %5, i64 0, i64 0
%8 = bitcast [3 x i8]* %7 to i8**
%9 = call i32 @mostrar(i8** %8, i32 3)
store i32 1, i32* %2
br label %10
10: ; preds = %41, %0
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 9
br i1 %12, label %13, label %44
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
%20 = load i32, i32* %2
%21 = srem i32 %20, 2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %30
23: ; preds = %13
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %5, i64 0, i64 %25
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x i8], [3 x i8]* %26, i64 0, i64 %28
store i8 88, i8* %29
br label %37
30: ; preds = %13
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %5, i64 0, i64 %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [3 x i8], [3 x i8]* %33, i64 0, i64 %35
store i8 79, i8* %36
br label %37
37: ; preds = %30, %23
%38 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %5, i64 0, i64 0
%39 = bitcast [3 x i8]* %38 to i8**
%40 = call i32 @mostrar(i8** %39, i32 3)
br label %41
41: ; preds = %37
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %10
44: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Informe sua jogada(l c):\00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x [3 x i8]]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 0
%7 = bitcast [3 x [3 x i8]]* %3 to i8**
%8 = call i32 @mostrar(i8** %7, i32 3)
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ 1, %0 ], [ %24, %9 ]
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, -1
store i32 %14, i32* %1
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
%17 = and i32 %10, 1
%18 = icmp eq i32 %17, 0
%19 = sext i32 %14 to i64
%20 = sext i32 %16 to i64
%21 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 %19, i64 %20
%22 = select i1 %18, i8 79, i8 88
store i8 %22, i8* %21
%23 = call i32 @mostrar(i8** %7, i32 3)
%24 = add nuw nsw i32 %10, 1
%25 = icmp eq i32 %24, 10
br i1 %25, label %26, label %9
26: ; preds = %9
ret i32 0
}