#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*/ PLAY_engine(char **, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ system(char *);
void manual_MK_engine(int padrao_tam) {
  int i, j;
  char final[10][10];
  system("clear");
  printf("Preencha o tabuleiro:\n\n\n");
  for (i = 0; i < padrao_tam; i++) {
    for (j = 0; j < padrao_tam; j++) {
      printf("%c Digite o caractere da linha %d e da coluna %d: ", 26, i + 1,
             j + 1);
      scanf(" %c", &final[i][j]);
    }
    printf("\n");
  }
  PLAY_engine(final, padrao_tam);
}


x86 assembly (clang, -O0):
<manual_MK_engine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11f6 <manual_MK_engine+0xb6>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11da <manual_MK_engine+0x9a>
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
lea    0xe81(%rip),%rdi
mov    $0x1a,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x70(%rbp),%rsi
imul   $0xa,%rax,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    0xe8b(%rip),%rdi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <manual_MK_engine+0x3f>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <manual_MK_engine+0x2c>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <PLAY_engine@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manual_MK_engine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edi,%ebx
lea    0xe89(%rip),%rdi
call   1050 <system@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,0xc(%rsp)
test   %ebx,%ebx
jle    11f5 <manual_MK_engine+0x95>
mov    0xc(%rsp),%r14d
lea    0x10(%rsp),%r15
xor    %r13d,%r13d
nopl   (%rax)
add    $0x1,%r13
xor    %ebp,%ebp
lea    0xe8c(%rip),%r12
nopl   (%rax)
lea    0x1(%rbp),%rbx
lea    0xe4b(%rip),%rdi
mov    $0x1a,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
add    %r15,%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    %rbx,%rbp
cmp    %rbx,%r14
jne    11b0 <manual_MK_engine+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xa,%r15
cmp    %r14,%r13
jne    11a0 <manual_MK_engine+0x40>
lea    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1070 <PLAY_engine@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [25 x i8] c"Preencha o tabuleiro:\0A\0A\0A\00"
@.str.2 = [51 x i8] c"%c Digite o caractere da linha %d e da coluna %d: \00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @manual_MK_engine(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x [10 x i8]]
store i32 %0, i32* %2
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %35, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %38
12: ; preds = %8
store i32 0, i32* %4
br label %13
13: ; preds = %30, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %33
17: ; preds = %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 26, i32 %19, i32 %21)
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %25, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %17
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %13
33: ; preds = %13
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %8
38: ; preds = %8
%39 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 0
%40 = bitcast [10 x i8]* %39 to i8**
%41 = load i32, i32* %2
%42 = call i32 @PLAY_engine(i8** %40, i32 %41)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.2 = [51 x i8] c"%c Digite o caractere da linha %d e da coluna %d: \00"
@.str.3 = [4 x i8] c" %c\00"
@str = [24 x i8] c"Preencha o tabuleiro:\0A\0A\00"
define void @manual_MK_engine(i32 %0) {
%2 = alloca [10 x [10 x i8]]
%3 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 0, i64 0
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %21, %7
%10 = phi i64 [ 0, %7 ], [ %11, %21 ]
%11 = add nuw nsw i64 %10, 1
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %9, %13
%14 = phi i64 [ 0, %9 ], [ %15, %13 ]
%15 = add nuw nsw i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 26, i32 %12, i32 %16)
%18 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %10, i64 %14
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = icmp eq i64 %15, %8
br i1 %20, label %21, label %13
21: ; preds = %13
%22 = call i32 @putchar(i32 10)
%23 = icmp eq i64 %11, %8
br i1 %23, label %24, label %9
24: ; preds = %21, %1
%25 = bitcast [10 x [10 x i8]]* %2 to i8**
%26 = call i32 @PLAY_engine(i8** %25, i32 %0)
ret void
}