#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 *, int *);
int main() {
  int inimigo[5][10] = {{0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
                        {0, 1, 1, 1, 0, 1, 1, 0, 0, 0},
                        {0, 1, 1, 0, 0, 0, 0, 1, 0, 0},
                        {0, 1, 0, 1, 0, 1, 1, 0, 0, 0},
                        {0, 0, 0, 1, 1, 0, 0, 1, 0, 1}};
  char tabuleiro[5][10];
  int i, j;
  int rodada = 0, tiros = 24, acertos = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      tabuleiro[i][j] = '.';
    }
  }
  do {
    for (i = 0; i < 5; i++) {
      for (j = 0; j < 10; j++) {
        printf("%c ", tabuleiro[i][j]);
      }
      printf("\n");
    }
    if (rodada == 25) {
      printf("\n\n\n                      ***Acabou seus tiros, você "
             "perdeu!!!***\n");
      break;
    }
    printf("\nInforme as coordenadas do tiro (linha coluna):\n");
    scanf("%d %d", &i, &j);
    while (i < 0 || i > 4 || j < 0 || j > 9) {
      printf(
          "\n\n		******Coordenadas inválido, digite outro:*****\n\n");
      scanf("%d %d", &i, &j);
    }
    if (tabuleiro[i][j] == 'X' || tabuleiro[i][j] == 'O') {
      printf("\n\n		******Coordenadas inválidas, Alvo já "
             "abatido******\n\n");
      printf("\n\n\n		******Tente outro******\n\n\n");
      continue;
    }
    if (i >= 0 && j >= 0) {
      if (inimigo[i][j] == 1) {
        tabuleiro[i][j] = 'X';
        acertos++;
      } else {
        tabuleiro[i][j] = 'O';
      }
    }
    if (tiros == 0) {
      printf("Você não tem mais tiros\n");
      printf("Você acertou %i alvo(s)\n", acertos);
    } else {
      printf("Você tem %i tiro(s)\n", tiros);
      printf("Você acertou %i alvo(s)\n", acertos);
    }
    if (acertos == 17) {
      printf("\n\n			*****Parabéns, você afundou "
             "todas!!!***** \n\n");
      break;
    }
    rodada++;
    tiros--;
  } while (rodada <= 25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0xc8,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x11c(%rbp)
movl   $0x18,-0x120(%rbp)
movl   $0x0,-0x124(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0xa,-0x114(%rbp)
jge    11f3 <main+0xc3>
movl   $0x0,-0x118(%rbp)
cmpl   $0xa,-0x118(%rbp)
jge    11da <main+0xaa>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    1199 <main+0x69>
jmp    11df <main+0xaf>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1182 <main+0x52>
jmp    11f8 <main+0xc8>
movl   $0x0,-0x114(%rbp)
cmpl   $0x5,-0x114(%rbp)
jge    128a <main+0x15a>
movl   $0x0,-0x118(%rbp)
cmpl   $0xa,-0x118(%rbp)
jge    1268 <main+0x138>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    1219 <main+0xe9>
lea    0xf66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1202 <main+0xd2>
cmpl   $0x19,-0x11c(%rbp)
jne    12aa <main+0x17a>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1514 <main+0x3e4>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
lea    -0x114(%rbp),%rsi
lea    -0x118(%rbp),%rdx
call   1050 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x114(%rbp)
mov    %al,-0x125(%rbp)
jl     1321 <main+0x1f1>
mov    $0x1,%al
cmpl   $0x4,-0x114(%rbp)
mov    %al,-0x125(%rbp)
jg     1321 <main+0x1f1>
mov    $0x1,%al
cmpl   $0x0,-0x118(%rbp)
mov    %al,-0x125(%rbp)
jl     1321 <main+0x1f1>
cmpl   $0x9,-0x118(%rbp)
setg   %al
mov    %al,-0x125(%rbp)
mov    -0x125(%rbp),%al
test   $0x1,%al
jne    1334 <main+0x204>
jmp    1361 <main+0x231>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf7(%rip),%rdi
lea    -0x114(%rbp),%rsi
lea    -0x118(%rbp),%rdx
call   1050 <scanf@plt>
jmp    12d2 <main+0x1a2>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x58,%eax
je     13b3 <main+0x283>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4f,%eax
jne    13d4 <main+0x2a4>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1507 <main+0x3d7>
cmpl   $0x0,-0x114(%rbp)
jl     146d <main+0x33d>
cmpl   $0x0,-0x118(%rbp)
jl     146d <main+0x33d>
movslq -0x114(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1448 <main+0x318>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1468 <main+0x338>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
jmp    146d <main+0x33d>
cmpl   $0x0,-0x120(%rbp)
jne    14a1 <main+0x371>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x124(%rbp),%esi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14c9 <main+0x399>
mov    -0x120(%rbp),%esi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x124(%rbp),%esi
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x11,-0x124(%rbp)
jne    14e9 <main+0x3b9>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1514 <main+0x3e4>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
mov    -0x120(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x120(%rbp)
cmpl   $0x19,-0x11c(%rbp)
jle    11f8 <main+0xc8>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movl   $0x2e2e2e2e,0x80(%rsp)
2e 2e 2e 2e
mov    $0x18,%eax
lea    0xf4e(%rip),%rbx
lea    0xf4b(%rip),%r13
lea    0x10(%rsp),%rbp
lea    0xc(%rsp),%r14
lea    0x1046(%rip),%r15
xor    %r12d,%r12d
movl   $0x0,0x18(%rsp)
jmp    11d6 <main+0x96>
nop
lea    0xfd8(%rip),%rdi
call   1040 <puts@plt>
lea    0x1006(%rip),%rdi
call   1040 <puts@plt>
mov    0x14(%rsp),%eax
cmp    $0x1a,%r12d
jge    13a8 <main+0x268>
mov    %eax,0x14(%rsp)
movl   $0x0,0x10(%rsp)
xor    %eax,%eax
jmp    120a <main+0xca>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x10(%rsp)
cmp    $0x4,%ecx
jge    1280 <main+0x140>
movl   $0x0,0xc(%rsp)
cltq
lea    (%rax,%rax,4),%rax
movsbl 0x20(%rsp,%rax,2),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0x8,%ecx
jg     11f0 <main+0xb0>
nopw   0x0(%rax,%rax,1)
movslq 0x10(%rsp),%rcx
cltq
lea    (%rcx,%rcx,4),%rcx
lea    (%rsp,%rcx,2),%rcx
add    $0x20,%rcx
movsbl (%rax,%rcx,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0x9,%ecx
jl     1240 <main+0x100>
jmp    11f0 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x19,%r12d
je     1393 <main+0x253>
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x4,%eax
ja     12c0 <main+0x180>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
js     12c0 <main+0x180>
cmp    $0xa,%ecx
jl     12ec <main+0x1ac>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x4,%eax
ja     12c0 <main+0x180>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
js     12c0 <main+0x180>
cmp    $0x9,%ecx
jg     12c0 <main+0x180>
mov    %eax,%eax
mov    %ecx,%ecx
lea    (%rax,%rax,4),%rsi
lea    (%rsp,%rsi,2),%rax
add    $0x20,%rax
mov    (%rcx,%rax,1),%dl
cmp    $0x58,%dl
je     11b0 <main+0x70>
cmp    $0x4f,%dl
je     11b0 <main+0x70>
add    %rcx,%rax
lea    0xcf5(%rip),%rdx
lea    (%rdx,%rsi,8),%rdx
cmpl   $0x1,(%rdx,%rcx,4)
jne    132f <main+0x1ef>
movb   $0x58,(%rax)
addl   $0x1,0x18(%rsp)
jmp    1332 <main+0x1f2>
movb   $0x4f,(%rax)
mov    0x14(%rsp),%esi
test   %esi,%esi
mov    %r12d,0x1c(%rsp)
je     134f <main+0x20f>
lea    0xdb6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    135b <main+0x21b>
lea    0xe1f(%rip),%rdi
call   1040 <puts@plt>
lea    0xd80(%rip),%rdi
mov    0x18(%rsp),%r12d
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x11,%r12d
je     139c <main+0x25c>
mov    0x1c(%rsp),%r12d
add    $0x1,%r12d
mov    0x14(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x1a,%r12d
jl     11d6 <main+0x96>
jmp    13a8 <main+0x268>
lea    0xe83(%rip),%rdi
jmp    13a3 <main+0x263>
lea    0xd9f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.inimigo = [5 x [10 x i32]] [[10 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]]
@.str = [4 x i8] c"%c \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [67 x i8] c"\0A\0A\0A ***Acabou seus tiros, voc\C3\AA perdeu!!!***\0A\00"
@.str.3 = [49 x i8] c"\0AInforme as coordenadas do tiro (linha coluna):\0A\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [54 x i8] c"\0A\0A\09\09******Coordenadas inv\C3\A1lido, digite outro:*****\0A\0A\00"
@.str.6 = [59 x i8] c"\0A\0A\09\09******Coordenadas inv\C3\A1lidas, Alvo j\C3\A1 abatido******\0A\0A\00"
@.str.7 = [32 x i8] c"\0A\0A\0A\09\09******Tente outro******\0A\0A\0A\00"
@.str.8 = [27 x i8] c"Voc\C3\AA n\C3\A3o tem mais tiros\0A\00"
@.str.9 = [26 x i8] c"Voc\C3\AA acertou %i alvo(s)\0A\00"
@.str.10 = [22 x i8] c"Voc\C3\AA tem %i tiro(s)\0A\00"
@.str.11 = [52 x i8] c"\0A\0A\09\09\09*****Parab\C3\A9ns, voc\C3\AA afundou todas!!!***** \0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [10 x i32]]
%3 = alloca [5 x [10 x i8]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [5 x [10 x i32]]* %2 to i8*
store i32 0, i32* %6
store i32 24, i32* %7
store i32 0, i32* %8
store i32 0, i32* %4
br label %10
10: ; preds = %28, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %31
13: ; preds = %10
store i32 0, i32* %5
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %20, i64 0, i64 %22
store i8 46, i8* %23
br label %24
24: ; preds = %17
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %14
27: ; preds = %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %10
31: ; preds = %10
br label %32
32: ; preds = %160, %31
store i32 0, i32* %4
br label %33
33: ; preds = %55, %32
%34 = load i32, i32* %4
%35 = icmp slt i32 %34, 5
br i1 %35, label %36, label %58
36: ; preds = %33
store i32 0, i32* %5
br label %37
37: ; preds = %50, %36
%38 = load i32, i32* %5
%39 = icmp slt i32 %38, 10
br i1 %39, label %40, label %53
40: ; preds = %37
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %42
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [10 x i8], [10 x i8]* %43, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %40
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %37
53: ; preds = %37
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %4
%57 = add nsw i32 %56, 1
store i32 %57, i32* %4
br label %33
58: ; preds = %33
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 25
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
br label %163
63: ; preds = %58
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%65 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5)
br label %66
66: ; preds = %80, %63
%67 = load i32, i32* %4
%68 = icmp slt i32 %67, 0
br i1 %68, label %78, label %69
69: ; preds = %66
%70 = load i32, i32* %4
%71 = icmp sgt i32 %70, 4
br i1 %71, label %78, label %72
72: ; preds = %69
%73 = load i32, i32* %5
%74 = icmp slt i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %72
%76 = load i32, i32* %5
%77 = icmp sgt i32 %76, 9
br label %78
78: ; preds = %75, %72, %69, %66
%79 = phi i1 [ true, %72 ], [ true, %69 ], [ true, %66 ], [ %77, %75 ]
br i1 %79, label %80, label %83
80: ; preds = %78
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
%82 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5)
br label %66
83: ; preds = %78
%84 = load i32, i32* %4
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %85
%87 = load i32, i32* %5
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [10 x i8], [10 x i8]* %86, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 88
br i1 %92, label %103, label %93
93: ; preds = %83
%94 = load i32, i32* %4
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %95
%97 = load i32, i32* %5
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [10 x i8], [10 x i8]* %96, i64 0, i64 %98
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 79
br i1 %102, label %103, label %106
103: ; preds = %93, %83
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %160
106: ; preds = %93
%107 = load i32, i32* %4
%108 = icmp sge i32 %107, 0
br i1 %108, label %109, label %138
109: ; preds = %106
%110 = load i32, i32* %5
%111 = icmp sge i32 %110, 0
br i1 %111, label %112, label %138
112: ; preds = %109
%113 = load i32, i32* %4
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [5 x [10 x i32]], [5 x [10 x i32]]* %2, i64 0, i64 %114
%116 = load i32, i32* %5
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [10 x i32], [10 x i32]* %115, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = icmp eq i32 %119, 1
br i1 %120, label %121, label %130
121: ; preds = %112
%122 = load i32, i32* %4
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %123
%125 = load i32, i32* %5
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [10 x i8], [10 x i8]* %124, i64 0, i64 %126
store i8 88, i8* %127
%128 = load i32, i32* %8
%129 = add nsw i32 %128, 1
store i32 %129, i32* %8
br label %137
130: ; preds = %112
%131 = load i32, i32* %4
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %3, i64 0, i64 %132
%134 = load i32, i32* %5
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [10 x i8], [10 x i8]* %133, i64 0, i64 %135
store i8 79, i8* %136
br label %137
137: ; preds = %130, %121
br label %138
138: ; preds = %137, %109, %106
%139 = load i32, i32* %7
%140 = icmp eq i32 %139, 0
br i1 %140, label %141, label %145
141: ; preds = %138
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%143 = load i32, i32* %8
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %143)
br label %150
145: ; preds = %138
%146 = load i32, i32* %7
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 %146)
%148 = load i32, i32* %8
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %148)
br label %150
150: ; preds = %145, %141
%151 = load i32, i32* %8
%152 = icmp eq i32 %151, 17
br i1 %152, label %153, label %155
153: ; preds = %150
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0))
br label %163
155: ; preds = %150
%156 = load i32, i32* %6
%157 = add nsw i32 %156, 1
store i32 %157, i32* %6
%158 = load i32, i32* %7
%159 = add nsw i32 %158, -1
store i32 %159, i32* %7
br label %160
160: ; preds = %155, %103
%161 = load i32, i32* %6
%162 = icmp sle i32 %161, 25
br i1 %162, label %32, label %163
163: ; preds = %160, %153, %61
ret i32 0
}

LLVM IR (-O2):
@__const.main.inimigo = [5 x [10 x i32]] [[10 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]]
@.str = [4 x i8] c"%c \00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.9 = [26 x i8] c"Voc\C3\AA acertou %i alvo(s)\0A\00"
@.str.10 = [22 x i8] c"Voc\C3\AA tem %i tiro(s)\0A\00"
@str = [48 x i8] c"\0AInforme as coordenadas do tiro (linha coluna):\00"
@str.12 = [51 x i8] c"\0A\0A\09\09\09*****Parab\C3\A9ns, voc\C3\AA afundou todas!!!***** \0A\00"
@str.13 = [26 x i8] c"Voc\C3\AA n\C3\A3o tem mais tiros\00"
@str.14 = [58 x i8] c"\0A\0A\09\09******Coordenadas inv\C3\A1lidas, Alvo j\C3\A1 abatido******\0A\00"
@str.15 = [31 x i8] c"\0A\0A\0A\09\09******Tente outro******\0A\0A\00"
@str.16 = [53 x i8] c"\0A\0A\09\09******Coordenadas inv\C3\A1lido, digite outro:*****\0A\00"
@str.17 = [66 x i8] c"\0A\0A\0A ***Acabou seus tiros, voc\C3\AA perdeu!!!***\00"
define i32 @main() {
%1 = alloca [5 x [10 x i8]]
%2 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
br label %8
8: ; preds = %0, %91
%9 = phi i32 [ %92, %91 ], [ 0, %0 ]
%10 = phi i32 [ %93, %91 ], [ 24, %0 ]
%11 = phi i32 [ %94, %91 ], [ 0, %0 ]
store i32 0, i32* %3
br label %12
12: ; preds = %8, %34
%13 = phi i32 [ 0, %8 ], [ %37, %34 ]
store i32 0, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %1, i64 0, i64 %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
%21 = icmp slt i32 %19, 9
br i1 %21, label %22, label %34
22: ; preds = %12, %22
%23 = phi i32 [ %32, %22 ], [ %20, %12 ]
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = sext i32 %23 to i64
%27 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %1, i64 0, i64 %25, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
%33 = icmp slt i32 %31, 9
br i1 %33, label %22, label %34
34: ; preds = %22, %12
%35 = call i32 @putchar(i32 10)
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
%38 = icmp slt i32 %36, 4
br i1 %38, label %12, label %39
39: ; preds = %34
%40 = icmp eq i32 %9, 25
br i1 %40, label %96, label %41
41: ; preds = %39
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4)
%44 = load i32, i32* %3
%45 = icmp ugt i32 %44, 4
%46 = load i32, i32* %4
%47 = icmp slt i32 %46, 0
%48 = select i1 %45, i1 true, i1 %47
%49 = icmp sgt i32 %46, 9
%50 = select i1 %48, i1 true, i1 %49
br i1 %50, label %51, label %61
51: ; preds = %41, %51
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.16, i64 0, i64 0))
%53 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4)
%54 = load i32, i32* %3
%55 = icmp ugt i32 %54, 4
%56 = load i32, i32* %4
%57 = icmp slt i32 %56, 0
%58 = select i1 %55, i1 true, i1 %57
%59 = icmp sgt i32 %56, 9
%60 = select i1 %58, i1 true, i1 %59
br i1 %60, label %51, label %61
61: ; preds = %51, %41
%62 = phi i32 [ %44, %41 ], [ %54, %51 ]
%63 = phi i32 [ %46, %41 ], [ %56, %51 ]
%64 = zext i32 %62 to i64
%65 = zext i32 %63 to i64
%66 = getelementptr inbounds [5 x [10 x i8]], [5 x [10 x i8]]* %1, i64 0, i64 %64, i64 %65
%67 = load i8, i8* %66
switch i8 %67, label %71 [
i8 88, label %68
i8 79, label %68
]
68: ; preds = %61, %61
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.14, i64 0, i64 0))
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.15, i64 0, i64 0))
br label %91
71: ; preds = %61
%72 = getelementptr inbounds [5 x [10 x i32]], [5 x [10 x i32]]* @__const.main.inimigo, i64 0, i64 %64, i64 %65
%73 = load i32, i32* %72
%74 = icmp eq i32 %73, 1
br i1 %74, label %75, label %77
75: ; preds = %71
store i8 88, i8* %66
%76 = add nsw i32 %11, 1
br label %78
77: ; preds = %71
store i8 79, i8* %66
br label %78
78: ; preds = %75, %77
%79 = phi i32 [ %76, %75 ], [ %11, %77 ]
%80 = icmp eq i32 %10, 0
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
br label %85
83: ; preds = %78
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 %10)
br label %85
85: ; preds = %83, %81
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %79)
%87 = icmp eq i32 %79, 17
br i1 %87, label %96, label %88
88: ; preds = %85
%89 = add nsw i32 %9, 1
%90 = add nsw i32 %10, -1
br label %91
91: ; preds = %88, %68
%92 = phi i32 [ %9, %68 ], [ %89, %88 ]
%93 = phi i32 [ %10, %68 ], [ %90, %88 ]
%94 = phi i32 [ %11, %68 ], [ %79, %88 ]
%95 = icmp slt i32 %92, 26
br i1 %95, label %8, label %99
96: ; preds = %85, %39
%97 = phi i8* [ getelementptr inbounds ([66 x i8], [66 x i8]* @str.17, i64 0, i64 0), %39 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @str.12, i64 0, i64 0), %85 ]
%98 = call i32 @puts(i8* dereferenceable(1) %97)
br label %99
99: ; preds = %91, %96
ret i32 0
}