#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*/ eliminar(int);
int /*<<< orphan*/ eliminarGenero();
int /*<<< orphan*/ eliminarGenerosPelicula();
int /*<<< orphan*/ eliminarRelacion();
int /*<<< orphan*/ eliminarRelacionesPelicula();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void menuEliminar(void) {
  int op;
  while (1) {
    printf("1-Eliminar pelicula\n");
    printf("2-Eliminar persona\n");
    printf("3-Eliminar personaje\n");
    printf("4-Eliminar relacion\n");
    printf("5-Eliminar genero\n");
    printf("6-Eliminar todas las relaciones de una pelicula\n");
    printf("7-Eliminar todos los generos de una pelicula\n");
    printf("0-Volver\n\nOpcion: ");
    scanf("%d", &op);
    system("clear");
    switch (op) {
    case 1:
    case 2:
    case 3:
      eliminar(op);
      break;
    case 4:
      eliminarRelacion();
      break;
    case 5:
      eliminarGenero();
      break;
    case 6:
      eliminarRelacionesPelicula();
      break;
    case 7:
      eliminarGenerosPelicula();
      break;
    case 0:
      return;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<menuEliminar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xefd(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     126c <menuEliminar+0xec>
mov    -0x10(%rbp),%rax
lea    0xde0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edi
call   10a0 <eliminar@plt>
jmp    126c <menuEliminar+0xec>
mov    $0x0,%al
call   1060 <eliminarRelacion@plt>
jmp    126c <menuEliminar+0xec>
mov    $0x0,%al
call   1090 <eliminarGenero@plt>
jmp    126c <menuEliminar+0xec>
mov    $0x0,%al
call   1080 <eliminarRelacionesPelicula@plt>
jmp    126c <menuEliminar+0xec>
mov    $0x0,%al
call   1050 <eliminarGenerosPelicula@plt>
jmp    126c <menuEliminar+0xec>
add    $0x10,%rsp
pop    %rbp
ret
jmp    1188 <menuEliminar+0x8>

x86 assembly (clang, -O2):
<menuEliminar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf2c(%rip),%r14
lea    0xe77(%rip),%r15
lea    0xe83(%rip),%r12
lea    0x4(%rsp),%r13
lea    0xe7a(%rip),%rbx
lea    0xe3d(%rip),%rbp
jmp    11d0 <menuEliminar+0x40>
xor    %eax,%eax
call   1060 <eliminarGenerosPelicula@plt>
nopl   0x0(%rax)
lea    0xe65(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    0x4(%rsp),%edi
cmp    $0x7,%rdi
ja     11d0 <menuEliminar+0x40>
movslq 0x0(%rbp,%rdi,4),%rax
add    %rbp,%rax
jmp    *%rax
call   10b0 <eliminar@plt>
jmp    11d0 <menuEliminar+0x40>
xor    %eax,%eax
call   1070 <eliminarRelacion@plt>
jmp    11d0 <menuEliminar+0x40>
xor    %eax,%eax
call   10a0 <eliminarGenero@plt>
jmp    11d0 <menuEliminar+0x40>
xor    %eax,%eax
call   1090 <eliminarRelacionesPelicula@plt>
jmp    11d0 <menuEliminar+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"1-Eliminar pelicula\0A\00"
@.str.1 = [20 x i8] c"2-Eliminar persona\0A\00"
@.str.2 = [22 x i8] c"3-Eliminar personaje\0A\00"
@.str.3 = [21 x i8] c"4-Eliminar relacion\0A\00"
@.str.4 = [19 x i8] c"5-Eliminar genero\0A\00"
@.str.5 = [49 x i8] c"6-Eliminar todas las relaciones de una pelicula\0A\00"
@.str.6 = [46 x i8] c"7-Eliminar todos los generos de una pelicula\0A\00"
@.str.7 = [19 x i8] c"0-Volver\0A\0AOpcion: \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [6 x i8] c"clear\00"
define void @menuEliminar() {
%1 = alloca i32
br label %2
2: ; preds = %0, %26
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%13 = load i32, i32* %1
switch i32 %13, label %26 [
i32 1, label %14
i32 2, label %14
i32 3, label %14
i32 4, label %17
i32 5, label %19
i32 6, label %21
i32 7, label %23
i32 0, label %25
]
14: ; preds = %2, %2, %2
%15 = load i32, i32* %1
%16 = call i32 @eliminar(i32 %15)
br label %26
17: ; preds = %2
%18 = call i32 (...) @eliminarRelacion()
br label %26
19: ; preds = %2
%20 = call i32 (...) @eliminarGenero()
br label %26
21: ; preds = %2
%22 = call i32 (...) @eliminarRelacionesPelicula()
br label %26
23: ; preds = %2
%24 = call i32 (...) @eliminarGenerosPelicula()
br label %26
25: ; preds = %2
ret void
26: ; preds = %2, %23, %21, %19, %17, %14
br label %2
}

LLVM IR (-O2):
@.str.7 = [19 x i8] c"0-Volver\0A\0AOpcion: \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [6 x i8] c"clear\00"
@str = [20 x i8] c"1-Eliminar pelicula\00"
@str.10 = [19 x i8] c"2-Eliminar persona\00"
@str.11 = [21 x i8] c"3-Eliminar personaje\00"
@str.12 = [20 x i8] c"4-Eliminar relacion\00"
@str.13 = [18 x i8] c"5-Eliminar genero\00"
@str.14 = [48 x i8] c"6-Eliminar todas las relaciones de una pelicula\00"
@str.15 = [45 x i8] c"7-Eliminar todos los generos de una pelicula\00"
define void @menuEliminar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %15, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.11, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.14, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.15, i64 0, i64 0))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%14 = load i32, i32* %1
switch i32 %14, label %15 [
i32 1, label %16
i32 2, label %16
i32 3, label %16
i32 4, label %18
i32 5, label %20
i32 6, label %22
i32 7, label %24
i32 0, label %26
]
15: ; preds = %3, %24, %22, %20, %18, %16
br label %3
16: ; preds = %3, %3, %3
%17 = call i32 @eliminar(i32 %14)
br label %15
18: ; preds = %3
%19 = call i32 (...) @eliminarRelacion()
br label %15
20: ; preds = %3
%21 = call i32 (...) @eliminarGenero()
br label %15
22: ; preds = %3
%23 = call i32 (...) @eliminarRelacionesPelicula()
br label %15
24: ; preds = %3
%25 = call i32 (...) @eliminarGenerosPelicula()
br label %15
26: ; preds = %3
ret void
}