#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*/ divis();
int /*<<< orphan*/ pares();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ seg();
int /*<<< orphan*/ system(char *);
int main() {
  int elegir;
  elegir = 0;
  printf("Bienvenido\n\n");
  printf("Seleccione un programa de la lista:\n\n");
  printf("0. Ninguno, me tengo que ir\n");
  printf("1. Divisibles entre 7\n");
  printf("2. Numeros pares\n");
  printf("3. Segundos\n\n");
  printf("Introduzca numero:\t");
  scanf("%d", &elegir);
  if (elegir < 0) {
    system("cls");
    printf("Introduce un numero mayor que 0\n\n");
    system("pause");
    system("cls");
    main();
  } else {
    if (elegir == 0) {
      return 0;
    } else {
      if (elegir == 1) {
        system("cls");
        printf("Ejecutando programa 'Divisibles entre 7'\n\n");
        printf("Continuar?\n");
        system("pause");
        system("cls");
        divis();
      } else {
        if (elegir == 2) {
          system("cls");
          printf("Ejecutando programa 'Numeros pares'\n\n");
          printf("Continuar?\n");
          system("pause");
          system("cls");
          pares();
        } else {
          if (elegir == 3) {
            system("cls");
            printf("Ejecutando programa 'Segundos'\n\n");
            printf("Continuar?\n");
            system("pause");
            system("cls");
            seg();
          } else {
            system("cls");
            printf("Introduce un numero entre el 1 y el 3\n");
            system("pause");
            system("cls");
            main();
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe73(%rip),%rdi
call   1060 <printf@plt>
lea    0xe74(%rip),%rdi
call   1060 <printf@plt>
lea    0xe8e(%rip),%rdi
call   1060 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1060 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1060 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    122e <main+0xbe>
lea    0xea3(%rip),%rdi
call   1050 <system@plt>
lea    0xe9b(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1050 <system@plt>
lea    0xe7f(%rip),%rdi
call   1050 <system@plt>
call   1080 <main@plt>
jmp    1383 <main+0x213>
cmpl   $0x0,-0x8(%rbp)
jne    1244 <main+0xd4>
movl   $0x0,-0x4(%rbp)
jmp    138a <main+0x21a>
cmpl   $0x1,-0x8(%rbp)
jne    1296 <main+0x126>
lea    0xe49(%rip),%rdi
call   1050 <system@plt>
lea    0xe69(%rip),%rdi
call   1060 <printf@plt>
lea    0xe88(%rip),%rdi
call   1060 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1050 <system@plt>
lea    0xe19(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <divis@plt>
jmp    1379 <main+0x209>
cmpl   $0x2,-0x8(%rbp)
jne    12e8 <main+0x178>
lea    0xdf7(%rip),%rdi
call   1050 <system@plt>
lea    0xe4e(%rip),%rdi
call   1060 <printf@plt>
lea    0xe36(%rip),%rdi
call   1060 <printf@plt>
lea    0xdf9(%rip),%rdi
call   1050 <system@plt>
lea    0xdc7(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1030 <pares@plt>
jmp    1374 <main+0x204>
cmpl   $0x3,-0x8(%rbp)
jne    133a <main+0x1ca>
lea    0xda5(%rip),%rdi
call   1050 <system@plt>
lea    0xe22(%rip),%rdi
call   1060 <printf@plt>
lea    0xde4(%rip),%rdi
call   1060 <printf@plt>
lea    0xda7(%rip),%rdi
call   1050 <system@plt>
lea    0xd75(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1070 <seg@plt>
jmp    136f <main+0x1ff>
lea    0xd5d(%rip),%rdi
call   1050 <system@plt>
lea    0xdfb(%rip),%rdi
call   1060 <printf@plt>
lea    0xd6b(%rip),%rdi
call   1050 <system@plt>
lea    0xd39(%rip),%rdi
call   1050 <system@plt>
call   1080 <main@plt>
jmp    1374 <main+0x204>
jmp    1379 <main+0x209>
jmp    137e <main+0x20e>
jmp    1383 <main+0x213>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xe34(%rip),%rdi
call   1070 <printf@plt>
lea    0xe3c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10a0 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     1258 <main+0xd8>
cmp    $0x3,%eax
ja     1270 <main+0xf0>
mov    %eax,%eax
lea    0xdf8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe0f(%rip),%rbx
mov    %rbx,%rdi
call   1060 <system@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
lea    0xf14(%rip),%rdi
call   1040 <puts@plt>
lea    0xdec(%rip),%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1050 <divis@plt>
jmp    132f <main+0x1af>
lea    0xdc8(%rip),%rbx
mov    %rbx,%rdi
call   1060 <system@plt>
lea    0xee4(%rip),%rdi
jmp    1286 <main+0x106>
lea    0xdb0(%rip),%rbx
mov    %rbx,%rdi
call   1060 <system@plt>
lea    0xe2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xd99(%rip),%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
call   1090 <main@plt>
jmp    132f <main+0x1af>
lea    0xd77(%rip),%rbx
mov    %rbx,%rdi
call   1060 <system@plt>
lea    0xe39(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
lea    0xd54(%rip),%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1030 <pares@plt>
jmp    132f <main+0x1af>
lea    0xd33(%rip),%rbx
mov    %rbx,%rdi
call   1060 <system@plt>
lea    0xdd5(%rip),%rdi
call   1040 <puts@plt>
lea    0xe38(%rip),%rdi
call   1040 <puts@plt>
lea    0xd10(%rip),%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1080 <seg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Bienvenido\0A\0A\00"
@.str.1 = [38 x i8] c"Seleccione un programa de la lista:\0A\0A\00"
@.str.2 = [29 x i8] c"0. Ninguno, me tengo que ir\0A\00"
@.str.3 = [23 x i8] c"1. Divisibles entre 7\0A\00"
@.str.4 = [18 x i8] c"2. Numeros pares\0A\00"
@.str.5 = [14 x i8] c"3. Segundos\0A\0A\00"
@.str.6 = [20 x i8] c"Introduzca numero:\09\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [4 x i8] c"cls\00"
@.str.9 = [34 x i8] c"Introduce un numero mayor que 0\0A\0A\00"
@.str.10 = [6 x i8] c"pause\00"
@.str.11 = [43 x i8] c"Ejecutando programa 'Divisibles entre 7'\0A\0A\00"
@.str.12 = [12 x i8] c"Continuar?\0A\00"
@.str.13 = [38 x i8] c"Ejecutando programa 'Numeros pares'\0A\0A\00"
@.str.14 = [33 x i8] c"Ejecutando programa 'Segundos'\0A\0A\00"
@.str.15 = [39 x i8] c"Introduce un numero entre el 1 y el 3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 @main()
br label %63
19: ; preds = %0
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %1
br label %64
23: ; preds = %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%31 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%32 = call i32 (...) @divis()
br label %61
33: ; preds = %23
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%38 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%39 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%40 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%41 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%42 = call i32 (...) @pares()
br label %60
43: ; preds = %33
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 3
br i1 %45, label %46, label %53
46: ; preds = %43
%47 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%48 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0))
%49 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%50 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%51 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%52 = call i32 (...) @seg()
br label %59
53: ; preds = %43
%54 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%55 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.15, i64 0, i64 0))
%56 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%57 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%58 = call i32 @main()
br label %59
59: ; preds = %53, %46
br label %60
60: ; preds = %59, %36
br label %61
61: ; preds = %60, %26
br label %62
62: ; preds = %61
br label %63
63: ; preds = %62, %13
store i32 0, i32* %1
br label %64
64: ; preds = %63, %22
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str.6 = [20 x i8] c"Introduzca numero:\09\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [4 x i8] c"cls\00"
@.str.10 = [6 x i8] c"pause\00"
@str = [12 x i8] c"Bienvenido\0A\00"
@str.16 = [37 x i8] c"Seleccione un programa de la lista:\0A\00"
@str.17 = [28 x i8] c"0. Ninguno, me tengo que ir\00"
@str.18 = [22 x i8] c"1. Divisibles entre 7\00"
@str.19 = [17 x i8] c"2. Numeros pares\00"
@str.20 = [13 x i8] c"3. Segundos\0A\00"
@str.21 = [38 x i8] c"Introduce un numero entre el 1 y el 3\00"
@str.22 = [32 x i8] c"Ejecutando programa 'Segundos'\0A\00"
@str.24 = [37 x i8] c"Ejecutando programa 'Numeros pares'\0A\00"
@str.26 = [42 x i8] c"Ejecutando programa 'Divisibles entre 7'\0A\00"
@str.27 = [11 x i8] c"Continuar?\00"
@str.28 = [33 x i8] c"Introduce un numero mayor que 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.16, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.28, i64 0, i64 0))
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 @main()
br label %47
19: ; preds = %0
switch i32 %11, label %41 [
i32 0, label %47
i32 1, label %20
i32 2, label %27
i32 3, label %34
]
20: ; preds = %19
%21 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.26, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.27, i64 0, i64 0))
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 (...) @divis()
br label %47
27: ; preds = %19
%28 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.24, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.27, i64 0, i64 0))
%31 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%33 = call i32 (...) @pares()
br label %47
34: ; preds = %19
%35 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.22, i64 0, i64 0))
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.27, i64 0, i64 0))
%38 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%39 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%40 = call i32 (...) @seg()
br label %47
41: ; preds = %19
%42 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.21, i64 0, i64 0))
%44 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%45 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%46 = call i32 @main()
br label %47
47: ; preds = %13, %20, %34, %41, %27, %19
ret i32 0
}