#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, double);
int scanf(char *, int *);
int main() {
  int x, n = 0, min, max, s = 0;
  while (scanf("%d", &x) == 1) {
    s += x;
    if (x < min)
      min = x;
    if (x > max)
      max = x;
    n++;
  }
  printf("%d %d %.3lf\n", min, max, (double)s / n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1191 <main+0x71>
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <main+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1183 <main+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
cvtsi2sdl -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%r14
lea    0x4(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
xor    %r12d,%r12d
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%eax
add    %eax,%r12d
cmp    %ebp,%eax
cmovl  %eax,%ebp
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1150 <main+0x30>
cvtsi2sd %r12d,%xmm0
cvtsi2sd %r13d,%xmm1
divsd  %xmm1,%xmm0
lea    0xe79(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"%d %d %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ %11, %5 ], [ 0, %0 ]
%7 = phi i32 [ %15, %5 ], [ undef, %0 ]
%8 = phi i32 [ %13, %5 ], [ undef, %0 ]
%9 = phi i32 [ %16, %5 ], [ 0, %0 ]
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %6
%12 = icmp slt i32 %10, %8
%13 = select i1 %12, i32 %10, i32 %8
%14 = icmp sgt i32 %10, %7
%15 = select i1 %14, i32 %10, i32 %7
%16 = add nuw nsw i32 %9, 1
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%18 = icmp eq i32 %17, 1
br i1 %18, label %5, label %19
19: ; preds = %5
%20 = sitofp i32 %11 to double
%21 = sitofp i32 %16 to double
%22 = fdiv double %20, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15, double %22)
ret i32 0
}