#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int matriz[5][5], i, j, ponto, respi, respj;
  char nome[20], continuar;
  printf("Digite o seu nome:\n");
  scanf(" %s", nome);
  printf("\n%s, preencha a matriz com 1 - para o navio e 0 - para agua:", nome);
  for (i = 1; i < 6; i++) {
    for (j = 1; j < 6; j++) {
      printf("\n\n %s, digite a Linha %d, coluna %d:\n", nome, i, j);
      scanf("%d", &matriz[i][j]);
    }
  }
  do {
    printf("\n%s, entre com as coordenadas:", nome);
    printf("\nLinha: \n");
    scanf("%d", &respi);
    while (respi > 5 || respi < 1) {
      printf("\n %s, entre com as coordenadas da Linha de 1 até 5:\n", nome);
      scanf("%d", &respi);
    }
    printf("\nColuna: \n");
    scanf("%d", &respj);
    while (respj > 5 || respj < 1) {
      printf("\n %s, entre com as coordenadas da Coluna de 1 até 5:\n", nome);
      scanf("%d", &respj);
    }
    if (matriz[respi][respj] == 1) {
      printf("\nBOMBA!!! Vc ganhou 1 ponto.");
      ponto = ponto + 1;
    } else {
      printf("\nAgua!!! Que pena.");
    }
    printf("\nDeseja Continuar: (s/n)?\n");
    scanf(" %c", &continuar);
  } while (continuar == 's');
  printf("\n\n%s, vc fez %d pontos.", nome, ponto);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x74(%rbp)
cmpl   $0x6,-0x74(%rbp)
jge    11f0 <main+0xd0>
movl   $0x1,-0x78(%rbp)
cmpl   $0x6,-0x78(%rbp)
jge    11dd <main+0xbd>
lea    -0xa0(%rbp),%rsi
mov    -0x74(%rbp),%edx
mov    -0x78(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x74(%rbp),%rax
lea    -0x70(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
movslq -0x78(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1182 <main+0x62>
jmp    11e2 <main+0xc2>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1171 <main+0x51>
jmp    11f5 <main+0xd5>
lea    -0xa0(%rbp),%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x5,-0x80(%rbp)
mov    %al,-0xa2(%rbp)
jg     1249 <main+0x129>
cmpl   $0x1,-0x80(%rbp)
setl   %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
test   $0x1,%al
jne    125c <main+0x13c>
jmp    1288 <main+0x168>
lea    -0xa0(%rbp),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe03(%rip),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    122a <main+0x10a>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdde(%rip),%rdi
lea    -0x84(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x5,-0x84(%rbp)
mov    %al,-0xa3(%rbp)
jg     12d0 <main+0x1b0>
cmpl   $0x1,-0x84(%rbp)
setl   %al
mov    %al,-0xa3(%rbp)
mov    -0xa3(%rbp),%al
test   $0x1,%al
jne    12e3 <main+0x1c3>
jmp    1312 <main+0x1f2>
lea    -0xa0(%rbp),%rsi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd7c(%rip),%rdi
lea    -0x84(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    12ab <main+0x18b>
movslq -0x80(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x84(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    134e <main+0x22e>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    135c <main+0x23c>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf9(%rip),%rdi
lea    -0xa1(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0xa1(%rbp),%eax
cmp    $0x73,%eax
je     11f5 <main+0xd5>
lea    -0xa0(%rbp),%rsi
mov    -0x7c(%rbp),%edx
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0xffa(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x80(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe97(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x28(%rsp),%rsi
lea    0xec6(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x34(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x38(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x3c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x40(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x44(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x48(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x50(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x54(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x58(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x5c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x60(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x64(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x68(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x6c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x74(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x78(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x7c(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x80(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x84(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x88(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x4(%rsp),%rbx
lea    0xb39(%rip),%rbp
lea    0x8(%rsp),%r12
lea    0xb63(%rip),%r15
jmp    1598 <main+0x468>
xchg   %ax,%ax
lea    0xbac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xbf3(%rip),%rdi
call   1030 <puts@plt>
lea    0xba5(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpb   $0x73,0x3(%rsp)
jne    167b <main+0x54b>
lea    0xacb(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xba5(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xfffffffa,%eax
cmp    $0xfffffffa,%eax
ja     15f6 <main+0x4c6>
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xfffffffa,%eax
cmp    $0xfffffffb,%eax
jb     15d0 <main+0x4a0>
lea    0xb61(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0x6(%rax),%ecx
cmp    $0xfffffffa,%ecx
ja     1646 <main+0x516>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0x6(%rax),%ecx
cmp    $0xfffffffb,%ecx
jb     1620 <main+0x4f0>
movslq 0x4(%rsp),%rcx
mov    %eax,%eax
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,4),%rcx
add    $0x10,%rcx
cmpl   $0x1,(%rcx,%rax,4)
jne    1560 <main+0x430>
lea    0xa8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x1,0xc(%rsp)
jmp    156e <main+0x43e>
lea    0xaa8(%rip),%rdi
lea    0x80(%rsp),%rsi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Digite o seu nome:\0A\00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [61 x i8] c"\0A%s, preencha a matriz com 1 - para o navio e 0 - para agua:\00"
@.str.3 = [38 x i8] c"\0A\0A %s, digite a Linha %d, coluna %d:\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [31 x i8] c"\0A%s, entre com as coordenadas:\00"
@.str.6 = [10 x i8] c"\0ALinha: \0A\00"
@.str.7 = [54 x i8] c"\0A %s, entre com as coordenadas da Linha de 1 at\C3\A9 5:\0A\00"
@.str.8 = [11 x i8] c"\0AColuna: \0A\00"
@.str.9 = [55 x i8] c"\0A %s, entre com as coordenadas da Coluna de 1 at\C3\A9 5:\0A\00"
@.str.10 = [29 x i8] c"\0ABOMBA!!! Vc ganhou 1 ponto.\00"
@.str.11 = [19 x i8] c"\0AAgua!!! Que pena.\00"
@.str.12 = [27 x i8] c"\0ADeseja Continuar: (s/n)?\0A\00"
@.str.13 = [4 x i8] c" %c\00"
@.str.14 = [24 x i8] c"\0A\0A%s, vc fez %d pontos.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca i8
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %13)
store i32 1, i32* %3
br label %15
15: ; preds = %38, %0
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 6
br i1 %17, label %18, label %41
18: ; preds = %15
store i32 1, i32* %4
br label %19
19: ; preds = %34, %18
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 6
br i1 %21, label %22, label %37
22: ; preds = %19
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %23, i32 %24, i32 %25)
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 %28
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [5 x i32], [5 x i32]* %29, i64 0, i64 %31
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %32)
br label %34
34: ; preds = %22
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %19
37: ; preds = %19
br label %38
38: ; preds = %37
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %15
41: ; preds = %15
br label %42
42: ; preds = %92, %41
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
br label %47
47: ; preds = %55, %42
%48 = load i32, i32* %6
%49 = icmp sgt i32 %48, 5
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = load i32, i32* %6
%52 = icmp slt i32 %51, 1
br label %53
53: ; preds = %50, %47
%54 = phi i1 [ true, %47 ], [ %52, %50 ]
br i1 %54, label %55, label %59
55: ; preds = %53
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %56)
%58 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
br label %47
59: ; preds = %53
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%61 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
br label %62
62: ; preds = %70, %59
%63 = load i32, i32* %7
%64 = icmp sgt i32 %63, 5
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = load i32, i32* %7
%67 = icmp slt i32 %66, 1
br label %68
68: ; preds = %65, %62
%69 = phi i1 [ true, %62 ], [ %67, %65 ]
br i1 %69, label %70, label %74
70: ; preds = %68
%71 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %71)
%73 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
br label %62
74: ; preds = %68
%75 = load i32, i32* %6
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [5 x i32], [5 x i32]* %77, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = icmp eq i32 %81, 1
br i1 %82, label %83, label %87
83: ; preds = %74
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%85 = load i32, i32* %5
%86 = add nsw i32 %85, 1
store i32 %86, i32* %5
br label %89
87: ; preds = %74
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
br label %89
89: ; preds = %87, %83
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%91 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %9)
br label %92
92: ; preds = %89
%93 = load i8, i8* %9
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 115
br i1 %95, label %42, label %96
96: ; preds = %92
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%98 = load i32, i32* %5
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i8* %97, i32 %98)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [61 x i8] c"\0A%s, preencha a matriz com 1 - para o navio e 0 - para agua:\00"
@.str.3 = [38 x i8] c"\0A\0A %s, digite a Linha %d, coluna %d:\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [31 x i8] c"\0A%s, entre com as coordenadas:\00"
@.str.7 = [54 x i8] c"\0A %s, entre com as coordenadas da Linha de 1 at\C3\A9 5:\0A\00"
@.str.9 = [55 x i8] c"\0A %s, entre com as coordenadas da Coluna de 1 at\C3\A9 5:\0A\00"
@.str.10 = [29 x i8] c"\0ABOMBA!!! Vc ganhou 1 ponto.\00"
@.str.11 = [19 x i8] c"\0AAgua!!! Que pena.\00"
@.str.13 = [4 x i8] c" %c\00"
@.str.14 = [24 x i8] c"\0A\0A%s, vc fez %d pontos.\00"
@str = [19 x i8] c"Digite o seu nome:\00"
@str.15 = [9 x i8] c"\0ALinha: \00"
@str.16 = [10 x i8] c"\0AColuna: \00"
@str.17 = [26 x i8] c"\0ADeseja Continuar: (s/n)?\00"
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = alloca i8
%6 = bitcast [5 x [5 x i32]]* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 1, i32 1)
%14 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 1
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 1, i32 2)
%17 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 2
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 1, i32 3)
%20 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 3
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 1, i32 4)
%23 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 4
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 1, i32 5)
%26 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 5
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 2, i32 1)
%29 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 1
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 2, i32 2)
%32 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 2
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 2, i32 3)
%35 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 3
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %35)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 2, i32 4)
%38 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 4
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 2, i32 5)
%41 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 5
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 3, i32 1)
%44 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 1
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %44)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 3, i32 2)
%47 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 2
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %47)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 3, i32 3)
%50 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 3
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %50)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 3, i32 4)
%53 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 4
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 3, i32 5)
%56 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 5
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %56)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 4, i32 1)
%59 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 1
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %59)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 4, i32 2)
%62 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 2
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 4, i32 3)
%65 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 3
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %65)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 4, i32 4)
%68 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 4
%69 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 4, i32 5)
%71 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 5
%72 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %71)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 5, i32 1)
%74 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 5, i64 1
%75 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %74)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 5, i32 2)
%77 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 5, i64 2
%78 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 5, i32 3)
%80 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 5, i64 3
%81 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %80)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 5, i32 4)
%83 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 5, i64 4
%84 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %83)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 5, i32 5)
%86 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 5, i64 5
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %86)
br label %88
88: ; preds = %0, %127
%89 = phi i32 [ %128, %127 ], [ undef, %0 ]
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0))
%92 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%93 = load i32, i32* %2
%94 = add i32 %93, -6
%95 = icmp ult i32 %94, -5
br i1 %95, label %96, label %102
96: ; preds = %88, %96
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%98 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%99 = load i32, i32* %2
%100 = add i32 %99, -6
%101 = icmp ult i32 %100, -5
br i1 %101, label %96, label %102
102: ; preds = %96, %88
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0))
%104 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%105 = load i32, i32* %3
%106 = add i32 %105, -6
%107 = icmp ult i32 %106, -5
br i1 %107, label %108, label %114
108: ; preds = %102, %108
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %9)
%110 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%111 = load i32, i32* %3
%112 = add i32 %111, -6
%113 = icmp ult i32 %112, -5
br i1 %113, label %108, label %114
114: ; preds = %108, %102
%115 = phi i32 [ %105, %102 ], [ %111, %108 ]
%116 = load i32, i32* %2
%117 = sext i32 %116 to i64
%118 = zext i32 %115 to i64
%119 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 %117, i64 %118
%120 = load i32, i32* %119
%121 = icmp eq i32 %120, 1
br i1 %121, label %122, label %125
122: ; preds = %114
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%124 = add nsw i32 %89, 1
br label %127
125: ; preds = %114
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
br label %127
127: ; preds = %125, %122
%128 = phi i32 [ %124, %122 ], [ %89, %125 ]
%129 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.17, i64 0, i64 0))
%130 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %5)
%131 = load i8, i8* %5
%132 = icmp eq i8 %131, 115
br i1 %132, label %88, label %133
133: ; preds = %127
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i8* %9, i32 %128)
ret i32 0
}