#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 Tiro(int matriz[6][8]) {
  int i, j;
  printf("\nDigite a linha que deseja atirar: ");
  scanf("%d", &i);
  printf("\nDigite a coluna que deseja atirar: ");
  scanf("%d", &j);
  if (matriz[i][j] != 0) {
    if (matriz[i][j] = 4) {
      return 4;
    } else {
      return 2;
    }
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Tiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11c2 <Tiro+0xa2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x4,(%rax,%rcx,4)
mov    $0x1,%al
test   $0x1,%al
jne    11aa <Tiro+0x8a>
jmp    11b6 <Tiro+0x96>
movl   $0x4,-0x4(%rbp)
jmp    11c9 <Tiro+0xa9>
movl   $0x2,-0x4(%rbp)
jmp    11c9 <Tiro+0xa9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tiro>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
movslq (%rsp),%rcx
shl    $0x5,%rax
add    %r14,%rax
cmpl   $0x0,(%rax,%rcx,4)
je     1185 <Tiro+0x65>
lea    (%rax,%rcx,4),%rax
movl   $0x4,(%rax)
mov    $0x4,%eax
jmp    1187 <Tiro+0x67>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0ADigite a linha que deseja atirar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0ADigite a coluna que deseja atirar: \00"
define i32 @Tiro([8 x i32]* %0) {
%2 = alloca i32
%3 = alloca [8 x i32]*
%4 = alloca i32
%5 = alloca i32
store [8 x i32]* %0, [8 x i32]** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%10 = load [8 x i32]*, [8 x i32]** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 %12
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %1
%20 = load [8 x i32]*, [8 x i32]** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 %22
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 %25
store i32 4, i32* %26
br i1 true, label %27, label %28
27: ; preds = %19
store i32 4, i32* %2
br label %30
28: ; preds = %19
store i32 2, i32* %2
br label %30
29: ; preds = %1
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28, %27
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0ADigite a linha que deseja atirar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0ADigite a coluna que deseja atirar: \00"
define i32 @Tiro([8 x i32]* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %1
store i32 4, i32* %14
br label %18
18: ; preds = %1, %17
%19 = phi i32 [ 4, %17 ], [ 0, %1 ]
ret i32 %19
}