#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 mostraTabuleiro(int tabuleiro[][5]) {
  int linha, coluna;
  printf("\t1 \t2 \t3 \t4 \t5");
  printf("\n");
  for (linha = 0; linha < 5; linha++) {
    printf("%d", linha + 1);
    for (coluna = 0; coluna < 5; coluna++) {
      if (tabuleiro[linha][coluna] == -1) {
        printf("\t~");
      } else if (tabuleiro[linha][coluna] == 0) {
        printf("\t*");
      } else if (tabuleiro[linha][coluna] == 1) {
        printf("\tX");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<mostraTabuleiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1232 <mostraTabuleiro+0x122>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1216 <mostraTabuleiro+0x106>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    119e <mostraTabuleiro+0x8e>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1203 <mostraTabuleiro+0xf3>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11ce <mostraTabuleiro+0xbe>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fe <mostraTabuleiro+0xee>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11f9 <mostraTabuleiro+0xe9>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fe <mostraTabuleiro+0xee>
jmp    1203 <mostraTabuleiro+0xf3>
jmp    1208 <mostraTabuleiro+0xf8>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <mostraTabuleiro+0x54>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <mostraTabuleiro+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostraTabuleiro>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x10,%ebx
mov    $0x1,%ebp
lea    0xebb(%rip),%r14
lea    0x2cad(%rip),%r12
jmp    117b <mostraTabuleiro+0x5b>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x14,%rbx
add    $0x1,%ebp
cmp    $0x74,%rbx
je     1211 <mostraTabuleiro+0xf1>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%r15,%rbx,1),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     11a1 <mostraTabuleiro+0x81>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%r15,%rbx,1),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     11bb <mostraTabuleiro+0x9b>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%r15,%rbx,1),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     11d5 <mostraTabuleiro+0xb5>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%r15,%rbx,1),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     11ef <mostraTabuleiro+0xcf>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,1),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     1160 <mostraTabuleiro+0x40>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <mostraTabuleiro+0x40>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"\091 \092 \093 \094 \095\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"\09~\00"
@.str.4 = [3 x i8] c"\09*\00"
@.str.5 = [3 x i8] c"\09X\00"
@switch.table.mostraTabuleiro.9 = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)]
define void @mostraTabuleiro([5 x i32]* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
br label %4
4: ; preds = %1, %58
%5 = phi i64 [ 0, %1 ], [ %6, %58 ]
%6 = add nuw nsw i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 0
%10 = load i32, i32* %9
%11 = add i32 %10, 1
%12 = icmp ult i32 %11, 3
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = sext i32 %11 to i64
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.mostraTabuleiro.9, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %16)
br label %18
18: ; preds = %4, %13
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 1
%20 = load i32, i32* %19
%21 = add i32 %20, 1
%22 = icmp ult i32 %21, 3
br i1 %22, label %23, label %28
23: ; preds = %18
%24 = sext i32 %21 to i64
%25 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.mostraTabuleiro.9, i64 0, i64 %24
%26 = load i8*, i8** %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %26)
br label %28
28: ; preds = %18, %23
%29 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 2
%30 = load i32, i32* %29
%31 = add i32 %30, 1
%32 = icmp ult i32 %31, 3
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = sext i32 %31 to i64
%35 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.mostraTabuleiro.9, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %36)
br label %38
38: ; preds = %28, %33
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 3
%40 = load i32, i32* %39
%41 = add i32 %40, 1
%42 = icmp ult i32 %41, 3
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = sext i32 %41 to i64
%45 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.mostraTabuleiro.9, i64 0, i64 %44
%46 = load i8*, i8** %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %46)
br label %48
48: ; preds = %38, %43
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 4
%50 = load i32, i32* %49
%51 = add i32 %50, 1
%52 = icmp ult i32 %51, 3
br i1 %52, label %53, label %58
53: ; preds = %48
%54 = sext i32 %51 to i64
%55 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.mostraTabuleiro.9, i64 0, i64 %54
%56 = load i8*, i8** %55
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %56)
br label %58
58: ; preds = %48, %53
%59 = tail call i32 @putchar(i32 10)
%60 = icmp eq i64 %6, 5
br i1 %60, label %61, label %4
61: ; preds = %58
ret void
}