#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() {
  char tabuleiro[5][5];
  char batalha[5][5] = {{0, 0, 0, 0, 0},
                        {0, 1, 0, 0, 1},
                        {0, 1, 0, 0, 0},
                        {0, 0, 0, 1, 0},
                        {1, 0, 1, 0, 1}};
  char nome[20];
  char continuar;
  int ponto = 0;
  int i;
  int j;
  printf("Diga seu Nome:   ");
  scanf("%s", nome);
  do {
    for (i = 0; i < 5; i++) {
      for (j = 0; j < 5; j++) {
        tabuleiro[i][j] = '*';
        printf("%c", tabuleiro[i][j]);
      }
      printf("\n");
    }
    printf("Escolha onde Deseja Atirar, Linha(0--4) \n  ");
    scanf("%d", &i);
    printf("Escolha onde Deseja Atirar, Coluna(0--4) \n ");
    scanf("%d", &j);
    if (batalha[i][j] == 1) {
      tabuleiro[i][j] = 'X';
      printf("Bomba!!, você ganhou 1 ponto");
      ponto++;
      printf("%d", ponto);
      printf("\n");
    } else {
      tabuleiro[i][j] = '0';
      printf("\n");
      printf("Agua!! Que Pena!!");
      printf("\n");
    }
    for (i = 0; i < 5; i++) {
      for (j = 0; j < 5; j++) {
        printf("%c", tabuleiro[i][j]);
      }
      printf("\n");
    }
    printf("deseja continuar sim=s não=n\n");
    scanf(" %c", &continuar);
    if (continuar == 'n') {
      printf("%s, você fez: %d!! \n", nome, ponto);
      break;
    }
  } while (continuar == 's');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x28(%rbp)
movl   $0x0,-0x68(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x5,-0x6c(%rbp)
jge    1208 <main+0xe8>
movl   $0x0,-0x70(%rbp)
cmpl   $0x5,-0x70(%rbp)
jge    11ec <main+0xcc>
movslq -0x6c(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
movslq -0x6c(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1198 <main+0x78>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1187 <main+0x67>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
lea    -0x6c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1d(%rip),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x6c(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jne    12ba <main+0x19a>
movslq -0x6c(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12fb <main+0x1db>
movslq -0x6c(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x5,-0x6c(%rbp)
jge    136c <main+0x24c>
movl   $0x0,-0x70(%rbp)
cmpl   $0x5,-0x70(%rbp)
jge    1350 <main+0x230>
movslq -0x6c(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1313 <main+0x1f3>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1302 <main+0x1e2>
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd57(%rip),%rdi
lea    -0x61(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x61(%rbp),%eax
cmp    $0x6e,%eax
jne    13b3 <main+0x293>
lea    -0x60(%rbp),%rsi
mov    -0x68(%rbp),%edx
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c5 <main+0x2a5>
jmp    13b8 <main+0x298>
movsbl -0x61(%rbp),%eax
cmp    $0x73,%eax
je     1180 <main+0x60>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xee4(%rip),%r15
lea    0xf(%rsp),%r13
xor    %ebx,%ebx
jmp    11a9 <main+0x69>
nop
lea    0xf4c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf26(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x73,%al
jne    138d <main+0x24d>
movl   $0x0,0x8(%rsp)
xor    %eax,%eax
jmp    11da <main+0x9a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
cmp    $0x4,%ecx
jge    1250 <main+0x110>
movl   $0x0,0x4(%rsp)
cltq
lea    (%rax,%rax,4),%rax
movb   $0x2a,0x10(%rsp,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
cmp    $0x3,%ecx
jg     11c0 <main+0x80>
nopw   0x0(%rax,%rax,1)
movslq 0x8(%rsp),%rcx
cltq
lea    (%rcx,%rcx,4),%rcx
add    %rsp,%rcx
add    $0x10,%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
cmp    $0x4,%ecx
jl     1210 <main+0xd0>
jmp    11c0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xdd7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0x8(%rsp),%rax
movslq 0x4(%rsp),%rbp
lea    (%rax,%rax,4),%r14
lea    0xd61(%rip),%rax
add    %r14,%rax
cmpb   $0x1,0x0(%rbp,%rax,1)
jne    12d0 <main+0x190>
lea    0xdd9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x58,%r12b
jmp    12eb <main+0x1ab>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x30,%r12b
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%rsp,%r14,1),%rax
add    $0x10,%rax
mov    %r12b,0x0(%rbp,%rax,1)
movl   $0x0,0x8(%rsp)
xor    %eax,%eax
jmp    132e <main+0x1ee>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
cmp    $0x4,%ecx
jge    1180 <main+0x40>
movl   $0x0,0x4(%rsp)
cltq
lea    (%rax,%rax,4),%rax
movsbl 0x10(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
cmp    $0x3,%ecx
jg     1310 <main+0x1d0>
cs nopw 0x0(%rax,%rax,1)
movslq 0x8(%rsp),%rcx
cltq
lea    (%rcx,%rcx,4),%rcx
add    %rsp,%rcx
add    $0x10,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
cmp    $0x4,%ecx
jl     1360 <main+0x220>
jmp    1310 <main+0x1d0>
cmp    $0x6e,%al
jne    13a6 <main+0x266>
lea    0xd25(%rip),%rdi
lea    0x30(%rsp),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.batalha = [5 x [5 x i8]] [[5 x i8] zeroinitializer, [5 x i8] c"\00\01\00\00\01", [5 x i8] c"\00\01\00\00\00", [5 x i8] c"\00\00\00\01\00", [5 x i8] c"\01\00\01\00\01"]
@.str = [18 x i8] c"Diga seu Nome: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [44 x i8] c"Escolha onde Deseja Atirar, Linha(0--4) \0A \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [44 x i8] c"Escolha onde Deseja Atirar, Coluna(0--4) \0A \00"
@.str.7 = [30 x i8] c"Bomba!!, voc\C3\AA ganhou 1 ponto\00"
@.str.8 = [18 x i8] c"Agua!! Que Pena!!\00"
@.str.9 = [31 x i8] c"deseja continuar sim=s n\C3\A3o=n\0A\00"
@.str.10 = [4 x i8] c" %c\00"
@.str.11 = [22 x i8] c"%s, voc\C3\AA fez: %d!! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i8]]
%3 = alloca [5 x [5 x i8]]
%4 = alloca [20 x i8]
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [5 x [5 x i8]]* %3 to i8*
store i32 0, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %119, %0
store i32 0, i32* %7
br label %14
14: ; preds = %42, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %45
17: ; preds = %14
store i32 0, i32* %8
br label %18
18: ; preds = %37, %17
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %40
21: ; preds = %18
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %2, i64 0, i64 %23
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 %26
store i8 42, i8* %27
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %2, i64 0, i64 %29
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %30, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %21
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %18
40: ; preds = %18
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %14
45: ; preds = %14
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %8)
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %3, i64 0, i64 %51
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [5 x i8], [5 x i8]* %52, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %72
59: ; preds = %45
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %2, i64 0, i64 %61
%63 = load i32, i32* %8
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [5 x i8], [5 x i8]* %62, i64 0, i64 %64
store i8 88, i8* %65
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
%69 = load i32, i32* %6
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %82
72: ; preds = %45
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %2, i64 0, i64 %74
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [5 x i8], [5 x i8]* %75, i64 0, i64 %77
store i8 48, i8* %78
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %82
82: ; preds = %72, %59
store i32 0, i32* %7
br label %83
83: ; preds = %105, %82
%84 = load i32, i32* %7
%85 = icmp slt i32 %84, 5
br i1 %85, label %86, label %108
86: ; preds = %83
store i32 0, i32* %8
br label %87
87: ; preds = %100, %86
%88 = load i32, i32* %8
%89 = icmp slt i32 %88, 5
br i1 %89, label %90, label %103
90: ; preds = %87
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %2, i64 0, i64 %92
%94 = load i32, i32* %8
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [5 x i8], [5 x i8]* %93, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %98)
br label %100
100: ; preds = %90
%101 = load i32, i32* %8
%102 = add nsw i32 %101, 1
store i32 %102, i32* %8
br label %87
103: ; preds = %87
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %105
105: ; preds = %103
%106 = load i32, i32* %7
%107 = add nsw i32 %106, 1
store i32 %107, i32* %7
br label %83
108: ; preds = %83
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0))
%110 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %5)
%111 = load i8, i8* %5
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 110
br i1 %113, label %114, label %118
114: ; preds = %108
%115 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%116 = load i32, i32* %6
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* %115, i32 %116)
br label %123
118: ; preds = %108
br label %119
119: ; preds = %118
%120 = load i8, i8* %5
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 115
br i1 %122, label %13, label %123
123: ; preds = %119, %114
ret i32 0
}

LLVM IR (-O2):
@__const.main.batalha = [5 x [5 x i8]] [[5 x i8] zeroinitializer, [5 x i8] c"\00\01\00\00\01", [5 x i8] c"\00\01\00\00\00", [5 x i8] c"\00\00\00\01\00", [5 x i8] c"\01\00\01\00\01"]
@.str = [18 x i8] c"Diga seu Nome: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [44 x i8] c"Escolha onde Deseja Atirar, Linha(0--4) \0A \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [44 x i8] c"Escolha onde Deseja Atirar, Coluna(0--4) \0A \00"
@.str.7 = [30 x i8] c"Bomba!!, voc\C3\AA ganhou 1 ponto\00"
@.str.8 = [18 x i8] c"Agua!! Que Pena!!\00"
@.str.10 = [4 x i8] c" %c\00"
@.str.11 = [22 x i8] c"%s, voc\C3\AA fez: %d!! \0A\00"
@str = [30 x i8] c"deseja continuar sim=s n\C3\A3o=n\00"
define i32 @main() {
%1 = alloca [5 x [5 x i8]]
%2 = alloca [20 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %12
12: ; preds = %88, %0
%13 = phi i32 [ 0, %0 ], [ %58, %88 ]
store i32 0, i32* %4
br label %14
14: ; preds = %12, %32
%15 = phi i32 [ 0, %12 ], [ %35, %32 ]
store i32 0, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 %16, i64 0
store i8 42, i8* %17
%18 = call i32 @putchar(i32 42)
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
%21 = icmp slt i32 %19, 4
br i1 %21, label %22, label %32
22: ; preds = %14, %22
%23 = phi i32 [ %30, %22 ], [ %20, %14 ]
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = sext i32 %23 to i64
%27 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 %25, i64 %26
store i8 42, i8* %27
%28 = call i32 @putchar(i32 42)
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = icmp slt i32 %29, 4
br i1 %31, label %22, label %32
32: ; preds = %22, %14
%33 = call i32 @putchar(i32 10)
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
%36 = icmp slt i32 %34, 4
br i1 %36, label %14, label %37
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* @__const.main.batalha, i64 0, i64 %43, i64 %45
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 1
br i1 %48, label %49, label %53
49: ; preds = %37
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%51 = add nsw i32 %13, 1
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %51)
br label %56
53: ; preds = %37
%54 = call i32 @putchar(i32 10)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %56
56: ; preds = %53, %49
%57 = phi i8 [ 88, %49 ], [ 48, %53 ]
%58 = phi i32 [ %51, %49 ], [ %13, %53 ]
%59 = call i32 @putchar(i32 10)
%60 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 %43, i64 %45
store i8 %57, i8* %60
store i32 0, i32* %4
br label %61
61: ; preds = %56, %83
%62 = phi i32 [ 0, %56 ], [ %86, %83 ]
store i32 0, i32* %5
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 %63, i64 0
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = call i32 @putchar(i32 %66)
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 1
store i32 %69, i32* %5
%70 = icmp slt i32 %68, 4
br i1 %70, label %71, label %83
71: ; preds = %61, %71
%72 = phi i32 [ %81, %71 ], [ %69, %61 ]
%73 = load i32, i32* %4
%74 = sext i32 %73 to i64
%75 = sext i32 %72 to i64
%76 = getelementptr inbounds [5 x [5 x i8]], [5 x [5 x i8]]* %1, i64 0, i64 %74, i64 %75
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = call i32 @putchar(i32 %78)
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
%82 = icmp slt i32 %80, 4
br i1 %82, label %71, label %83
83: ; preds = %71, %61
%84 = call i32 @putchar(i32 10)
%85 = load i32, i32* %4
%86 = add nsw i32 %85, 1
store i32 %86, i32* %4
%87 = icmp slt i32 %85, 4
br i1 %87, label %61, label %88
88: ; preds = %83
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%90 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %3)
%91 = load i8, i8* %3
switch i8 %91, label %94 [
i8 110, label %92
i8 115, label %12
]
92: ; preds = %88
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* %7, i32 %58)
br label %94
94: ; preds = %88, %92
ret i32 0
}