#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*/ GerarBarco(int **);
int /*<<< orphan*/ Tela(int **, int **);
int /*<<< orphan*/ ZerarMatriz(int **, int **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int P1[6][8], P2[6][8], P1Tela[6][8], P2Tela[6][8];
  int i, j;
  srand(time(NULL));
  ZerarMatriz(P1, P2);
  ZerarMatriz(P1Tela, P2Tela);
  GerarBarco(P1);
  GerarBarco(P2);
  Tela(P1Tela, P2Tela);
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 8; j++) {
      printf("%d ", P1[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 8; j++) {
      printf("%d ", P2[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1050 <ZerarMatriz@plt>
lea    -0x250(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1050 <ZerarMatriz@plt>
lea    -0xd0(%rbp),%rdi
call   1080 <GerarBarco@plt>
lea    -0x190(%rbp),%rdi
call   1080 <GerarBarco@plt>
lea    -0x250(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1070 <Tela@plt>
movl   $0x0,-0x314(%rbp)
cmpl   $0x6,-0x314(%rbp)
jge    1264 <main+0x104>
movl   $0x0,-0x318(%rbp)
cmpl   $0x8,-0x318(%rbp)
jge    1242 <main+0xe2>
movslq -0x314(%rbp),%rcx
lea    -0xd0(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x318(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x318(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x318(%rbp)
jmp    11f4 <main+0x94>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x314(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x314(%rbp)
jmp    11dd <main+0x7d>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x314(%rbp)
cmpl   $0x6,-0x314(%rbp)
jge    1303 <main+0x1a3>
movl   $0x0,-0x318(%rbp)
cmpl   $0x8,-0x318(%rbp)
jge    12e1 <main+0x181>
movslq -0x314(%rbp),%rcx
lea    -0x190(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x318(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x318(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x318(%rbp)
jmp    1293 <main+0x133>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x314(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x314(%rbp)
jmp    127c <main+0x11c>
xor    %eax,%eax
add    $0x320,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x308,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xc0(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <ZerarMatriz@plt>
lea    0x240(%rsp),%r15
lea    0x180(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <ZerarMatriz@plt>
mov    %rbx,%rdi
call   1090 <GerarBarco@plt>
mov    %r14,%rdi
call   1090 <GerarBarco@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <Tela@plt>
mov    $0x1c,%ebx
lea    0xe1c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xa4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xa8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xac(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xb0(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xb4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xb8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xbc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc0(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rbx
cmp    $0xdc,%rbx
jne    11f0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1c,%ebx
lea    0xd57(%rip),%r14
nopl   0x0(%rax)
mov    -0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rbx
cmp    $0xdc,%rbx
jne    12b0 <main+0x140>
xor    %eax,%eax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [6 x [8 x i32]]
%2 = alloca [6 x [8 x i32]]
%3 = alloca [6 x [8 x i32]]
%4 = alloca [6 x [8 x i32]]
%5 = bitcast [6 x [8 x i32]]* %1 to i8*
%6 = bitcast [6 x [8 x i32]]* %2 to i8*
%7 = bitcast [6 x [8 x i32]]* %3 to i8*
%8 = bitcast [6 x [8 x i32]]* %4 to i8*
%9 = tail call i32 @time(i32* null)
%10 = tail call i32 @srand(i32 %9)
%11 = bitcast [6 x [8 x i32]]* %1 to i32**
%12 = bitcast [6 x [8 x i32]]* %2 to i32**
%13 = call i32 @ZerarMatriz(i32** %11, i32** %12)
%14 = bitcast [6 x [8 x i32]]* %3 to i32**
%15 = bitcast [6 x [8 x i32]]* %4 to i32**
%16 = call i32 @ZerarMatriz(i32** %14, i32** %15)
%17 = call i32 @GerarBarco(i32** %11)
%18 = call i32 @GerarBarco(i32** %12)
%19 = call i32 @Tela(i32** %14, i32** %15)
br label %20
20: ; preds = %0, %20
%21 = phi i64 [ 0, %0 ], [ %47, %20 ]
%22 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 0
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 1
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 2
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 3
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 4
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 5
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 6
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %1, i64 0, i64 %21, i64 7
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = call i32 @putchar(i32 10)
%47 = add nuw nsw i64 %21, 1
%48 = icmp eq i64 %47, 6
br i1 %48, label %49, label %20
49: ; preds = %20
%50 = call i32 @putchar(i32 10)
br label %51
51: ; preds = %49, %51
%52 = phi i64 [ 0, %49 ], [ %78, %51 ]
%53 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 0
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 1
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 2
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %60)
%62 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 3
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 4
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 5
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %69)
%71 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 6
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds [6 x [8 x i32]], [6 x [8 x i32]]* %2, i64 0, i64 %52, i64 7
%75 = load i32, i32* %74
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %75)
%77 = call i32 @putchar(i32 10)
%78 = add nuw nsw i64 %52, 1
%79 = icmp eq i64 %78, 6
br i1 %79, label %80, label %51
80: ; preds = %51
ret i32 0
}