#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][7], P2[6][7], P1Tela[6][7], P2Tela[6][7];
  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 < 7; j++) {
      printf("%d ", P1[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 7; j++) {
      printf("%d ", P2[i][j]);
    }
    printf("\n");
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2b8,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xb0(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <ZerarMatriz@plt>
lea    0x210(%rsp),%r15
lea    0x160(%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    $0x18,%ebx
lea    0xe1c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x98(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x9c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xa0(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
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    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1c,%rbx
cmp    $0xc0,%rbx
jne    11f0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x18,%ebx
lea    0xd68(%rip),%r14
nopl   0x0(%rax,%rax,1)
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    $0x1c,%rbx
cmp    $0xc0,%rbx
jne    12a0 <main+0x130>
xor    %eax,%eax
add    $0x2b8,%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 [7 x i32]]
%3 = alloca [6 x [7 x i32]]
%4 = alloca [6 x [7 x i32]]
%5 = alloca [6 x [7 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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%11 = bitcast [7 x i32]* %10 to i32**
%12 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %3, i64 0, i64 0
%13 = bitcast [7 x i32]* %12 to i32**
%14 = call i32 @ZerarMatriz(i32** %11, i32** %13)
%15 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %4, i64 0, i64 0
%16 = bitcast [7 x i32]* %15 to i32**
%17 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %5, i64 0, i64 0
%18 = bitcast [7 x i32]* %17 to i32**
%19 = call i32 @ZerarMatriz(i32** %16, i32** %18)
%20 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 0
%21 = bitcast [7 x i32]* %20 to i32**
%22 = call i32 @GerarBarco(i32** %21)
%23 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %3, i64 0, i64 0
%24 = bitcast [7 x i32]* %23 to i32**
%25 = call i32 @GerarBarco(i32** %24)
%26 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %4, i64 0, i64 0
%27 = bitcast [7 x i32]* %26 to i32**
%28 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %5, i64 0, i64 0
%29 = bitcast [7 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, 7
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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %40
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [7 x i32], [7 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, 7
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 [7 x i32]], [6 x [7 x i32]]* %3, i64 0, i64 %66
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [7 x i32], [7 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 [7 x i32]]
%2 = alloca [6 x [7 x i32]]
%3 = alloca [6 x [7 x i32]]
%4 = alloca [6 x [7 x i32]]
%5 = bitcast [6 x [7 x i32]]* %1 to i8*
%6 = bitcast [6 x [7 x i32]]* %2 to i8*
%7 = bitcast [6 x [7 x i32]]* %3 to i8*
%8 = bitcast [6 x [7 x i32]]* %4 to i8*
%9 = tail call i32 @time(i32* null)
%10 = tail call i32 @srand(i32 %9)
%11 = bitcast [6 x [7 x i32]]* %1 to i32**
%12 = bitcast [6 x [7 x i32]]* %2 to i32**
%13 = call i32 @ZerarMatriz(i32** %11, i32** %12)
%14 = bitcast [6 x [7 x i32]]* %3 to i32**
%15 = bitcast [6 x [7 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 ], [ %44, %20 ]
%22 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 [7 x i32]], [6 x [7 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 = call i32 @putchar(i32 10)
%44 = add nuw nsw i64 %21, 1
%45 = icmp eq i64 %44, 6
br i1 %45, label %46, label %20
46: ; preds = %20
%47 = call i32 @putchar(i32 10)
br label %48
48: ; preds = %46, %48
%49 = phi i64 [ 0, %46 ], [ %72, %48 ]
%50 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 0
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [6 x [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 1
%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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 2
%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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 3
%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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 4
%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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 5
%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 [7 x i32]], [6 x [7 x i32]]* %2, i64 0, i64 %49, i64 6
%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 = call i32 @putchar(i32 10)
%72 = add nuw nsw i64 %49, 1
%73 = icmp eq i64 %72, 6
br i1 %73, label %74, label %48
74: ; preds = %48
ret i32 0
}