#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 mapa[5][5] = {{1, 0, 0, 0, 0},
                    {0, 1, 0, 0, 0},
                    {0, 0, 1, 0, 0},
                    {0, 0, 0, 1, 0},
                    {0, 0, 0, 0, 1}};
  int i, j, continuar = 0, pontos = 0;
  char nome[15];
  printf("Qual é seu nome?");
  scanf("%s", nome);
  do {
    for (i = 0; i <= 4; i++) {
      for (j = 0; j <= 4; j++) {
        printf(" * ");
      }
      printf("\n");
    }
    printf("\n Entre com a linha:\n");
    scanf("%d", &j);
    printf("\n Entre com a coluna:\n");
    scanf("%d", &i);
    if (mapa[i][j] == 1) {
      printf("você acertou, ganhou um ponto !!");
      pontos++;
    } else if (mapa[i][j] == 0) {
      printf("você errou !!");
    }
    printf("\n Deseja continuar(s=0/n=1)?");
    scanf(" %d", &continuar);
  } while (continuar == 0);
  printf("Olá %s, você fez %d pontos!!", nome, pontos);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movl   $0x1,-0x70(%rbp)
movl   $0x1,-0x58(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8f(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x4,-0x74(%rbp)
jg     1200 <main+0xd0>
movl   $0x0,-0x78(%rbp)
cmpl   $0x4,-0x78(%rbp)
jg     11e4 <main+0xb4>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11be <main+0x8e>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11ad <main+0x7d>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movslq -0x74(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1279 <main+0x149>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12a9 <main+0x179>
movslq -0x74(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    12a4 <main+0x174>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x179>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd6(%rip),%rdi
lea    -0x7c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x7c(%rbp)
je     11a6 <main+0x76>
lea    -0x8f(%rbp),%rsi
mov    -0x80(%rbp),%edx
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x40(%rsp)
movl   $0x1,0x20(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x1,0x50(%rsp)
movl   $0x1,0x68(%rsp)
movl   $0x1,0x80(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xe54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe58(%rip),%rdi
lea    0x11(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe48(%rip),%rbx
lea    0xe94(%rip),%r15
lea    0xe6f(%rip),%r12
lea    0xe85(%rip),%r13
lea    0xc(%rsp),%r14
xor    %ebp,%ebp
jmp    1220 <main+0xe0>
nopl   0x0(%rax,%rax,1)
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jne    12ea <main+0x1aa>
movl   $0x0,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
movl   $0x0,0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x4,%eax
jl     1240 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x4,%eax
jl     1230 <main+0xf0>
lea    0xe0f(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe09(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0x8(%rsp),%rax
movslq 0x4(%rsp),%rcx
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,4),%rax
add    $0x20,%rax
mov    (%rax,%rcx,4),%eax
test   %eax,%eax
je     11f0 <main+0xb0>
cmp    $0x1,%eax
jne    11fe <main+0xbe>
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
jmp    11fe <main+0xbe>
lea    0xd7a(%rip),%rdi
lea    0x11(%rsp),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Qual \C3\A9 seu nome?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c" * \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [22 x i8] c"\0A Entre com a linha:\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [23 x i8] c"\0A Entre com a coluna:\0A\00"
@.str.7 = [34 x i8] c"voc\C3\AA acertou, ganhou um ponto !!\00"
@.str.8 = [15 x i8] c"voc\C3\AA errou !!\00"
@.str.9 = [29 x i8] c"\0A Deseja continuar(s=0/n=1)?\00"
@.str.10 = [4 x i8] c" %d\00"
@.str.11 = [31 x i8] c"Ol\C3\A1 %s, voc\C3\AA 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 [15 x i8]
store i32 0, i32* %1
%8 = bitcast [5 x [5 x i32]]* %2 to i8*
%9 = bitcast i8* %8 to [5 x [5 x i32]]*
%10 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %9, i32 0, i32 0
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i32 0, i32 0
store i32 1, i32* %11
%12 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %9, i32 0, i32 1
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i32 0, i32 1
store i32 1, i32* %13
%14 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %9, i32 0, i32 2
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %14, i32 0, i32 2
store i32 1, i32* %15
%16 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %9, i32 0, i32 3
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %16, i32 0, i32 3
store i32 1, i32* %17
%18 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %9, i32 0, i32 4
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %18, i32 0, i32 4
store i32 1, i32* %19
store i32 0, i32* %5
store i32 0, i32* %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %73, %0
store i32 0, i32* %3
br label %24
24: ; preds = %38, %23
%25 = load i32, i32* %3
%26 = icmp sle i32 %25, 4
br i1 %26, label %27, label %41
27: ; preds = %24
store i32 0, i32* %4
br label %28
28: ; preds = %33, %27
%29 = load i32, i32* %4
%30 = icmp sle i32 %29, 4
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %28
36: ; preds = %28
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %24
41: ; preds = %24
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 %47
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %48, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = icmp eq i32 %52, 1
br i1 %53, label %54, label %58
54: ; preds = %41
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 1
store i32 %57, i32* %6
br label %70
58: ; preds = %41
%59 = load i32, i32* %3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 %60
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [5 x i32], [5 x i32]* %61, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %58
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %69
69: ; preds = %67, %58
br label %70
70: ; preds = %69, %54
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
%72 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32* %5)
br label %73
73: ; preds = %70
%74 = load i32, i32* %5
%75 = icmp eq i32 %74, 0
br i1 %75, label %23, label %76
76: ; preds = %73
%77 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%78 = load i32, i32* %6
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %77, i32 %78)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Qual \C3\A9 seu nome?\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c" * \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.7 = [34 x i8] c"voc\C3\AA acertou, ganhou um ponto !!\00"
@.str.8 = [15 x i8] c"voc\C3\AA errou !!\00"
@.str.9 = [29 x i8] c"\0A Deseja continuar(s=0/n=1)?\00"
@.str.10 = [4 x i8] c" %d\00"
@.str.11 = [31 x i8] c"Ol\C3\A1 %s, voc\C3\AA fez %d pontos!!\00"
@str = [21 x i8] c"\0A Entre com a linha:\00"
@str.12 = [22 x i8] c"\0A Entre com a coluna:\00"
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [15 x i8]
%6 = bitcast [5 x [5 x i32]]* %1 to i8*
%7 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 1, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 2, i64 2
store i32 1, i32* %9
%10 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 3, i64 3
store i32 1, i32* %10
%11 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 4, i64 4
store i32 1, i32* %11
%12 = bitcast i32* %2 to i8*
%13 = bitcast i32* %3 to i8*
%14 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %18
18: ; preds = %47, %0
%19 = phi i32 [ 0, %0 ], [ %48, %47 ]
store i32 0, i32* %2
br label %20
20: ; preds = %18, %26
store i32 0, i32* %3
br label %21
21: ; preds = %20, %21
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = icmp slt i32 %23, 4
br i1 %25, label %21, label %26
26: ; preds = %21
%27 = call i32 @putchar(i32 10)
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
%30 = icmp slt i32 %28, 4
br i1 %30, label %20, label %31
31: ; preds = %26
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.12, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%36 = load i32, i32* %2
%37 = sext i32 %36 to i64
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 %37, i64 %39
%41 = load i32, i32* %40
switch i32 %41, label %47 [
i32 1, label %42
i32 0, label %45
]
42: ; preds = %31
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%44 = add nsw i32 %19, 1
br label %47
45: ; preds = %31
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %47
47: ; preds = %31, %45, %42
%48 = phi i32 [ %44, %42 ], [ %19, %45 ], [ %19, %31 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32* %4)
%51 = load i32, i32* %4
%52 = icmp eq i32 %51, 0
br i1 %52, label %18, label %53
53: ; preds = %47
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %15, i32 %48)
ret i32 0
}