#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*/ Categorias_end();
int /*<<< orphan*/ Categorias_init();
int /*<<< orphan*/ Consultas_end();
int /*<<< orphan*/ Consultas_init();
int /*<<< orphan*/ Cotizaciones_end();
int /*<<< orphan*/ Cotizaciones_init();
int /*<<< orphan*/ Servicios_end();
int /*<<< orphan*/ Servicios_init();
int /*<<< orphan*/ Usuarios_end();
int /*<<< orphan*/ Usuarios_init();
int /*<<< orphan*/ conectarse();
int /*<<< orphan*/ crear_usuario(unsigned char);
int /*<<< orphan*/ printf(char *);
char read_opt();
int main(int argc, char *argv[]) {
  Usuarios_init();
  Servicios_init();
  Consultas_init();
  Cotizaciones_init();
  Categorias_init();
  printf(" Paginas Doradas ** \n");
  while (1) {
    printf("Que desea hacer?\n");
    printf("1 - Conectarse\n");
    printf("2 - Crear usuario\n");
    printf("s - Salir\n");
    printf("Seleccione opcion\n");
    char opt = read_opt();
    if (opt == 's')
      break;
    switch (opt) {
    case '1':
      conectarse();
      break;
    case '2':
      crear_usuario('u');
      break;
    default:
      break;
    }
  }
  Usuarios_end();
  Servicios_end();
  Consultas_end();
  Cotizaciones_end();
  Categorias_end();
}


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)
mov    $0x0,%al
call   1060 <Usuarios_init@plt>
mov    $0x0,%al
call   10c0 <Servicios_init@plt>
mov    $0x0,%al
call   10f0 <Consultas_init@plt>
mov    $0x0,%al
call   10a0 <Cotizaciones_init@plt>
mov    $0x0,%al
call   10b0 <Categorias_init@plt>
lea    0xde0(%rip),%rdi
call   1080 <printf@plt>
lea    0xdea(%rip),%rdi
call   1080 <printf@plt>
lea    0xdf0(%rip),%rdi
call   1080 <printf@plt>
lea    0xdf4(%rip),%rdi
call   1080 <printf@plt>
lea    0xdfb(%rip),%rdi
call   1080 <printf@plt>
lea    0xdfa(%rip),%rdi
call   1080 <printf@plt>
mov    $0x0,%al
call   1050 <read_opt@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x73,%eax
jne    127d <main+0x9d>
jmp    12c8 <main+0xe8>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x31,%eax
je     12a3 <main+0xc3>
jmp    1292 <main+0xb2>
mov    -0x18(%rbp),%eax
sub    $0x32,%eax
je     12af <main+0xcf>
jmp    12be <main+0xde>
mov    $0x0,%al
call   1070 <conectarse@plt>
jmp    12c3 <main+0xe3>
mov    $0x75,%edi
call   1030 <crear_usuario@plt>
jmp    12c3 <main+0xe3>
jmp    12c3 <main+0xe3>
jmp    1225 <main+0x45>
mov    $0x0,%al
call   1090 <Usuarios_end@plt>
mov    $0x0,%al
call   1040 <Servicios_end@plt>
mov    $0x0,%al
call   10e0 <Consultas_end@plt>
mov    $0x0,%al
call   1100 <Cotizaciones_end@plt>
mov    $0x0,%al
call   10d0 <Categorias_end@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1070 <Usuarios_init@plt>
xor    %eax,%eax
call   10c0 <Servicios_init@plt>
xor    %eax,%eax
call   10f0 <Consultas_init@plt>
xor    %eax,%eax
call   10a0 <Cotizaciones_init@plt>
xor    %eax,%eax
call   10b0 <Categorias_init@plt>
lea    0xded(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
lea    0xdfb(%rip),%rdi
call   1030 <puts@plt>
lea    0xdfe(%rip),%rdi
call   1030 <puts@plt>
lea    0xe04(%rip),%rdi
call   1030 <puts@plt>
lea    0xe02(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <read_opt@plt>
cmp    $0x73,%al
jne    128e <main+0xae>
xor    %eax,%eax
call   1090 <Usuarios_end@plt>
xor    %eax,%eax
call   1050 <Servicios_end@plt>
xor    %eax,%eax
call   10e0 <Consultas_end@plt>
xor    %eax,%eax
call   1100 <Cotizaciones_end@plt>
xor    %eax,%eax
call   10d0 <Categorias_end@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xd80(%rip),%r14
lea    0xd8a(%rip),%r15
lea    0xd92(%rip),%r12
lea    0xd9d(%rip),%r13
lea    0xda0(%rip),%rbx
jmp    1301 <main+0x121>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x75,%edi
call   1040 <crear_usuario@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%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>
xor    %eax,%eax
call   1060 <read_opt@plt>
cmp    $0x73,%al
je     125f <main+0x7f>
movsbl %al,%eax
cmp    $0x32,%eax
je     12c0 <main+0xe0>
cmp    $0x31,%eax
jne    12ca <main+0xea>
xor    %eax,%eax
call   1080 <conectarse@plt>
jmp    12ca <main+0xea>

LLVM IR (-O0):
@.str = [22 x i8] c" Paginas Doradas ** \0A\00"
@.str.1 = [18 x i8] c"Que desea hacer?\0A\00"
@.str.2 = [16 x i8] c"1 - Conectarse\0A\00"
@.str.3 = [19 x i8] c"2 - Crear usuario\0A\00"
@.str.4 = [11 x i8] c"s - Salir\0A\00"
@.str.5 = [19 x i8] c"Seleccione opcion\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @Usuarios_init()
%8 = call i32 (...) @Servicios_init()
%9 = call i32 (...) @Consultas_init()
%10 = call i32 (...) @Cotizaciones_init()
%11 = call i32 (...) @Categorias_init()
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %2, %32
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%19 = call signext i8 (...) @read_opt()
store i8 %19, i8* %6
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 115
br i1 %22, label %23, label %24
23: ; preds = %13
br label %33
24: ; preds = %13
%25 = load i8, i8* %6
%26 = sext i8 %25 to i32
switch i32 %26, label %31 [
i32 49, label %27
i32 50, label %29
]
27: ; preds = %24
%28 = call i32 (...) @conectarse()
br label %32
29: ; preds = %24
%30 = call i32 @crear_usuario(i8 zeroext 117)
br label %32
31: ; preds = %24
br label %32
32: ; preds = %31, %29, %27
br label %13
33: ; preds = %23
%34 = call i32 (...) @Usuarios_end()
%35 = call i32 (...) @Servicios_end()
%36 = call i32 (...) @Consultas_end()
%37 = call i32 (...) @Cotizaciones_end()
%38 = call i32 (...) @Categorias_end()
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@str = [21 x i8] c" Paginas Doradas ** \00"
@str.6 = [17 x i8] c"Que desea hacer?\00"
@str.7 = [15 x i8] c"1 - Conectarse\00"
@str.8 = [18 x i8] c"2 - Crear usuario\00"
@str.9 = [10 x i8] c"s - Salir\00"
@str.10 = [18 x i8] c"Seleccione opcion\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Usuarios_init()
%4 = tail call i32 (...) @Servicios_init()
%5 = tail call i32 (...) @Consultas_init()
%6 = tail call i32 (...) @Cotizaciones_init()
%7 = tail call i32 (...) @Categorias_init()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.7, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.9, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
%14 = tail call signext i8 (...) @read_opt()
%15 = icmp eq i8 %14, 115
br i1 %15, label %31, label %16
16: ; preds = %2, %23
%17 = phi i8 [ %29, %23 ], [ %14, %2 ]
%18 = sext i8 %17 to i32
switch i32 %18, label %23 [
i32 49, label %19
i32 50, label %21
]
19: ; preds = %16
%20 = tail call i32 (...) @conectarse()
br label %23
21: ; preds = %16
%22 = tail call i32 @crear_usuario(i8 zeroext 117)
br label %23
23: ; preds = %19, %21, %16
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.7, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.9, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.10, i64 0, i64 0))
%29 = tail call signext i8 (...) @read_opt()
%30 = icmp eq i8 %29, 115
br i1 %30, label %31, label %16
31: ; preds = %23, %2
%32 = tail call i32 (...) @Usuarios_end()
%33 = tail call i32 (...) @Servicios_end()
%34 = tail call i32 (...) @Consultas_end()
%35 = tail call i32 (...) @Cotizaciones_end()
%36 = tail call i32 (...) @Categorias_end()
ret i32 0
}