#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 *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float nums[10];
  float media = 0, actual;
  for (int i = 0; i < 10; i++) {
    printf("Ingresa el %d numero: ", i + 1);
    scanf("%f", &actual);
    nums[i] = actual;
    media += actual;
  }
  media /= 10;
  printf("\nLa media es %.2f, imprimiendo numeros que son mayores a esta: \n",
         media);
  for (int i = 0; i < 10; i++)
    if (nums[i] > media)
      printf("\tNumero mayor a la media: %.2f\n", nums[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    119a <main+0x7a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x38(%rbp),%xmm0
movslq -0x3c(%rbp),%rax
movss  %xmm0,-0x30(%rbp,%rax,4)
movss  -0x38(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    113e <main+0x1e>
movss  -0x34(%rbp),%xmm0
movss  0xe59(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0xa,-0x40(%rbp)
jge    120f <main+0xef>
movslq -0x40(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
ucomiss -0x34(%rbp),%xmm0
jbe    11fc <main+0xdc>
movslq -0x40(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11c8 <main+0xa8>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xef8(%rip),%r14
movss  0xec8(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rbx
lea    0x4(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
xorps  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xe8d(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xe5c(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xe2b(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xdfa(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xdc9(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xd98(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xd67(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
movss  %xmm1,0x10(%rsp)
addss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
movss  0xd36(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
movss  %xmm1,0xc(%rsp)
addss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
movss  0xd05(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
movss  %xmm1,0x8(%rsp)
addss  %xmm1,%xmm0
divss  0xcd5(%rip),%xmm0
movss  %xmm0,(%rsp)
lea    0xce7(%rip),%rdi
call   1030 <printf@plt>
movss  0x20(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1378 <main+0x258>
lea    0xd10(%rip),%rdi
call   1030 <printf@plt>
movss  0x2c(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1390 <main+0x270>
lea    0xcf8(%rip),%rdi
call   1030 <printf@plt>
movss  0x28(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    13a8 <main+0x288>
lea    0xce0(%rip),%rdi
call   1030 <printf@plt>
movss  0x24(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    13c0 <main+0x2a0>
lea    0xcc8(%rip),%rdi
call   1030 <printf@plt>
movss  0x1c(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    13d8 <main+0x2b8>
lea    0xcb0(%rip),%rdi
call   1030 <printf@plt>
movss  0x18(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    13f0 <main+0x2d0>
lea    0xc98(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1408 <main+0x2e8>
lea    0xc80(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1420 <main+0x300>
lea    0xc68(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1438 <main+0x318>
lea    0xc50(%rip),%rdi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
ucomiss (%rsp),%xmm0
jbe    1450 <main+0x330>
lea    0xc38(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Ingresa el %d numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [65 x i8] c"\0ALa media es %.2f, imprimiendo numeros que son mayores a esta: \0A\00"
@.str.3 = [32 x i8] c"\09Numero mayor a la media: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store i32 0, i32* %5
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = sitofp i32 %12 to float
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %13)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%16 = load float, float* %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %18
store float %16, float* %19
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fadd float %21, %20
store float %22, float* %3
br label %23
23: ; preds = %10
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
%27 = load float, float* %3
%28 = fdiv float %27, 1.000000e+01
store float %28, float* %3
%29 = load float, float* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), float %29)
store i32 0, i32* %6
br label %31
31: ; preds = %48, %26
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 10
br i1 %33, label %34, label %51
34: ; preds = %31
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %36
%38 = load float, float* %37
%39 = load float, float* %3
%40 = fcmp ogt float %38, %39
br i1 %40, label %41, label %47
41: ; preds = %34
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %43
%45 = load float, float* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %45)
br label %47
47: ; preds = %41, %34
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %31
51: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Ingresa el %d numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [65 x i8] c"\0ALa media es %.2f, imprimiendo numeros que son mayores a esta: \0A\00"
@.str.3 = [32 x i8] c"\09Numero mayor a la media: %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fadd float %5, 0.000000e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = load float, float* %1
%10 = fadd float %6, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = load float, float* %1
%14 = fadd float %10, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%17 = load float, float* %1
%18 = fadd float %14, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%21 = load float, float* %1
%22 = fadd float %18, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 6.000000e+00)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%25 = load float, float* %1
%26 = fadd float %22, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 7.000000e+00)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%29 = load float, float* %1
%30 = fadd float %26, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 8.000000e+00)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%33 = load float, float* %1
%34 = fadd float %30, %33
%35 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 9.000000e+00)
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%37 = load float, float* %1
%38 = fadd float %34, %37
%39 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 1.000000e+01)
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%41 = load float, float* %1
%42 = fadd float %38, %41
%43 = fdiv float %42, 1.000000e+01
%44 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), float %43)
%45 = fcmp ogt float %5, %43
br i1 %45, label %46, label %48
46: ; preds = %0
%47 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %5)
br label %48
48: ; preds = %0, %46
%49 = fcmp ogt float %9, %43
br i1 %49, label %50, label %52
50: ; preds = %48
%51 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %9)
br label %52
52: ; preds = %50, %48
%53 = fcmp ogt float %13, %43
br i1 %53, label %54, label %56
54: ; preds = %52
%55 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %13)
br label %56
56: ; preds = %54, %52
%57 = fcmp ogt float %17, %43
br i1 %57, label %58, label %60
58: ; preds = %56
%59 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %17)
br label %60
60: ; preds = %58, %56
%61 = fcmp ogt float %21, %43
br i1 %61, label %62, label %64
62: ; preds = %60
%63 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %21)
br label %64
64: ; preds = %62, %60
%65 = fcmp ogt float %25, %43
br i1 %65, label %66, label %68
66: ; preds = %64
%67 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %25)
br label %68
68: ; preds = %66, %64
%69 = fcmp ogt float %29, %43
br i1 %69, label %70, label %72
70: ; preds = %68
%71 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %29)
br label %72
72: ; preds = %70, %68
%73 = fcmp ogt float %33, %43
br i1 %73, label %74, label %76
74: ; preds = %72
%75 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %33)
br label %76
76: ; preds = %74, %72
%77 = fcmp ogt float %37, %43
br i1 %77, label %78, label %80
78: ; preds = %76
%79 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %37)
br label %80
80: ; preds = %78, %76
%81 = fcmp ogt float %41, %43
br i1 %81, label %82, label %84
82: ; preds = %80
%83 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), float %41)
br label %84
84: ; preds = %82, %80
ret i32 0
}