#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*/ dama(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i, j;
  int m[8][8];
  printf("preencha tabuleiro \n");
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      scanf("%d", &m[i][j]);
    }
  }
  dama(m);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11c1 <main+0x91>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    11ae <main+0x7e>
movslq -0x14(%rbp),%rax
lea    -0x120(%rbp),%rsi
shl    $0x5,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7a(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <main+0x3d>
jmp    11b3 <main+0x83>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <main+0x2c>
lea    -0x120(%rbp),%rdi
call   1040 <dama@plt>
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
lea    0xea1(%rip),%r14
nop
lea    (%rsp,%rbx,1),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x4,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x8,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0xc,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x14,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x18,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x1c,%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
add    $0x20,%rbx
cmp    $0x100,%rbx
jne    1160 <main+0x20>
mov    %rsp,%rdi
call   1050 <dama@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"preencha tabuleiro \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [8 x [8 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %10
10: ; preds = %29, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %32
13: ; preds = %10
store i32 0, i32* %7
br label %14
14: ; preds = %25, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 8
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %8, i64 0, i64 %19
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %14
28: ; preds = %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %10
32: ; preds = %10
%33 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %8, i64 0, i64 0
%34 = bitcast [8 x i32]* %33 to i32**
%35 = call i32 @dama(i32** %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [20 x i8] c"preencha tabuleiro \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x [8 x i32]]
%4 = bitcast [8 x [8 x i32]]* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %6
%7 = phi i64 [ 0, %2 ], [ %24, %6 ]
%8 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 3
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 5
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 6
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %7, i64 7
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = add nuw nsw i64 %7, 1
%25 = icmp eq i64 %24, 8
br i1 %25, label %26, label %6
26: ; preds = %6
%27 = bitcast [8 x [8 x i32]]* %3 to i32**
%28 = call i32 @dama(i32** %27)
%29 = call i32 @putchar(i32 10)
ret i32 0
}