#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*/ capturarDatos();
int /*<<< orphan*/ consultarEditorial();
int /*<<< orphan*/ consultarLibros();
int /*<<< orphan*/ consultarTitulo();
int /*<<< orphan*/ eliminarLibro();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void opciones() {
  int opcion;
  do {
    printf("\n\nBIBLIOTECA TEC\n");
    printf("1) Capturar datos\n");
    printf("2) Consultar Libros\n");
    printf("3) Consultar Editorial\n");
    printf("4) Consultar Titulo\n");
    printf("5) Eliminar Libro por Titulo\n");
    printf("7) Exit\n");
    printf("Opcion = ");
    scanf("%d", &opcion);
    if (opcion == 1) {
      capturarDatos();
    }
    if (opcion == 2) {
      consultarLibros();
    }
    if (opcion == 3) {
      consultarEditorial();
    }
    if (opcion == 4) {
      consultarTitulo();
    }
    if (opcion == 5) {
      eliminarLibro();
    }
  } while (opcion != 7);
}


x86 assembly (clang, -O0):
<opciones>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    11f9 <opciones+0x89>
mov    $0x0,%al
call   1050 <capturarDatos@plt>
cmpl   $0x2,-0x4(%rbp)
jne    120a <opciones+0x9a>
mov    $0x0,%al
call   1090 <consultarLibros@plt>
cmpl   $0x3,-0x4(%rbp)
jne    121b <opciones+0xab>
mov    $0x0,%al
call   1030 <consultarEditorial@plt>
cmpl   $0x4,-0x4(%rbp)
jne    122c <opciones+0xbc>
mov    $0x0,%al
call   1080 <consultarTitulo@plt>
cmpl   $0x5,-0x4(%rbp)
jne    123d <opciones+0xcd>
mov    $0x0,%al
call   1060 <eliminarLibro@plt>
jmp    1242 <opciones+0xd2>
cmpl   $0x7,-0x4(%rbp)
jne    1178 <opciones+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opciones>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xec9(%rip),%rbx
lea    0xed6(%rip),%rbp
lea    0xeec(%rip),%r14
lea    0xe59(%rip),%r15
lea    0xe5c(%rip),%r12
lea    0x4(%rsp),%r13
jmp    11c9 <opciones+0x49>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x7,%eax
je     12a4 <opciones+0x124>
lea    0xe3d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1250 <opciones+0xd0>
cmp    $0x2,%eax
je     1260 <opciones+0xe0>
cmp    $0x3,%eax
je     1270 <opciones+0xf0>
cmp    $0x4,%eax
je     1280 <opciones+0x100>
cmp    $0x5,%eax
jne    11c0 <opciones+0x40>
jmp    1294 <opciones+0x114>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <capturarDatos@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jne    1232 <opciones+0xb2>
xor    %eax,%eax
call   10a0 <consultarLibros@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
jne    1237 <opciones+0xb7>
xor    %eax,%eax
call   1030 <consultarEditorial@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jne    123c <opciones+0xbc>
xor    %eax,%eax
call   1090 <consultarTitulo@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
jne    11c0 <opciones+0x40>
xor    %eax,%eax
call   1070 <eliminarLibro@plt>
mov    0x4(%rsp),%eax
jmp    11c0 <opciones+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0A\0ABIBLIOTECA TEC\0A\00"
@.str.1 = [19 x i8] c"1) Capturar datos\0A\00"
@.str.2 = [21 x i8] c"2) Consultar Libros\0A\00"
@.str.3 = [24 x i8] c"3) Consultar Editorial\0A\00"
@.str.4 = [21 x i8] c"4) Consultar Titulo\0A\00"
@.str.5 = [30 x i8] c"5) Eliminar Libro por Titulo\0A\00"
@.str.6 = [9 x i8] c"7) Exit\0A\00"
@.str.7 = [10 x i8] c"Opcion = \00"
@.str.8 = [3 x i8] c"%d\00"
define void @opciones() {
%1 = alloca i32
br label %2
2: ; preds = %37, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 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 = load i32, i32* %1
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (...) @capturarDatos()
br label %16
16: ; preds = %14, %2
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @consultarLibros()
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (...) @consultarEditorial()
br label %26
26: ; preds = %24, %21
%27 = load i32, i32* %1
%28 = icmp eq i32 %27, 4
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @consultarTitulo()
br label %31
31: ; preds = %29, %26
%32 = load i32, i32* %1
%33 = icmp eq i32 %32, 5
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 (...) @eliminarLibro()
br label %36
36: ; preds = %34, %31
br label %37
37: ; preds = %36
%38 = load i32, i32* %1
%39 = icmp ne i32 %38, 7
br i1 %39, label %2, label %40
40: ; preds = %37
ret void
}

LLVM IR (-O2):
@.str.7 = [10 x i8] c"Opcion = \00"
@.str.8 = [3 x i8] c"%d\00"
@str = [17 x i8] c"\0A\0ABIBLIOTECA TEC\00"
@str.9 = [18 x i8] c"1) Capturar datos\00"
@str.10 = [20 x i8] c"2) Consultar Libros\00"
@str.11 = [23 x i8] c"3) Consultar Editorial\00"
@str.12 = [20 x i8] c"4) Consultar Titulo\00"
@str.13 = [29 x i8] c"5) Eliminar Libro por Titulo\00"
@str.14 = [8 x i8] c"7) Exit\00"
define void @opciones() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %42, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.11, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.13, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.14, i64 0, i64 0))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 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 = load i32, i32* %1
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 (...) @capturarDatos()
%17 = load i32, i32* %1
br label %18
18: ; preds = %15, %3
%19 = phi i32 [ %17, %15 ], [ %13, %3 ]
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 (...) @consultarLibros()
%23 = load i32, i32* %1
br label %24
24: ; preds = %21, %18
%25 = phi i32 [ %23, %21 ], [ %19, %18 ]
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (...) @consultarEditorial()
%29 = load i32, i32* %1
br label %30
30: ; preds = %27, %24
%31 = phi i32 [ %29, %27 ], [ %25, %24 ]
%32 = icmp eq i32 %31, 4
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 (...) @consultarTitulo()
%35 = load i32, i32* %1
br label %36
36: ; preds = %33, %30
%37 = phi i32 [ %35, %33 ], [ %31, %30 ]
%38 = icmp eq i32 %37, 5
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (...) @eliminarLibro()
%41 = load i32, i32* %1
br label %42
42: ; preds = %36, %39
%43 = phi i32 [ %37, %36 ], [ %41, %39 ]
%44 = icmp eq i32 %43, 7
br i1 %44, label %45, label %3
45: ; preds = %42
ret void
}