#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int menu() {
  int opcion;
  system("clear");
  printf("  0. Salir................................\n");
  printf("  1. Introducir Grafo.....................\n");
  printf("  2. Algoritmo de Dijkstra(GD y GND)......\n");
  printf("  3. Algoritmo Floyd(GD y GND)............\n");
  printf("  4. Algoritmo Prim(GND)..................\n");
  printf("  5. Algoritmo Kruskal(GND)...............\n");
  printf("  6. Recorrido en profundidad(GD y GND)...\n");
  printf("  7. Recorrido en amplitud(GD y GND)......\n");
  printf("  8. Clasif. Topológica(GD aciclicos).....\n");
  printf("  9. Tipos de lados (b.en prof.para GD)...\n");
  printf("Introduzca opcion...:");
  scanf("%d", &opcion);
  return opcion;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
call   1040 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf3b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf5b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf7b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xfbb(%rip),%rdi
call   1040 <printf@plt>
lea    0xfdc(%rip),%rdi
call   1040 <printf@plt>
lea    0xffc(%rip),%rdi
call   1040 <printf@plt>
lea    0x1006(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <system@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
lea    0xf66(%rip),%rdi
call   1030 <puts@plt>
lea    0xf85(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa4(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe44(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [44 x i8] c" 0. Salir................................\0A\00"
@.str.2 = [44 x i8] c" 1. Introducir Grafo.....................\0A\00"
@.str.3 = [44 x i8] c" 2. Algoritmo de Dijkstra(GD y GND)......\0A\00"
@.str.4 = [44 x i8] c" 3. Algoritmo Floyd(GD y GND)............\0A\00"
@.str.5 = [44 x i8] c" 4. Algoritmo Prim(GND)..................\0A\00"
@.str.6 = [44 x i8] c" 5. Algoritmo Kruskal(GND)...............\0A\00"
@.str.7 = [44 x i8] c" 6. Recorrido en profundidad(GD y GND)...\0A\00"
@.str.8 = [44 x i8] c" 7. Recorrido en amplitud(GD y GND)......\0A\00"
@.str.9 = [45 x i8] c" 8. Clasif. Topol\C3\B3gica(GD aciclicos).....\0A\00"
@.str.10 = [44 x i8] c" 9. Tipos de lados (b.en prof.para GD)...\0A\00"
@.str.11 = [22 x i8] c"Introduzca opcion...:\00"
@.str.12 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.11 = [22 x i8] c"Introduzca opcion...:\00"
@.str.12 = [3 x i8] c"%d\00"
@str = [43 x i8] c" 0. Salir................................\00"
@str.13 = [43 x i8] c" 1. Introducir Grafo.....................\00"
@str.14 = [43 x i8] c" 2. Algoritmo de Dijkstra(GD y GND)......\00"
@str.15 = [43 x i8] c" 3. Algoritmo Floyd(GD y GND)............\00"
@str.16 = [43 x i8] c" 4. Algoritmo Prim(GND)..................\00"
@str.17 = [43 x i8] c" 5. Algoritmo Kruskal(GND)...............\00"
@str.18 = [43 x i8] c" 6. Recorrido en profundidad(GD y GND)...\00"
@str.19 = [43 x i8] c" 7. Recorrido en amplitud(GD y GND)......\00"
@str.20 = [44 x i8] c" 8. Clasif. Topol\C3\B3gica(GD aciclicos).....\00"
@str.21 = [43 x i8] c" 9. Tipos de lados (b.en prof.para GD)...\00"
define i32 @menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.20, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.21, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
ret i32 %16
}