#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;
double DBL_MIN;
int getline(char **, size_t *, int /*<<< orphan*/);
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
int sscanf(char *, char *, double *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  double min = DBL_MAX;
  double max = DBL_MIN;
  double sum = 0;
  double sum2 = 0;
  int count = 0;
  int bad = 0;
  char *line = NULL;
  size_t len = 0;
  double in = 0;
  while (getline(&line, &len, stdin) != -1) {
    if (sscanf(line, "%lf", &in) != 1) {
      bad++;
      continue;
    }
    if (in < min)
      min = in;
    if (in > max)
      max = in;
    sum += in;
    sum2 += in * in;
    count += 1;
  }
  double avg = sum / count;
  double var = sum2 / count - pow(avg, 2);
  double std = sqrt(var);
  printf("cnt:\t%d\n", count);
  printf("bad:\t%d\n", bad);
  printf("sum:\t%.8g\n", sum);
  printf("min:\t%.8g\n", min);
  printf("max:\t%.8g\n", max);
  printf("avg:\t%.8g\n", avg);
  printf("var:\t%.8g\n", var);
  printf("std:\t%.8g\n", std);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e6b(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e53(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x2e25(%rip),%rax
mov    (%rax),%edx
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
je     1277 <main+0x127>
mov    -0x40(%rbp),%rdi
lea    0xe1a(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1206 <main+0xb6>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11bc <main+0x6c>
movsd  -0x50(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1224 <main+0xd4>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    123e <main+0xee>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11bc <main+0x6c>
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm0
lea    0xd2c(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x38(%rbp),%xmm0
lea    0xd24(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xd1c(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xd16(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xd10(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm0
lea    0xd0a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x60(%rbp),%xmm0
lea    0xd04(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xcfe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    0x2e73(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    0x2e5a(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x38(%rsp)
movq   $0x0,0x40(%rsp)
movq   $0x0,0x50(%rsp)
movq   $0x0,0x48(%rsp)
mov    0x2e46(%rip),%r13
mov    0x0(%r13),%edx
lea    0x40(%rsp),%rdi
lea    0x50(%rsp),%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
je     12dc <main+0x18c>
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0xe38(%rip),%r14
lea    0x48(%rsp),%r15
lea    0x40(%rsp),%r12
lea    0x50(%rsp),%rbx
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
mov    0x40(%rsp),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1241 <main+0xf1>
add    $0x1,%ebp
mov    0x0(%r13),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
jne    1210 <main+0xc0>
jmp    12c2 <main+0x172>
movsd  0x48(%rsp),%xmm0
movapd %xmm0,%xmm1
minsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x30(%rsp)
movapd %xmm0,%xmm1
maxsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
mulsd  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
addl   $0x1,0x20(%rsp)
mov    0x0(%r13),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <getline@plt>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
cmp    $0xffffffff,%eax
jne    1210 <main+0xc0>
jmp    12f8 <main+0x1a8>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
jmp    12f8 <main+0x1a8>
movl   $0x0,0x20(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
xor    %ebp,%ebp
xorps  %xmm1,%xmm1
cvtsi2sdl 0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd 0xcb9(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
jb     135e <main+0x20e>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
jmp    1369 <main+0x219>
call   1070 <sqrt@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
lea    0xc96(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
lea    0xc8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xc89(%rip),%rdi
movsd  0x28(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xc82(%rip),%rdi
movsd  0x30(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xc7b(%rip),%rdi
movsd  0x38(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xc74(%rip),%rdi
movsd  0x20(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xc6d(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xc66(%rip),%rdi
movsd  0x18(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"cnt:\09%d\0A\00"
@.str.2 = [9 x i8] c"bad:\09%d\0A\00"
@.str.3 = [11 x i8] c"sum:\09%.8g\0A\00"
@.str.4 = [11 x i8] c"min:\09%.8g\0A\00"
@.str.5 = [11 x i8] c"max:\09%.8g\0A\00"
@.str.6 = [11 x i8] c"avg:\09%.8g\0A\00"
@.str.7 = [11 x i8] c"var:\09%.8g\0A\00"
@.str.8 = [11 x i8] c"std:\09%.8g\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 i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load double, double* @DBL_MAX
store double %18, double* %6
%19 = load double, double* @DBL_MIN
store double %19, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i8* null, i8** %12
store i64 0, i64* %13
store double 0.000000e+00, double* %14
br label %20
20: ; preds = %43, %28, %2
%21 = load i32, i32* @stdin
%22 = call i32 @getline(i8** %12, i64* %13, i32 %21)
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %53
24: ; preds = %20
%25 = load i8*, i8** %12
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %14)
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %11
%30 = add nsw i32 %29, 1
store i32 %30, i32* %11
br label %20
31: ; preds = %24
%32 = load double, double* %14
%33 = load double, double* %6
%34 = fcmp olt double %32, %33
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = load double, double* %14
store double %36, double* %6
br label %37
37: ; preds = %35, %31
%38 = load double, double* %14
%39 = load double, double* %7
%40 = fcmp ogt double %38, %39
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = load double, double* %14
store double %42, double* %7
br label %43
43: ; preds = %41, %37
%44 = load double, double* %14
%45 = load double, double* %8
%46 = fadd double %45, %44
store double %46, double* %8
%47 = load double, double* %14
%48 = load double, double* %14
%49 = load double, double* %9
%50 = call double @llvm.fmuladd.f64(double %47, double %48, double %49)
store double %50, double* %9
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
br label %20
53: ; preds = %20
%54 = load double, double* %8
%55 = load i32, i32* %10
%56 = sitofp i32 %55 to double
%57 = fdiv double %54, %56
store double %57, double* %15
%58 = load double, double* %9
%59 = load i32, i32* %10
%60 = sitofp i32 %59 to double
%61 = fdiv double %58, %60
%62 = load double, double* %15
%63 = call double @pow(double %62, i32 2)
%64 = fsub double %61, %63
store double %64, double* %16
%65 = load double, double* %16
%66 = call double @sqrt(double %65)
store double %66, double* %17
%67 = load i32, i32* %10
%68 = sitofp i32 %67 to double
%69 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %68)
%70 = load i32, i32* %11
%71 = sitofp i32 %70 to double
%72 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %71)
%73 = load double, double* %8
%74 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %73)
%75 = load double, double* %6
%76 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %75)
%77 = load double, double* %7
%78 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %77)
%79 = load double, double* %15
%80 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %79)
%81 = load double, double* %16
%82 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), double %81)
%83 = load double, double* %17
%84 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), double %83)
%85 = load i32, i32* %3
ret i32 %85
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@stdin = global i32 0
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"cnt:\09%d\0A\00"
@.str.2 = [9 x i8] c"bad:\09%d\0A\00"
@.str.3 = [11 x i8] c"sum:\09%.8g\0A\00"
@.str.4 = [11 x i8] c"min:\09%.8g\0A\00"
@.str.5 = [11 x i8] c"max:\09%.8g\0A\00"
@.str.6 = [11 x i8] c"avg:\09%.8g\0A\00"
@.str.7 = [11 x i8] c"var:\09%.8g\0A\00"
@.str.8 = [11 x i8] c"std:\09%.8g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca double
%6 = load double, double* @DBL_MAX
%7 = load double, double* @DBL_MIN
%8 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%9 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%10 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%11 = load i32, i32* @stdin
%12 = call i32 @getline(i8** %3, i64* %4, i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %43, label %14
14: ; preds = %2, %31
%15 = phi double [ %34, %31 ], [ %6, %2 ]
%16 = phi double [ %36, %31 ], [ %7, %2 ]
%17 = phi double [ %37, %31 ], [ 0.000000e+00, %2 ]
%18 = phi i32 [ %22, %31 ], [ 0, %2 ]
%19 = phi i32 [ %39, %31 ], [ 0, %2 ]
%20 = phi double [ %38, %31 ], [ 0.000000e+00, %2 ]
br label %21
21: ; preds = %14, %26
%22 = phi i32 [ %18, %14 ], [ %27, %26 ]
%23 = load i8*, i8** %3
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%25 = icmp eq i32 %24, 1
br i1 %25, label %31, label %26
26: ; preds = %21
%27 = add nsw i32 %22, 1
%28 = load i32, i32* @stdin
%29 = call i32 @getline(i8** %3, i64* %4, i32 %28)
%30 = icmp eq i32 %29, -1
br i1 %30, label %43, label %21
31: ; preds = %21
%32 = load double, double* %5
%33 = fcmp olt double %32, %15
%34 = select i1 %33, double %32, double %15
%35 = fcmp ogt double %32, %16
%36 = select i1 %35, double %32, double %16
%37 = fadd double %17, %32
%38 = call double @llvm.fmuladd.f64(double %32, double %32, double %20)
%39 = add nuw nsw i32 %19, 1
%40 = load i32, i32* @stdin
%41 = call i32 @getline(i8** %3, i64* %4, i32 %40)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %14
43: ; preds = %31, %26, %2
%44 = phi double [ 0.000000e+00, %2 ], [ %20, %26 ], [ %38, %31 ]
%45 = phi i32 [ 0, %2 ], [ %19, %26 ], [ %39, %31 ]
%46 = phi double [ 0.000000e+00, %2 ], [ %17, %26 ], [ %37, %31 ]
%47 = phi double [ %7, %2 ], [ %16, %26 ], [ %36, %31 ]
%48 = phi double [ %6, %2 ], [ %15, %26 ], [ %34, %31 ]
%49 = phi i32 [ 0, %2 ], [ %27, %26 ], [ %22, %31 ]
%50 = sitofp i32 %45 to double
%51 = fdiv double %46, %50
%52 = fdiv double %44, %50
%53 = call double @pow(double %51, i32 2)
%54 = fsub double %52, %53
%55 = call double @sqrt(double %54)
%56 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %50)
%57 = sitofp i32 %49 to double
%58 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %46)
%60 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %48)
%61 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %47)
%62 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %51)
%63 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), double %54)
%64 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), double %55)
ret i32 0
}