#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*/ inicializar();
int /*<<< orphan*/ insertar();
int /*<<< orphan*/ menu();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ visualizar();
int main(void) {
  int op;
  do {
    menu();
    scanf("%d", &op);
    switch (op) {
    case 1:
      inicializar();
      break;
    case 2:
      insertar();
      break;
    case 3:
      visualizar();
      break;
    case 4:
      break;
    case 5:
      puts("Saliendo... ");
      break;
    default:
      puts("Opcion invalida!");
      break;
    }
  } while (op != 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <menu@plt>
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11e9 <main+0x89>
mov    -0x10(%rbp),%rax
lea    0xe5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <inicializar@plt>
jmp    11f5 <main+0x95>
mov    $0x0,%al
call   1060 <insertar@plt>
jmp    11f5 <main+0x95>
mov    $0x0,%al
call   1070 <visualizar@plt>
jmp    11f5 <main+0x95>
jmp    11f5 <main+0x95>
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
jmp    11f5 <main+0x95>
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
jmp    11fa <main+0x9a>
cmpl   $0x5,-0x8(%rbp)
jne    116f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xea0(%rip),%r14
lea    0xc(%rsp),%r13
lea    0xea4(%rip),%r15
lea    0xe79(%rip),%rbx
lea    0xe89(%rip),%r12
jmp    11a1 <main+0x41>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
cmp    $0x5,%eax
je     11e8 <main+0x88>
xor    %eax,%eax
call   1040 <menu@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x4,%ecx
ja     1190 <main+0x30>
movslq (%rbx,%rcx,4),%rcx
add    %rbx,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1050 <inicializar@plt>
jmp    1198 <main+0x38>
xor    %eax,%eax
call   1060 <insertar@plt>
jmp    1198 <main+0x38>
xor    %eax,%eax
call   1070 <visualizar@plt>
jmp    1198 <main+0x38>
mov    %r12,%rdi
jmp    1193 <main+0x33>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Saliendo... \00"
@.str.2 = [17 x i8] c"Opcion invalida!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %19, %0
%4 = call i32 (...) @menu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %14
]
7: ; preds = %3
%8 = call i32 (...) @inicializar()
br label %18
9: ; preds = %3
%10 = call i32 (...) @insertar()
br label %18
11: ; preds = %3
%12 = call i32 (...) @visualizar()
br label %18
13: ; preds = %3
br label %18
14: ; preds = %3
%15 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %3
%17 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %13, %11, %9, %7
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 5
br i1 %21, label %3, label %22
22: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Saliendo... \00"
@.str.2 = [17 x i8] c"Opcion invalida!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %19, %0
%4 = call i32 (...) @menu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %19
i32 5, label %13
]
7: ; preds = %3
%8 = call i32 (...) @inicializar()
br label %17
9: ; preds = %3
%10 = call i32 (...) @insertar()
br label %17
11: ; preds = %3
%12 = call i32 (...) @visualizar()
br label %17
13: ; preds = %3
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %3
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9, %7
%18 = load i32, i32* %1
br label %19
19: ; preds = %17, %3
%20 = phi i32 [ %18, %17 ], [ %6, %3 ]
%21 = icmp eq i32 %20, 5
br i1 %21, label %22, label %3
22: ; preds = %19
ret i32 0
}