#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*/ auto_MK_engine(int);
int /*<<< orphan*/ manual_MK_engine(int);
int /*<<< orphan*/ nome_decorado();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void modos_jogo(int modo) {
  int opcao = 0, retorno;
  do {
    system("clear");
    nome_decorado();
    printf("%c Digite o n%cmero da op%c%co correspondente ao tamanho do "
           "tabuleiro:\n\n",
           16, 163, 135, 198);
    printf("  1 %c 4x4\n", 175);
    printf("  2 %c 6x6\n", 175);
    printf("  3 %c 8x8\n", 175);
    printf("  4 %c 10x10\n\n > ", 175);
    scanf("%d", &opcao);
  } while (opcao != 1 && opcao != 2 && opcao != 3 && opcao != 4);
  if (modo == 1) {
    retorno = (2 * opcao + 2);
    auto_MK_engine(retorno);
  } else {
    retorno = (2 * opcao + 2);
    manual_MK_engine(retorno);
  }
}


x86 assembly (clang, -O0):
<modos_jogo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe87(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1030 <nome_decorado@plt>
lea    0xe7a(%rip),%rdi
mov    $0x10,%esi
mov    $0xa3,%edx
mov    $0x87,%ecx
mov    $0xc6,%r8d
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0xaf,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0xaf,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0xaf,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0xaf,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     123b <modos_jogo+0xdb>
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     123b <modos_jogo+0xdb>
xor    %eax,%eax
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     123b <modos_jogo+0xdb>
cmpl   $0x4,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1172 <modos_jogo+0x12>
cmpl   $0x1,-0x4(%rbp)
jne    1269 <modos_jogo+0x109>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1080 <auto_MK_engine@plt>
jmp    127d <modos_jogo+0x11d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <manual_MK_engine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modos_jogo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xed2(%rip),%r13
lea    0xed7(%rip),%rbp
lea    0xedc(%rip),%rbx
lea    0xee1(%rip),%r14
lea    0xeec(%rip),%r15
mov    %rsp,%r12
nopl   0x0(%rax)
lea    0xe59(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
call   1030 <nome_decorado@plt>
lea    0xe4c(%rip),%rdi
mov    $0x10,%esi
mov    $0xa3,%edx
mov    $0x87,%ecx
mov    $0xc6,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    $0xaf,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    $0xaf,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    $0xaf,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    $0xaf,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
lea    -0x5(%rax),%ecx
cmp    $0xfffffffc,%ecx
jb     11a0 <modos_jogo+0x40>
lea    (%rax,%rax,1),%edi
add    $0x2,%edi
cmpl   $0x1,0x4(%rsp)
jne    1240 <modos_jogo+0xe0>
call   1080 <auto_MK_engine@plt>
jmp    1245 <modos_jogo+0xe5>
call   1040 <manual_MK_engine@plt>
add    $0x8,%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 = [73 x i8] c"%c Digite o n%cmero da op%c%co correspondente ao tamanho do tabuleiro:\0A\0A\00"
@.str.2 = [12 x i8] c" 1 %c 4x4\0A\00"
@.str.3 = [12 x i8] c" 2 %c 6x6\0A\00"
@.str.4 = [12 x i8] c" 3 %c 8x8\0A\00"
@.str.5 = [18 x i8] c" 4 %c 10x10\0A\0A > \00"
@.str.6 = [3 x i8] c"%d\00"
define void @modos_jogo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @nome_decorado()
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 16, i32 163, i32 135, i32 198)
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 175)
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 175)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 175)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 175)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
br label %14
14: ; preds = %5
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 3
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp ne i32 %24, 4
br label %26
26: ; preds = %23, %20, %17, %14
%27 = phi i1 [ false, %20 ], [ false, %17 ], [ false, %14 ], [ %25, %23 ]
br i1 %27, label %5, label %28
28: ; preds = %26
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* %3
%33 = mul nsw i32 2, %32
%34 = add nsw i32 %33, 2
store i32 %34, i32* %4
%35 = load i32, i32* %4
%36 = call i32 @auto_MK_engine(i32 %35)
br label %43
37: ; preds = %28
%38 = load i32, i32* %3
%39 = mul nsw i32 2, %38
%40 = add nsw i32 %39, 2
store i32 %40, i32* %4
%41 = load i32, i32* %4
%42 = call i32 @manual_MK_engine(i32 %41)
br label %43
43: ; preds = %37, %31
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [73 x i8] c"%c Digite o n%cmero da op%c%co correspondente ao tamanho do tabuleiro:\0A\0A\00"
@.str.2 = [12 x i8] c" 1 %c 4x4\0A\00"
@.str.3 = [12 x i8] c" 2 %c 6x6\0A\00"
@.str.4 = [12 x i8] c" 3 %c 8x8\0A\00"
@.str.5 = [18 x i8] c" 4 %c 10x10\0A\0A > \00"
@.str.6 = [3 x i8] c"%d\00"
define void @modos_jogo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @nome_decorado()
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 16, i32 163, i32 135, i32 198)
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 175)
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 175)
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 175)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 175)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = add i32 %13, -5
%15 = icmp ult i32 %14, -4
br i1 %15, label %4, label %16
16: ; preds = %4
%17 = icmp eq i32 %0, 1
%18 = shl nuw nsw i32 %13, 1
%19 = add nuw nsw i32 %18, 2
br i1 %17, label %20, label %22
20: ; preds = %16
%21 = call i32 @auto_MK_engine(i32 %19)
br label %24
22: ; preds = %16
%23 = call i32 @manual_MK_engine(i32 %19)
br label %24
24: ; preds = %22, %20
ret void
}