#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() {
  int i;
  float ave, dis, sum = 0.0, data[10];
  for (i = 0; i < 10; i++) {
    scanf("%f", &data[i]);
    sum += data[i];
  }
  ave = sum / 10.0;
  printf("Average = %.2f\n", ave);
  for (i = 0; i < 10; i++) {
    dis = (data[i] - ave) * (data[i] - ave);
    printf("Distributed[%d] = %.2f\n", i + 1, dis);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1185 <main+0x65>
movslq -0x8(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1219 <main+0xf9>
movslq -0x8(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
subss  -0xc(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe17(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bd <main+0x9d>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed8(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x1c(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x20(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x28(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x2c(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x30(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x34(%rsp),%xmm0
divss  0xd9f(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
cvttss2si %xmm0,%esi
lea    0xd95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd83(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x18(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x1c(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x20(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x24(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x28(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x2c(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x30(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x34(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [16 x i8] c"Average = %.2f\0A\00"
@.str.2 = [24 x i8] c"Distributed[%d] = %.2f\0A\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 = load float, float* %3
%6 = fadd float %5, 0.000000e+00
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = load float, float* %7
%10 = fadd float %6, %9
%11 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %11)
%13 = load float, float* %11
%14 = fadd float %10, %13
%15 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = load float, float* %15
%18 = fadd float %14, %17
%19 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = load float, float* %19
%22 = fadd float %18, %21
%23 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %23)
%25 = load float, float* %23
%26 = fadd float %22, %25
%27 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %27)
%29 = load float, float* %27
%30 = fadd float %26, %29
%31 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %31)
%33 = load float, float* %31
%34 = fadd float %30, %33
%35 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %35)
%37 = load float, float* %35
%38 = fadd float %34, %37
%39 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %39)
%41 = load float, float* %39
%42 = fadd float %38, %41
%43 = fdiv float %42, 1.000000e+01
%44 = fptosi float %43 to i32
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%46 = load float, float* %3
%47 = fsub float %46, %43
%48 = fmul float %47, %47
%49 = fpext float %48 to double
%50 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, double %49)
%51 = load float, float* %7
%52 = fsub float %51, %43
%53 = fmul float %52, %52
%54 = fpext float %53 to double
%55 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 2, double %54)
%56 = load float, float* %11
%57 = fsub float %56, %43
%58 = fmul float %57, %57
%59 = fpext float %58 to double
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 3, double %59)
%61 = load float, float* %15
%62 = fsub float %61, %43
%63 = fmul float %62, %62
%64 = fpext float %63 to double
%65 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 4, double %64)
%66 = load float, float* %19
%67 = fsub float %66, %43
%68 = fmul float %67, %67
%69 = fpext float %68 to double
%70 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 5, double %69)
%71 = load float, float* %23
%72 = fsub float %71, %43
%73 = fmul float %72, %72
%74 = fpext float %73 to double
%75 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 6, double %74)
%76 = load float, float* %27
%77 = fsub float %76, %43
%78 = fmul float %77, %77
%79 = fpext float %78 to double
%80 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 7, double %79)
%81 = load float, float* %31
%82 = fsub float %81, %43
%83 = fmul float %82, %82
%84 = fpext float %83 to double
%85 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 8, double %84)
%86 = load float, float* %35
%87 = fsub float %86, %43
%88 = fmul float %87, %87
%89 = fpext float %88 to double
%90 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 9, double %89)
%91 = load float, float* %39
%92 = fsub float %91, %43
%93 = fmul float %92, %92
%94 = fpext float %93 to double
%95 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 10, double %94)
ret i32 0
}