#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*/ crearIndiceImpares(int, int *, int *);
int /*<<< orphan*/ crearIndicesPotencias(int, int *, int *);
int /*<<< orphan*/ imprimeIndice(int, int *, int *, int *);
int /*<<< orphan*/ imprimeVector(int, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rellenaVectorAleatorio(int, int *, int *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int rango[1], nEle;
  srand(time(NULL));
  printf("Introduzca el numero de elementos del vector: ");
  scanf("%i", &nEle);
  int vector[nEle];
  int vectorImpares[nEle];
  int vectorPotencias[nEle];
  printf("Introduzca el rango minimo: ");
  scanf("%i", &rango[0]);
  printf("Introduzca el rango maximo: ");
  scanf("%i", &rango[1]);
  rellenaVectorAleatorio(nEle, rango, vector);
  imprimeVector(nEle, vector);
  crearIndiceImpares(nEle, vector, vectorImpares);
  crearIndicesPotencias(nEle, vector, vectorPotencias);
  imprimeIndice(nEle, vector, vectorImpares, vectorPotencias);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xde6(%rip),%rdi
call   10a0 <scanf@plt>
lea    0xdfa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xdc6(%rip),%rdi
call   10a0 <scanf@plt>
mov    -0x48(%rbp),%rdx
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <rellenaVectorAleatorio@plt>
mov    -0x48(%rbp),%rsi
mov    -0xc(%rbp),%edi
call   10b0 <imprimeVector@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0xc(%rbp),%edi
call   1090 <crearIndiceImpares@plt>
mov    -0x48(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0xc(%rbp),%edi
call   1030 <crearIndicesPotencias@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0xc(%rbp),%edi
call   1060 <imprimeIndice@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6d(%rip),%r12
lea    -0x2c(%rbp),%rsi
mov    %r12,%rdi
call   10a0 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x2c(%rbp),%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
lea    0xe20(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
call   10a0 <scanf@plt>
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
lea    -0x2c(%rbp),%rsi
mov    %r12,%rdi
call   10a0 <scanf@plt>
mov    -0x2c(%rbp),%edi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1050 <rellenaVectorAleatorio@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   10b0 <imprimeVector@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1090 <crearIndiceImpares@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <crearIndicesPotencias@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1060 <imprimeIndice@plt>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Introduzca el numero de elementos del vector: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [29 x i8] c"Introduzca el rango minimo: \00"
@.str.3 = [29 x i8] c"Introduzca el rango maximo: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %4
%15 = alloca i32, i64 %13
store i64 %13, i64* %5
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = alloca i32, i64 %17
store i64 %17, i64* %6
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = alloca i32, i64 %20
store i64 %20, i64* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 1
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
%28 = load i32, i32* %3
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%30 = call i32 @rellenaVectorAleatorio(i32 %28, i32* %29, i32* %15)
%31 = load i32, i32* %3
%32 = call i32 @imprimeVector(i32 %31, i32* %15)
%33 = load i32, i32* %3
%34 = call i32 @crearIndiceImpares(i32 %33, i32* %15, i32* %18)
%35 = load i32, i32* %3
%36 = call i32 @crearIndicesPotencias(i32 %35, i32* %15, i32* %21)
%37 = load i32, i32* %3
%38 = call i32 @imprimeIndice(i32 %37, i32* %15, i32* %18, i32* %21)
store i32 0, i32* %1
%39 = load i8*, i8** %4
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [47 x i8] c"Introduzca el numero de elementos del vector: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [29 x i8] c"Introduzca el rango minimo: \00"
@.str.3 = [29 x i8] c"Introduzca el rango maximo: \00"
define i32 @main() {
%1 = alloca [1 x i32]
%2 = alloca i32
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
%12 = alloca i32, i64 %10
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = alloca i32, i64 %14
%16 = alloca i32, i64 %14
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 1
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %2
%24 = call i32 @rellenaVectorAleatorio(i32 %23, i32* %18, i32* %12)
%25 = load i32, i32* %2
%26 = call i32 @imprimeVector(i32 %25, i32* %12)
%27 = load i32, i32* %2
%28 = call i32 @crearIndiceImpares(i32 %27, i32* %12, i32* %15)
%29 = load i32, i32* %2
%30 = call i32 @crearIndicesPotencias(i32 %29, i32* %12, i32* %16)
%31 = load i32, i32* %2
%32 = call i32 @imprimeIndice(i32 %31, i32* %12, i32* %15, i32* %16)
ret i32 0
}