#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*/ cargarelvector(char *, int);
int /*<<< orphan*/ eliminarordenadorepetidos();
int menu();
int /*<<< orphan*/ ordenarvectorcar(char *, int);
int /*<<< orphan*/ ordenaryeliminarepetidos();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int opc, a, b, Tope;
  char v[Tope];
  do {
    opc = menu();
    switch (opc) {
    case 1:
      printf("\n Cargar un vector de Letras...\n");
      printf("--------------------------------\n");
      printf("Tamanio del Vector\n");
      scanf("%d", &Tope);
      cargarelvector(v, Tope);
      break;
    case 2:
      printf("\n Ordenar el vector de letras...\n");
      printf("---------------------------------\n");
      ordenarvectorcar(v, Tope);
      break;
    case 3:
      printf("\n Carga un vector ordenado de Nº y elimina repetidos...\n");
      printf("----------------------------------------------------\n");
      eliminarordenadorepetidos();
      break;
    case 4:
      printf("\n Carga un vector desordenado de Nº y elimina repetidos...\n");
      printf("----------------------------------------------------\n");
      ordenaryeliminarepetidos();
      break;
    default:
      break;
    }
  } while (opc != 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
call   1050 <menu@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x3,%eax
ja     128e <main+0x11e>
mov    -0x38(%rbp),%rax
lea    0xe31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe31(%rip),%rdi
call   1060 <printf@plt>
lea    0xecd(%rip),%rdi
call   1060 <printf@plt>
lea    0xe3a(%rip),%rdi
call   1060 <printf@plt>
lea    0xe42(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1090 <cargarelvector@plt>
jmp    1293 <main+0x123>
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
lea    0xe87(%rip),%rdi
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1070 <ordenarvectorcar@plt>
jmp    1293 <main+0x123>
lea    0xe1d(%rip),%rdi
call   1060 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <eliminarordenadorepetidos@plt>
jmp    1293 <main+0x123>
lea    0xe69(%rip),%rdi
call   1060 <printf@plt>
lea    0xe27(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <ordenaryeliminarepetidos@plt>
jmp    1293 <main+0x123>
jmp    1293 <main+0x123>
jmp    1298 <main+0x128>
cmpl   $0x5,-0x8(%rbp)
jne    11a5 <main+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,0x10(%rsp)
lea    0xe76(%rip),%r14
mov    %rsp,%rbp
lea    0xf0b(%rip),%r15
lea    0xeb8(%rip),%r12
lea    0xeea(%rip),%r13
lea    0xe6e(%rip),%rbx
jmp    11d0 <main+0x60>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <ordenaryeliminarepetidos@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <menu@plt>
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11d0 <main+0x60>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe01(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
call   1090 <cargarelvector@plt>
jmp    11d0 <main+0x60>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
call   1070 <ordenarvectorcar@plt>
jmp    11d0 <main+0x60>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <eliminarordenadorepetidos@plt>
jmp    11d0 <main+0x60>
mov    0x10(%rsp),%rsp
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A Cargar un vector de Letras...\0A\00"
@.str.1 = [34 x i8] c"--------------------------------\0A\00"
@.str.2 = [20 x i8] c"Tamanio del Vector\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [34 x i8] c"\0A Ordenar el vector de letras...\0A\00"
@.str.5 = [35 x i8] c"---------------------------------\0A\00"
@.str.6 = [58 x i8] c"\0A Carga un vector ordenado de N\C2\BA y elimina repetidos...\0A\00"
@.str.7 = [54 x i8] c"----------------------------------------------------\0A\00"
@.str.8 = [61 x i8] c"\0A Carga un vector desordenado de N\C2\BA y elimina repetidos...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %1
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
br label %12
12: ; preds = %37, %0
%13 = call i32 (...) @menu()
store i32 %13, i32* %2
%14 = load i32, i32* %2
switch i32 %14, label %35 [
i32 1, label %15
i32 2, label %22
i32 3, label %27
i32 4, label %31
]
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%20 = load i32, i32* %5
%21 = call i32 @cargarelvector(i8* %11, i32 %20)
br label %36
22: ; preds = %12
%23 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%25 = load i32, i32* %5
%26 = call i32 @ordenarvectorcar(i8* %11, i32 %25)
br label %36
27: ; preds = %12
%28 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 (...) @eliminarordenadorepetidos()
br label %36
31: ; preds = %12
%32 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0))
%33 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (...) @ordenaryeliminarepetidos()
br label %36
35: ; preds = %12
br label %36
36: ; preds = %35, %31, %27, %22, %15
br label %37
37: ; preds = %36
%38 = load i32, i32* %2
%39 = icmp ne i32 %38, 5
br i1 %39, label %12, label %40
40: ; preds = %37
store i32 0, i32* %1
%41 = load i8*, i8** %6
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@str = [60 x i8] c"\0A Carga un vector desordenado de N\C2\BA y elimina repetidos...\00"
@str.10 = [57 x i8] c"\0A Carga un vector ordenado de N\C2\BA y elimina repetidos...\00"
@str.11 = [53 x i8] c"----------------------------------------------------\00"
@str.12 = [33 x i8] c"\0A Ordenar el vector de letras...\00"
@str.13 = [34 x i8] c"---------------------------------\00"
@str.14 = [32 x i8] c"\0A Cargar un vector de Letras...\00"
@str.15 = [33 x i8] c"--------------------------------\00"
@str.16 = [19 x i8] c"Tamanio del Vector\00"
define i32 @main() {
%1 = alloca [0 x i8]
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i8* @llvm.stacksave()
%5 = getelementptr inbounds [0 x i8], [0 x i8]* %1, i64 0, i64 0
br label %6
6: ; preds = %28, %0
%7 = call i32 (...) @menu()
switch i32 %7, label %28 [
i32 1, label %8
i32 2, label %15
i32 3, label %20
i32 4, label %24
i32 5, label %29
]
8: ; preds = %6
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.14, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.15, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.16, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = call i32 @cargarelvector(i8* %5, i32 %13)
br label %28
15: ; preds = %6
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.13, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = call i32 @ordenarvectorcar(i8* %5, i32 %18)
br label %28
20: ; preds = %6
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.10, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.11, i64 0, i64 0))
%23 = call i32 (...) @eliminarordenadorepetidos()
br label %28
24: ; preds = %6
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.11, i64 0, i64 0))
%27 = call i32 (...) @ordenaryeliminarepetidos()
br label %28
28: ; preds = %24, %20, %15, %8, %6
br label %6
29: ; preds = %6
ret i32 0
}