#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*/ printf(char *, ...);
void imprimeTabuleiro(int tab[3][3]) {
  int i, j;
  printf("\n\n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (tab[i][j] == 1) {
        printf("X");
      } else if (tab[i][j] == -1) {
        printf("O");
      } else {
        printf(" ");
      }
      if (j == 0 || j == 1) {
        printf("%lc", L'\u2502');
      } else if (j == 2) {
        printf("\n");
      }
    }
    if (i == 0 || i == 1)
      printf("%lc%lc%lc%lc%lc\n", L'\u2500', L'\u253c', L'\u2500', L'\u253c',
             L'\u2500');
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<imprimeTabuleiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1265 <imprimeTabuleiro+0x155>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    121b <imprimeTabuleiro+0x10b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    117c <imprimeTabuleiro+0x6c>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bf <imprimeTabuleiro+0xaf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    11ac <imprimeTabuleiro+0x9c>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ba <imprimeTabuleiro+0xaa>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bf <imprimeTabuleiro+0xaf>
cmpl   $0x0,-0x10(%rbp)
je     11d3 <imprimeTabuleiro+0xc3>
cmpl   $0x1,-0x10(%rbp)
jne    11eb <imprimeTabuleiro+0xdb>
lea    0xe2f(%rip),%rdi
mov    $0x2502,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <imprimeTabuleiro+0xf8>
cmpl   $0x2,-0x10(%rbp)
jne    1203 <imprimeTabuleiro+0xf3>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <imprimeTabuleiro+0xf8>
jmp    120d <imprimeTabuleiro+0xfd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <imprimeTabuleiro+0x32>
cmpl   $0x0,-0xc(%rbp)
je     122f <imprimeTabuleiro+0x11f>
cmpl   $0x1,-0xc(%rbp)
jne    1252 <imprimeTabuleiro+0x142>
lea    0xdd7(%rip),%rdi
mov    $0x2500,%r9d
mov    $0x253c,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1257 <imprimeTabuleiro+0x147>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <imprimeTabuleiro+0x21>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeTabuleiro>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x4f,%r13d
mov    $0x20,%ebp
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
mov    $0x58,%r14d
cmove  %r14d,%edi
call   1030 <putchar@plt>
lea    0xe84(%rip),%r15
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe23(%rip),%r12
mov    %r12,%rdi
mov    $0x2500,%esi
mov    $0x253c,%edx
mov    $0x2500,%ecx
mov    $0x253c,%r8d
mov    $0x2500,%r9d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x2500,%esi
mov    $0x253c,%edx
mov    $0x2500,%ecx
mov    $0x253c,%r8d
mov    $0x2500,%r9d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rbx),%eax
cmp    $0xffffffff,%eax
mov    $0x20,%edi
cmove  %r13d,%edi
cmp    $0x1,%eax
cmove  %r14d,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x2502,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbx),%eax
cmp    $0xffffffff,%eax
cmove  %r13d,%ebp
cmp    $0x1,%eax
cmove  %r14d,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcf2(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [2 x i8] c"X\00"
@.str.2 = [2 x i8] c"O\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [4 x i8] c"%lc\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [17 x i8] c"%lc%lc%lc%lc%lc\0A\00"
define void @imprimeTabuleiro([3 x i32]* %0) {
%2 = alloca [3 x i32]*
%3 = alloca i32
%4 = alloca i32
store [3 x i32]* %0, [3 x i32]** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %67, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %70
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %55, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %58
13: ; preds = %10
%14 = load [3 x i32]*, [3 x i32]** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %17, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %13
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %40
25: ; preds = %13
%26 = load [3 x i32]*, [3 x i32]** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 %28
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %37
35: ; preds = %25
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %39
37: ; preds = %25
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39, %23
%41 = load i32, i32* %4
%42 = icmp eq i32 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %4
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %48
46: ; preds = %43, %40
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
br label %54
48: ; preds = %43
%49 = load i32, i32* %4
%50 = icmp eq i32 %49, 2
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
br label %54
54: ; preds = %53, %46
br label %55
55: ; preds = %54
%56 = load i32, i32* %4
%57 = add nsw i32 %56, 1
store i32 %57, i32* %4
br label %10
58: ; preds = %10
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %3
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %66
64: ; preds = %61, %58
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 9472, i32 9532, i32 9472, i32 9532, i32 9472)
br label %66
66: ; preds = %64, %61
br label %67
67: ; preds = %66
%68 = load i32, i32* %3
%69 = add nsw i32 %68, 1
store i32 %69, i32* %3
br label %6
70: ; preds = %6
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.4 = [4 x i8] c"%lc\00"
@.str.6 = [17 x i8] c"%lc%lc%lc%lc%lc\0A\00"
@str.7 = [2 x i8] c"\0A\00"
define void @imprimeTabuleiro([3 x i32]* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 79, i32 32
%7 = icmp eq i32 %4, 1
%8 = select i1 %7, i32 88, i32 %6
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 1
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
%14 = select i1 %13, i32 79, i32 32
%15 = icmp eq i32 %12, 1
%16 = select i1 %15, i32 88, i32 %14
%17 = tail call i32 @putchar(i32 %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 2
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, -1
%22 = select i1 %21, i32 79, i32 32
%23 = icmp eq i32 %20, 1
%24 = select i1 %23, i32 88, i32 %22
%25 = tail call i32 @putchar(i32 %24)
%26 = tail call i32 @putchar(i32 10)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 9472, i32 9532, i32 9472, i32 9532, i32 9472)
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 0
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, -1
%31 = select i1 %30, i32 79, i32 32
%32 = icmp eq i32 %29, 1
%33 = select i1 %32, i32 88, i32 %31
%34 = tail call i32 @putchar(i32 %33)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, -1
%39 = select i1 %38, i32 79, i32 32
%40 = icmp eq i32 %37, 1
%41 = select i1 %40, i32 88, i32 %39
%42 = tail call i32 @putchar(i32 %41)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 2
%45 = load i32, i32* %44
%46 = icmp eq i32 %45, -1
%47 = select i1 %46, i32 79, i32 32
%48 = icmp eq i32 %45, 1
%49 = select i1 %48, i32 88, i32 %47
%50 = tail call i32 @putchar(i32 %49)
%51 = tail call i32 @putchar(i32 10)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 9472, i32 9532, i32 9472, i32 9532, i32 9472)
%53 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 0
%54 = load i32, i32* %53
%55 = icmp eq i32 %54, -1
%56 = select i1 %55, i32 79, i32 32
%57 = icmp eq i32 %54, 1
%58 = select i1 %57, i32 88, i32 %56
%59 = tail call i32 @putchar(i32 %58)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%61 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 1
%62 = load i32, i32* %61
%63 = icmp eq i32 %62, -1
%64 = select i1 %63, i32 79, i32 32
%65 = icmp eq i32 %62, 1
%66 = select i1 %65, i32 88, i32 %64
%67 = tail call i32 @putchar(i32 %66)
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 9474)
%69 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 2
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, -1
%72 = select i1 %71, i32 79, i32 32
%73 = icmp eq i32 %70, 1
%74 = select i1 %73, i32 88, i32 %72
%75 = tail call i32 @putchar(i32 %74)
%76 = tail call i32 @putchar(i32 10)
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
ret void
}