#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);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  int vec[50], i, aux, suma, promedio, mayor, menor;
  mayor = -999;
  menor = 999;
  srand(time(0));
  for (i = 0; i < 50; i++) {
    vec[i] = rand() % 90 + 10;
  }
  for (i = 0; i < 50; i++) {
    aux = vec[i];
    vec[i] = vec[i + 1];
    vec[i + 1] = aux;
    suma = suma + vec[i];
    promedio = suma / 50;
    if (vec[i] > mayor) {
      mayor = vec[i];
    }
    if (vec[i] < menor) {
      menor = vec[i];
    }
  }
  for (i = 0; i < 50; i++) {
    printf("%d\n", vec[i]);
  }
  printf("La Suma de los numeros del Vector es: %d\n", suma);
  printf("El Promedio del Vector es: %d\n", promedio);
  printf("El Numero Mayor es: %d\n", mayor);
  printf("El Numero Menor es: %d\n", menor);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffc19,-0xe4(%rbp)
fc ff ff
movl   $0x3e7,-0xe8(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x32,-0xd4(%rbp)
jge    11cf <main+0x7f>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x5a,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
movslq -0xd4(%rbp),%rax
mov    %edx,-0xd0(%rbp,%rax,4)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    118e <main+0x3e>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x32,-0xd4(%rbp)
jge    12d5 <main+0x185>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
mov    %eax,-0xd8(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,4),%ecx
movslq -0xd4(%rbp),%rax
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0xd8(%rbp),%ecx
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0xdc(%rbp),%eax
movslq -0xd4(%rbp),%rcx
add    -0xd0(%rbp,%rcx,4),%eax
mov    %eax,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,-0xe0(%rbp)
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
cmp    -0xe4(%rbp),%eax
jle    128e <main+0x13e>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
mov    %eax,-0xe4(%rbp)
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
cmp    -0xe8(%rbp),%eax
jge    12bc <main+0x16c>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
mov    %eax,-0xe8(%rbp)
jmp    12c1 <main+0x171>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    11d9 <main+0x89>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x32,-0xd4(%rbp)
jge    131a <main+0x1ca>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%esi
lea    0xd74(%rip),%rdi
call   1040 <printf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    12df <main+0x18f>
mov    -0xdc(%rbp),%esi
lea    0xcd9(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe0(%rbp),%esi
lea    0xcf1(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe4(%rbp),%esi
lea    0xcfe(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe8(%rbp),%esi
lea    0xd04(%rip),%rdi
call   1040 <printf@plt>
lea    0xd10(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd0,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xa,%eax
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1170 <main+0x20>
mov    $0xfffffc19,%r12d
mov    $0x3e7,%r15d
mov    $0x2,%eax
mov    (%rsp),%ecx
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp,%rax,4),%edx
add    %edx,%ebx
cmp    %r12d,%edx
cmovg  %edx,%r12d
mov    (%rsp,%rax,4),%esi
cmp    %r15d,%edx
cmovl  %edx,%r15d
mov    %edx,-0x8(%rsp,%rax,4)
mov    %esi,-0x4(%rsp,%rax,4)
mov    %ecx,(%rsp,%rax,4)
add    %esi,%ebx
cmp    %r12d,%esi
cmovg  %esi,%r12d
cmp    %r15d,%esi
cmovl  %esi,%r15d
add    $0x2,%rax
cmp    $0x34,%rax
jne    11c0 <main+0x70>
xor    %ebp,%ebp
lea    0xe70(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsp,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0x32,%rbp
jne    1210 <main+0xc0>
movslq %ebx,%rsi
imul   $0x51eb851f,%rsi,%r14
mov    %r14,%rax
shr    $0x3f,%rax
sar    $0x24,%r14
add    %eax,%r14d
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
lea    0xdda(%rip),%rdi
mov    %r14d,%esi
call   1040 <printf@plt>
lea    0xdea(%rip),%rdi
mov    %r12d,%esi
call   1040 <printf@plt>
lea    0xdf3(%rip),%rdi
mov    %r15d,%esi
call   1040 <printf@plt>
lea    0xdfc(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [42 x i8] c"La Suma de los numeros del Vector es: %d\0A\00"
@.str.2 = [31 x i8] c"El Promedio del Vector es: %d\0A\00"
@.str.3 = [24 x i8] c"El Numero Mayor es: %d\0A\00"
@.str.4 = [24 x i8] c"El Numero Menor es: %d\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 -999, i32* %7
store i32 999, i32* %8
%9 = call i32 @time(i32 0)
%10 = call i32 @srand(i32 %9)
store i32 0, i32* %3
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 50
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 90
%17 = add nsw i32 %16, 10
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %11
24: ; preds = %11
store i32 0, i32* %3
br label %25
25: ; preds = %78, %24
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 50
br i1 %27, label %28, label %81
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %30
%32 = load i32, i32* %31
store i32 %32, i32* %4
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %39
store i32 %37, i32* %40
%41 = load i32, i32* %4
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %44
store i32 %41, i32* %45
%46 = load i32, i32* %5
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = add nsw i32 %46, %50
store i32 %51, i32* %5
%52 = load i32, i32* %5
%53 = sdiv i32 %52, 50
store i32 %53, i32* %6
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = load i32, i32* %7
%59 = icmp sgt i32 %57, %58
br i1 %59, label %60, label %65
60: ; preds = %28
%61 = load i32, i32* %3
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %62
%64 = load i32, i32* %63
store i32 %64, i32* %7
br label %65
65: ; preds = %60, %28
%66 = load i32, i32* %3
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = load i32, i32* %8
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %77
72: ; preds = %65
%73 = load i32, i32* %3
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %74
%76 = load i32, i32* %75
store i32 %76, i32* %8
br label %77
77: ; preds = %72, %65
br label %78
78: ; preds = %77
%79 = load i32, i32* %3
%80 = add nsw i32 %79, 1
store i32 %80, i32* %3
br label %25
81: ; preds = %25
store i32 0, i32* %3
br label %82
82: ; preds = %91, %81
%83 = load i32, i32* %3
%84 = icmp slt i32 %83, 50
br i1 %84, label %85, label %94
85: ; preds = %82
%86 = load i32, i32* %3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %87
%89 = load i32, i32* %88
%90 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %85
%92 = load i32, i32* %3
%93 = add nsw i32 %92, 1
store i32 %93, i32* %3
br label %82
94: ; preds = %82
%95 = load i32, i32* %5
%96 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %95)
%97 = load i32, i32* %6
%98 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %97)
%99 = load i32, i32* %7
%100 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %8
%102 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %101)
%103 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [42 x i8] c"La Suma de los numeros del Vector es: %d\0A\00"
@.str.2 = [31 x i8] c"El Promedio del Vector es: %d\0A\00"
@.str.3 = [24 x i8] c"El Numero Mayor es: %d\0A\00"
@.str.4 = [24 x i8] c"El Numero Menor es: %d\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %11, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 90
%9 = add nsw i32 %8, 10
%10 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %6
store i32 %9, i32* %10
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 50
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%15 = load i32, i32* %14
br label %16
16: ; preds = %16, %13
%17 = phi i64 [ 0, %13 ], [ %31, %16 ]
%18 = phi i32 [ 999, %13 ], [ %38, %16 ]
%19 = phi i32 [ -999, %13 ], [ %36, %16 ]
%20 = phi i32 [ undef, %13 ], [ %34, %16 ]
%21 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %17
%22 = or i64 %17, 1
%23 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %22
%24 = load i32, i32* %23
store i32 %24, i32* %21
store i32 %15, i32* %23
%25 = add nsw i32 %24, %20
%26 = icmp sgt i32 %24, %19
%27 = select i1 %26, i32 %24, i32 %19
%28 = icmp slt i32 %24, %18
%29 = select i1 %28, i32 %24, i32 %18
%30 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %22
%31 = add nuw nsw i64 %17, 2
%32 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %31
%33 = load i32, i32* %32
store i32 %33, i32* %30
store i32 %15, i32* %32
%34 = add nsw i32 %33, %25
%35 = icmp sgt i32 %33, %27
%36 = select i1 %35, i32 %33, i32 %27
%37 = icmp slt i32 %33, %29
%38 = select i1 %37, i32 %33, i32 %29
%39 = icmp eq i64 %31, 50
br i1 %39, label %40, label %16
40: ; preds = %16, %40
%41 = phi i64 [ %45, %40 ], [ 0, %16 ]
%42 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i64 %41, 1
%46 = icmp eq i64 %45, 50
br i1 %46, label %47, label %40
47: ; preds = %40
%48 = sdiv i32 %34, 50
%49 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%50 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %48)
%51 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%52 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%53 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}