#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 *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int loop, i;
  float number, list, maximum, minimum;
  scanf("%d", &loop);
  for (i = 1; i <= loop; i++) {
    scanf("%f", &number);
    list += number;
    if (minimum > number || i == 1)
      minimum = number;
    if (maximum < number || i == 1)
      maximum = number;
  }
  printf("%d Values\n", loop);
  printf("Min: %.3f\n", minimum);
  printf("Max: %.3f\n", maximum);
  printf("Avg: %.3f\n", list / loop);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11d2 <main+0xb2>
lea    0xea8(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
ja     118e <main+0x6e>
cmpl   $0x1,-0xc(%rbp)
jne    1198 <main+0x78>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     11b5 <main+0x95>
cmpl   $0x1,-0xc(%rbp)
jne    11bf <main+0x9f>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11c4 <main+0xa4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11dd <main+0xbd>
lea    0xeb5(%rip),%r14
lea    0xc(%rsp),%rbx
xor    %ebp,%ebp
jmp    11a5 <main+0x85>
nopw   0x0(%rax,%rax,1)
addss  %xmm0,%xmm3
movss  %xmm3,0x8(%rsp)
movaps %xmm0,%xmm5
cmpltss %xmm6,%xmm5
movaps %xmm5,%xmm3
andnps %xmm2,%xmm3
andps  %xmm0,%xmm5
orps   %xmm3,%xmm5
cmpltss %xmm0,%xmm4
movaps %xmm4,%xmm2
andnps %xmm1,%xmm2
andps  %xmm0,%xmm4
orps   %xmm2,%xmm4
movaps %xmm4,0x20(%rsp)
mov    0x4(%rsp),%eax
add    $0x1,%ebp
movss  %xmm5,0x10(%rsp)
cmp    %eax,%ebp
jge    11dd <main+0xbd>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps %xmm0,%xmm2
test   %ebp,%ebp
movss  0x10(%rsp),%xmm6
je     11c8 <main+0xa8>
movaps %xmm6,%xmm2
movaps %xmm0,%xmm1
movss  0x8(%rsp),%xmm3
movaps 0x20(%rsp),%xmm4
je     1160 <main+0x40>
movaps %xmm4,%xmm1
jmp    1160 <main+0x40>
movaps %xmm5,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
lea    0xe15(%rip),%rdi
movaps 0x10(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xe0f(%rip),%rdi
movaps 0x20(%rsp),%xmm0
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl 0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
divss  %xmm1,%xmm0
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"%d Values\0A\00"
@.str.3 = [11 x i8] c"Min: %.3f\0A\00"
@.str.4 = [11 x i8] c"Max: %.3f\0A\00"
@.str.5 = [11 x i8] c"Avg: %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %9
9: ; preds = %36, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %39
13: ; preds = %9
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = load float, float* %4
%16 = load float, float* %5
%17 = fadd float %16, %15
store float %17, float* %5
%18 = load float, float* %7
%19 = load float, float* %4
%20 = fcmp ogt float %18, %19
br i1 %20, label %24, label %21
21: ; preds = %13
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %21, %13
%25 = load float, float* %4
store float %25, float* %7
br label %26
26: ; preds = %24, %21
%27 = load float, float* %6
%28 = load float, float* %4
%29 = fcmp olt float %27, %28
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %30, %26
%34 = load float, float* %4
store float %34, float* %6
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %9
39: ; preds = %9
%40 = load i32, i32* %2
%41 = sitofp i32 %40 to float
%42 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %41)
%43 = load float, float* %7
%44 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), float %43)
%45 = load float, float* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), float %45)
%47 = load float, float* %5
%48 = load i32, i32* %2
%49 = sitofp i32 %48 to float
%50 = fdiv float %47, %49
%51 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), float %50)
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"%d Values\0A\00"
@.str.3 = [11 x i8] c"Min: %.3f\0A\00"
@.str.4 = [11 x i8] c"Max: %.3f\0A\00"
@.str.5 = [11 x i8] c"Avg: %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %26, label %8
8: ; preds = %0, %8
%9 = phi float [ %19, %8 ], [ undef, %0 ]
%10 = phi float [ %22, %8 ], [ undef, %0 ]
%11 = phi float [ %15, %8 ], [ undef, %0 ]
%12 = phi i32 [ %23, %8 ], [ 1, %0 ]
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%14 = load float, float* %2
%15 = fadd float %11, %14
%16 = fcmp ogt float %9, %14
%17 = icmp eq i32 %12, 1
%18 = select i1 %16, i1 true, i1 %17
%19 = select i1 %18, float %14, float %9
%20 = fcmp olt float %10, %14
%21 = select i1 %20, i1 true, i1 %17
%22 = select i1 %21, float %14, float %10
%23 = add nuw nsw i32 %12, 1
%24 = load i32, i32* %1
%25 = icmp slt i32 %12, %24
br i1 %25, label %8, label %26
26: ; preds = %8, %0
%27 = phi float [ undef, %0 ], [ %15, %8 ]
%28 = phi float [ undef, %0 ], [ %22, %8 ]
%29 = phi float [ undef, %0 ], [ %19, %8 ]
%30 = phi i32 [ %6, %0 ], [ %24, %8 ]
%31 = sitofp i32 %30 to float
%32 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), float %29)
%34 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), float %28)
%35 = load i32, i32* %1
%36 = sitofp i32 %35 to float
%37 = fdiv float %27, %36
%38 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), float %37)
ret i32 0
}