#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 *, double, double, double);
scalar_t__ scanf(char *, double *);
int main() {
  int n = 0;
  double t[20000], med, min = 100, max = -100, soma = 0;
  ;
  while (n < 20000 && scanf("%lf", &t[n]) > 0) {
    n++;
  }
  med = soma / n;
  printf("med = %.3lf, min = %.3lf, max = %.3lf\n", med, min, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x27140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x27120(%rbp)
ff
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x27128(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x27130(%rbp)
ff
xor    %eax,%eax
cmpl   $0x4e20,-0x8(%rbp)
mov    %al,-0x27131(%rbp)
jge    11a4 <main+0x84>
movslq -0x8(%rbp),%rax
lea    -0x27110(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
setg   %al
mov    %al,-0x27131(%rbp)
mov    -0x27131(%rbp),%al
test   $0x1,%al
jne    11b7 <main+0x97>
jmp    11c5 <main+0xa5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x44>
movsd  -0x27130(%rbp),%xmm0
ff
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x27118(%rbp)
ff
movsd  -0x27118(%rbp),%xmm0
ff
movsd  -0x27120(%rbp),%xmm1
ff
movsd  -0x27128(%rbp),%xmm2
ff
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x27140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x27100,%rsp
mov    %rsp,%rbx
xor    %r15d,%r15d
lea    0xedf(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jle    116b <main+0x4b>
add    $0x1,%r15
add    $0x8,%rbx
cmp    $0x4e20,%r15
jne    1140 <main+0x20>
movsd  0xe97(%rip),%xmm1
jmp    1170 <main+0x50>
cvtsi2sd %r15d,%xmm1
xorpd  %xmm0,%xmm0
divsd  %xmm1,%xmm0
lea    0xe9d(%rip),%rdi
movsd  0xe81(%rip),%xmm1
movsd  0xe81(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x27100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [39 x i8] c"med = %.3lf, min = %.3lf, max = %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20000 x double]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store double 1.000000e+02, double* %5
store double -1.000000e+02, double* %6
store double 0.000000e+00, double* %7
br label %8
8: ; preds = %19, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 20000
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [20000 x double], [20000 x double]* %3, i64 0, i64 %13
%15 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %14)
%16 = icmp sgt i64 %15, 0
br label %17
17: ; preds = %11, %8
%18 = phi i1 [ false, %8 ], [ %16, %11 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %8
22: ; preds = %17
%23 = load double, double* %7
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to double
%26 = fdiv double %23, %25
store double %26, double* %4
%27 = load double, double* %4
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %27, double %28, double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [39 x i8] c"med = %.3lf, min = %.3lf, max = %.3lf\0A\00"
define i32 @main() {
%1 = alloca [20000 x double]
%2 = bitcast [20000 x double]* %1 to i8*
br label %3
3: ; preds = %0, %8
%4 = phi i64 [ 0, %0 ], [ %9, %8 ]
%5 = getelementptr inbounds [20000 x double], [20000 x double]* %1, i64 0, i64 %4
%6 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 20000
br i1 %10, label %14, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
%13 = sitofp i32 %12 to double
br label %14
14: ; preds = %8, %11
%15 = phi double [ %13, %11 ], [ 2.000000e+04, %8 ]
%16 = fdiv double 0.000000e+00, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %16, double 1.000000e+02, double -1.000000e+02)
ret i32 0
}