#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 */
double DBL_MAX;
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, int /*<<< orphan*/, double, double);
int scanf(char *, double *);
int /*<<< orphan*/ sqrt(double);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  double val, sum = 0, sum2 = 0, min = DBL_MAX, max = 0.0;
  int res, n = 0;
  while (!feof(stdin)) {
    res = scanf("%lf\n", &val);
    if (res == 1) {
      n++;
      sum += val;
      sum2 += val * val;
      if (val < min)
        min = val;
      if (val > max)
        max = val;
    }
  }
  printf("%lf %lf %lf %lf\n", sum / n, sqrt(sum2 / n - (sum / n) * (sum / n)),
         min, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e6b(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a8 <main+0x68>
jmp    123b <main+0xfb>
lea    0xe5d(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jne    1236 <main+0xf6>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1217 <main+0xd7>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1231 <main+0xf1>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1236 <main+0xf6>
jmp    1185 <main+0x45>
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm1
cvtsi2sdl -0x40(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x40(%rbp),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x20(%rbp),%xmm2
cvtsi2sdl -0x40(%rbp),%xmm3
divsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  -0x48(%rbp),%xmm0
mov    %eax,%esi
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
lea    0xd4c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0x2e87(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
mov    0x2e87(%rip),%r15
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     11f1 <main+0xb1>
xor    %ebp,%ebp
xorpd  %xmm3,%xmm3
xorpd  %xmm2,%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  %xmm2,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  0x8(%rsp),%xmm4
divsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%rsp)
divsd  %xmm0,%xmm3
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
call   1060 <sqrt@plt>
lea    0xe34(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    %eax,%esi
movsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
lea    0xe08(%rip),%r14
lea    0x20(%rsp),%rbx
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm4
xorpd  %xmm5,%xmm5
jmp    1253 <main+0x113>
nopl   0x0(%rax,%rax,1)
movsd  %xmm2,0x10(%rsp)
mov    (%r15),%edi
call   1040 <feof@plt>
movsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm4
movsd  0x18(%rsp),%xmm3
movapd %xmm3,%xmm5
test   %eax,%eax
jne    118a <main+0x4a>
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1226 <main+0xe6>
add    $0x1,%ebp
movsd  0x20(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  0x18(%rsp),%xmm3
movapd %xmm2,%xmm1
minsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm4
ucomisd %xmm4,%xmm2
movsd  %xmm0,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm1,(%rsp)
ja     1220 <main+0xe0>
movsd  %xmm4,0x10(%rsp)
jmp    1226 <main+0xe6>

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
@stdin = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [17 x i8] c"%lf %lf %lf %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
%13 = load double, double* @DBL_MAX
store double %13, double* %9
store double 0.000000e+00, double* %10
store i32 0, i32* %12
br label %14
14: ; preds = %45, %2
%15 = load i32, i32* @stdin
%16 = call i32 @feof(i32 %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br i1 %18, label %19, label %46
19: ; preds = %14
%20 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %6)
store i32 %20, i32* %11
%21 = load i32, i32* %11
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %45
23: ; preds = %19
%24 = load i32, i32* %12
%25 = add nsw i32 %24, 1
store i32 %25, i32* %12
%26 = load double, double* %6
%27 = load double, double* %7
%28 = fadd double %27, %26
store double %28, double* %7
%29 = load double, double* %6
%30 = load double, double* %6
%31 = load double, double* %8
%32 = call double @llvm.fmuladd.f64(double %29, double %30, double %31)
store double %32, double* %8
%33 = load double, double* %6
%34 = load double, double* %9
%35 = fcmp olt double %33, %34
br i1 %35, label %36, label %38
36: ; preds = %23
%37 = load double, double* %6
store double %37, double* %9
br label %38
38: ; preds = %36, %23
%39 = load double, double* %6
%40 = load double, double* %10
%41 = fcmp ogt double %39, %40
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = load double, double* %6
store double %43, double* %10
br label %44
44: ; preds = %42, %38
br label %45
45: ; preds = %44, %19
br label %14
46: ; preds = %14
%47 = load double, double* %7
%48 = load i32, i32* %12
%49 = sitofp i32 %48 to double
%50 = fdiv double %47, %49
%51 = load double, double* %8
%52 = load i32, i32* %12
%53 = sitofp i32 %52 to double
%54 = fdiv double %51, %53
%55 = load double, double* %7
%56 = load i32, i32* %12
%57 = sitofp i32 %56 to double
%58 = fdiv double %55, %57
%59 = load double, double* %7
%60 = load i32, i32* %12
%61 = sitofp i32 %60 to double
%62 = fdiv double %59, %61
%63 = fneg double %58
%64 = call double @llvm.fmuladd.f64(double %63, double %62, double %54)
%65 = call i32 @sqrt(double %64)
%66 = load double, double* %9
%67 = load double, double* %10
%68 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %50, i32 %65, double %66, double %67)
ret i32 0
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
@stdin = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [17 x i8] c"%lf %lf %lf %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = load double, double* @DBL_MAX
%6 = load i32, i32* @stdin
%7 = call i32 @feof(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %35
9: ; preds = %2, %26
%10 = phi i32 [ %31, %26 ], [ 0, %2 ]
%11 = phi double [ %30, %26 ], [ 0.000000e+00, %2 ]
%12 = phi double [ %29, %26 ], [ 0.000000e+00, %2 ]
%13 = phi double [ %28, %26 ], [ %5, %2 ]
%14 = phi double [ %27, %26 ], [ 0.000000e+00, %2 ]
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %3)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %26
17: ; preds = %9
%18 = add nsw i32 %10, 1
%19 = load double, double* %3
%20 = fadd double %11, %19
%21 = call double @llvm.fmuladd.f64(double %19, double %19, double %14)
%22 = fcmp olt double %19, %13
%23 = select i1 %22, double %19, double %13
%24 = fcmp ogt double %19, %12
br i1 %24, label %25, label %26
25: ; preds = %17
br label %26
26: ; preds = %17, %25, %9
%27 = phi double [ %21, %25 ], [ %21, %17 ], [ %14, %9 ]
%28 = phi double [ %23, %25 ], [ %23, %17 ], [ %13, %9 ]
%29 = phi double [ %19, %25 ], [ %12, %17 ], [ %12, %9 ]
%30 = phi double [ %20, %25 ], [ %20, %17 ], [ %11, %9 ]
%31 = phi i32 [ %18, %25 ], [ %18, %17 ], [ %10, %9 ]
%32 = load i32, i32* @stdin
%33 = call i32 @feof(i32 %32)
%34 = icmp eq i32 %33, 0
br i1 %34, label %9, label %35
35: ; preds = %26, %2
%36 = phi double [ 0.000000e+00, %2 ], [ %27, %26 ]
%37 = phi double [ %5, %2 ], [ %28, %26 ]
%38 = phi double [ 0.000000e+00, %2 ], [ %29, %26 ]
%39 = phi double [ 0.000000e+00, %2 ], [ %30, %26 ]
%40 = phi i32 [ 0, %2 ], [ %31, %26 ]
%41 = sitofp i32 %40 to double
%42 = fdiv double %39, %41
%43 = fdiv double %36, %41
%44 = fneg double %42
%45 = call double @llvm.fmuladd.f64(double %44, double %42, double %43)
%46 = call i32 @sqrt(double %45)
%47 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %42, i32 %46, double %37, double %38)
ret i32 0
}