#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*/ agregarEmpleado();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ imprimirEmpleados();
int /*<<< orphan*/ predecirCredito();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  while (1) {
    int option = 4;
    printf("ESCOGA UNA OPCION:\n");
    printf("1)Mostrar datos\n");
    printf("2)Agregar empleado nuevo\n");
    printf("3)Predecir el credito para empleado nuevo\n");
    printf("4)salir\n");
    scanf("%d", &option);
    switch (option) {
    case 1:
      imprimirEmpleados();
      continue;
    case 2:
      agregarEmpleado();
      continue;
    case 3:
      predecirCredito();
      continue;
    case 4:
      exit(0);
    default:
      continue;
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     121d <main+0xbd>
mov    -0x20(%rbp),%rax
lea    0xe17(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <imprimirEmpleados@plt>
jmp    1176 <main+0x16>
mov    $0x0,%al
call   1070 <agregarEmpleado@plt>
jmp    1176 <main+0x16>
mov    $0x0,%al
call   1040 <predecirCredito@plt>
jmp    1176 <main+0x16>
xor    %edi,%edi
call   1080 <exit@plt>
jmp    1176 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xec4(%rip),%r12
lea    0xed6(%rip),%r13
lea    0xef9(%rip),%rbx
lea    0xe89(%rip),%rbp
lea    0x4(%rsp),%r14
lea    0xe6d(%rip),%r15
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <predecirCredito@plt>
movl   $0x4,0x4(%rsp)
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11a7 <main+0x47>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <imprimirEmpleados@plt>
jmp    11a7 <main+0x47>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <agregarEmpleado@plt>
jmp    11a7 <main+0x47>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"ESCOGA UNA OPCION:\0A\00"
@.str.1 = [17 x i8] c"1)Mostrar datos\0A\00"
@.str.2 = [26 x i8] c"2)Agregar empleado nuevo\0A\00"
@.str.3 = [43 x i8] c"3)Predecir el credito para empleado nuevo\0A\00"
@.str.4 = [9 x i8] c"4)salir\0A\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %15, %17, %19, %23
store i32 4, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%14 = load i32, i32* %6
switch i32 %14, label %23 [
i32 1, label %15
i32 2, label %17
i32 3, label %19
i32 4, label %21
]
15: ; preds = %7
%16 = call i32 (...) @imprimirEmpleados()
br label %7
17: ; preds = %7
%18 = call i32 (...) @agregarEmpleado()
br label %7
19: ; preds = %7
%20 = call i32 (...) @predecirCredito()
br label %7
21: ; preds = %7
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %7
br label %7
}

LLVM IR (-O2):
@.str.5 = [3 x i8] c"%d\00"
@str = [19 x i8] c"ESCOGA UNA OPCION:\00"
@str.6 = [16 x i8] c"1)Mostrar datos\00"
@str.7 = [25 x i8] c"2)Agregar empleado nuevo\00"
@str.8 = [42 x i8] c"3)Predecir el credito para empleado nuevo\00"
@str.9 = [8 x i8] c"4)salir\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %2, %21
store i32 4, i32* %3
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.8, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
switch i32 %12, label %21 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
]
13: ; preds = %5
%14 = call i32 (...) @imprimirEmpleados()
br label %21
15: ; preds = %5
%16 = call i32 (...) @agregarEmpleado()
br label %21
17: ; preds = %5
%18 = call i32 (...) @predecirCredito()
br label %21
19: ; preds = %5
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %5, %17, %15, %13
br label %5
}