#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 /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float array[10] = {};
  int i, count = 0;
  float average = 0, sum = 0;
  for (i = 0; i < 10; i++) {
    scanf("%f", &array[i]);
  }
  for (i = 0; i < 10; i++) {
    sum = sum + array[i];
  }
  average = sum / 10;
  for (i = 0; i < 10; i++) {
    if (array[i] > average)
      count += 1;
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11a0 <main+0x70>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe77(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116d <main+0x3d>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11d3 <main+0xa3>
movss  -0x40(%rbp),%xmm0
movslq -0x34(%rbp),%rax
addss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a7 <main+0x77>
movss  -0x40(%rbp),%xmm0
movss  0xe20(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    122a <main+0xfa>
movslq -0x34(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
ucomiss -0x3c(%rbp),%xmm0
jbe    1217 <main+0xe7>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    121c <main+0xec>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11f0 <main+0xc0>
mov    -0x38(%rbp),%esi
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeb5(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
xorps  %xmm2,%xmm2
addss  %xmm0,%xmm2
movaps %xmm0,%xmm3
shufps $0x55,%xmm0,%xmm3
addss  %xmm2,%xmm3
movaps %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
addss  %xmm3,%xmm2
movaps %xmm0,%xmm3
shufps $0xff,%xmm0,%xmm3
addss  %xmm2,%xmm3
addss  %xmm1,%xmm3
movaps %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
addss  %xmm3,%xmm2
movaps %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
addss  %xmm2,%xmm3
movaps %xmm1,%xmm2
shufps $0xff,%xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0x20(%rsp),%xmm3
addss  %xmm3,%xmm2
movss  0x24(%rsp),%xmm4
addss  %xmm4,%xmm2
divss  0xdc3(%rip),%xmm2
xor    %eax,%eax
ucomiss %xmm2,%xmm3
seta   %al
xor    %ecx,%ecx
ucomiss %xmm2,%xmm4
shufps $0x0,%xmm2,%xmm2
seta   %cl
movaps %xmm2,%xmm3
cmpltps %xmm1,%xmm3
cmpltps %xmm0,%xmm2
packssdw %xmm3,%xmm2
packsswb %xmm2,%xmm2
pmovmskb %xmm2,%edx
mov    %edx,%ebx
shr    %bl
and    $0x55,%bl
sub    %bl,%dl
mov    %edx,%ebx
and    $0x33,%bl
shr    $0x2,%dl
and    $0x33,%dl
add    %bl,%dl
mov    %edx,%ebx
shr    $0x4,%bl
add    %dl,%bl
and    $0xf,%bl
movzbl %bl,%esi
add    %eax,%esi
add    %ecx,%esi
lea    0xd71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %9)
%11 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %11)
%13 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %13)
%15 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %17)
%19 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %21)
%23 = bitcast [10 x float]* %1 to <8 x float>*
%24 = load <8 x float>, <8 x float>* %23
%25 = extractelement <8 x float> %24, i64 0
%26 = fadd float %25, 0.000000e+00
%27 = extractelement <8 x float> %24, i64 1
%28 = fadd float %26, %27
%29 = extractelement <8 x float> %24, i64 2
%30 = fadd float %28, %29
%31 = extractelement <8 x float> %24, i64 3
%32 = fadd float %30, %31
%33 = extractelement <8 x float> %24, i64 4
%34 = fadd float %32, %33
%35 = extractelement <8 x float> %24, i64 5
%36 = fadd float %34, %35
%37 = extractelement <8 x float> %24, i64 6
%38 = fadd float %36, %37
%39 = extractelement <8 x float> %24, i64 7
%40 = fadd float %38, %39
%41 = load float, float* %19
%42 = fadd float %40, %41
%43 = load float, float* %21
%44 = fadd float %42, %43
%45 = fdiv float %44, 1.000000e+01
%46 = insertelement <8 x float> poison, float %45, i64 0
%47 = shufflevector <8 x float> %46, <8 x float> poison, <8 x i32> zeroinitializer
%48 = fcmp ogt <8 x float> %24, %47
%49 = fcmp ogt float %41, %45
%50 = zext i1 %49 to i32
%51 = fcmp ogt float %43, %45
%52 = zext i1 %51 to i32
%53 = bitcast <8 x i1> %48 to i8
%54 = call i8 @llvm.ctpop.i8(i8 %53)
%55 = zext i8 %54 to i32
%56 = add nuw nsw i32 %55, %50
%57 = add nuw nsw i32 %56, %52
%58 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %57)
ret i32 0
}