#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*/ creditos();
int /*<<< orphan*/ instrucoes();
int /*<<< orphan*/ play();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void inicio(void) {
  int opcao;
  printf("\n\n\t\t\tJOGO DA VELHA");
  printf("\n\t\t\t\t    by Maik Basso");
  printf("\n\n\nOpcoes: 1- Play | 2- Instrucoes | 3- Creditos | Outro valor- "
         "Finalizar Programa\n");
  printf("Digite a sua opcao: ");
  scanf("%d", &opcao);
  if (opcao == 1) {
    system("cls");
    play();
  }
  if (opcao == 2) {
    system("cls");
    instrucoes();
  }
  if (opcao == 3) {
    system("cls");
    creditos();
  }
}


x86 assembly (clang, -O0):
<inicio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    11c5 <inicio+0x65>
lea    0xedd(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <play@plt>
cmpl   $0x2,-0x4(%rbp)
jne    11e2 <inicio+0x82>
lea    0xec0(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1080 <instrucoes@plt>
cmpl   $0x3,-0x4(%rbp)
jne    11ff <inicio+0x9f>
lea    0xea3(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1060 <creditos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicio>:
push   %rax
lea    0xe88(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe97(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     11c7 <inicio+0x57>
cmp    $0x2,%eax
je     11e3 <inicio+0x73>
cmp    $0x3,%eax
je     11ff <inicio+0x8f>
pop    %rax
ret
lea    0xe74(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1060 <play@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jne    11c0 <inicio+0x50>
lea    0xe58(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1090 <instrucoes@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
jne    11c5 <inicio+0x55>
lea    0xe3c(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1070 <creditos@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0A\0A\09\09\09JOGO DA VELHA\00"
@.str.1 = [23 x i8] c"\0A\09\09\09\09 by Maik Basso\00"
@.str.2 = [84 x i8] c"\0A\0A\0AOpcoes: 1- Play | 2- Instrucoes | 3- Creditos | Outro valor- Finalizar Programa\0A\00"
@.str.3 = [21 x i8] c"Digite a sua opcao: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"cls\00"
define void @inicio() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (...) @play()
br label %12
12: ; preds = %9, %0
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (...) @instrucoes()
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (...) @creditos()
br label %24
24: ; preds = %21, %18
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A\0A\09\09\09JOGO DA VELHA\00"
@.str.1 = [23 x i8] c"\0A\09\09\09\09 by Maik Basso\00"
@.str.3 = [21 x i8] c"Digite a sua opcao: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"cls\00"
@str = [83 x i8] c"\0A\0A\0AOpcoes: 1- Play | 2- Instrucoes | 3- Creditos | Outro valor- Finalizar Programa\00"
define void @inicio() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (...) @play()
%13 = load i32, i32* %1
br label %14
14: ; preds = %10, %0
%15 = phi i32 [ %13, %10 ], [ %8, %0 ]
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 (...) @instrucoes()
%20 = load i32, i32* %1
br label %21
21: ; preds = %17, %14
%22 = phi i32 [ %20, %17 ], [ %15, %14 ]
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = call i32 (...) @creditos()
br label %27
27: ; preds = %24, %21
ret void
}