#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*/ configure();
int /*<<< orphan*/ initialSetup();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ start();
int main() {
  initialSetup();
  int op = 0;
  while (op != 3) {
    printf("\033[2J");
    printf("###################################################################"
           "##########\n");
    printf("#                                  Velha                           "
           "         #\n");
    printf("#                                                                  "
           "         #\n");
    printf("#                              1) Start                            "
           "         #\n");
    printf("#                                                                  "
           "         #\n");
    printf("#                              2) Configure                        "
           "         #\n");
    printf("#                                                                  "
           "         #\n");
    printf("#                              3) Exit                             "
           "         #\n");
    printf("#                                                                  "
           "         #\n");
    printf("###################################################################"
           "##########\n");
    printf("\n\n///> ");
    scanf("%d", &op);
    if (op == 1) {
      start();
    } else if (op == 2) {
      configure();
    }
  }
  printf("\033[2J");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initialSetup@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1248 <main+0xf8>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfdd(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    122d <main+0xdd>
mov    $0x0,%al
call   1040 <start@plt>
jmp    1243 <main+0xf3>
cmpl   $0x2,-0x8(%rbp)
jne    123e <main+0xee>
mov    $0x0,%al
call   1050 <configure@plt>
jmp    1243 <main+0xf3>
jmp    116d <main+0x1d>
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1080 <initialSetup@plt>
movl   $0x0,0x4(%rsp)
lea    0x1015(%rip),%r12
lea    0xfc0(%rip),%rbx
lea    0xf6b(%rip),%r14
lea    0xe6f(%rip),%r15
lea    0xe70(%rip),%r13
lea    0x4(%rsp),%rbp
jmp    11c4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <configure@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     1261 <main+0x101>
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     11b0 <main+0x50>
cmp    $0x1,%eax
jne    11bb <main+0x5b>
xor    %eax,%eax
call   1050 <start@plt>
jmp    11b7 <main+0x57>
lea    0xd98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [79 x i8] c"#############################################################################\0A\00"
@.str.2 = [79 x i8] c"# Velha #\0A\00"
@.str.3 = [79 x i8] c"# #\0A\00"
@.str.4 = [79 x i8] c"# 1) Start #\0A\00"
@.str.5 = [79 x i8] c"# 2) Configure #\0A\00"
@.str.6 = [79 x i8] c"# 3) Exit #\0A\00"
@.str.7 = [8 x i8] c"\0A\0A///> \00"
@.str.8 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialSetup()
store i32 0, i32* %2
br label %4
4: ; preds = %31, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 3
br i1 %6, label %7, label %32
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %7
%24 = call i32 (...) @start()
br label %31
25: ; preds = %7
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 2
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @configure()
br label %30
30: ; preds = %28, %25
br label %31
31: ; preds = %30, %23
br label %4
32: ; preds = %4
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.7 = [8 x i8] c"\0A\0A///> \00"
@.str.8 = [3 x i8] c"%d\00"
@str.9 = [78 x i8] c"# Velha #\00"
@str.11 = [78 x i8] c"# 1) Start #\00"
@str.13 = [78 x i8] c"# 2) Configure #\00"
@str.15 = [78 x i8] c"# 3) Exit #\00"
@str.16 = [78 x i8] c"# #\00"
@str.17 = [78 x i8] c"#############################################################################\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (...) @initialSetup()
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %4
4: ; preds = %0, %25
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.17, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.9, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.16, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.11, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.16, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.13, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.16, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.15, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.16, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.17, i64 0, i64 0))
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
switch i32 %18, label %25 [
i32 1, label %19
i32 2, label %21
]
19: ; preds = %4
%20 = call i32 (...) @start()
br label %23
21: ; preds = %4
%22 = call i32 (...) @configure()
br label %23
23: ; preds = %19, %21
%24 = load i32, i32* %1
br label %25
25: ; preds = %23, %4
%26 = phi i32 [ %24, %23 ], [ %18, %4 ]
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %4
28: ; preds = %25
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}