#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 *);
int main(void) {
  int n, menor, maior, aux, use;
  float media;
  aux = 0;
  media = 0;
  scanf("%d\n", &n);
  while (aux < n) {
    scanf("%d", &use);
    if (aux == 0) {
      menor = use;
      maior = use;
    } else if (use <= menor) {
      menor = use;
    } else if (use >= maior) {
      maior = use;
    }
    media = media + use;
    aux = aux + 1;
  }
  media = media / n;
  printf("%d\n%d\n", menor, maior);
  printf("%.3f\n", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d9 <main+0xb9>
lea    0xe9f(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1185 <main+0x65>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11b8 <main+0x98>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     119c <main+0x7c>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11b3 <main+0x93>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11ae <main+0x8e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11b3 <main+0x93>
jmp    11b8 <main+0x98>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%esi
lea    0xe08(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xdfc(%rip),%rdi
mov    $0x1,%al
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   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xed3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%r12d
cvtsi2ss %r12d,%xmm1
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
jl     11c5 <main+0xa5>
mov    $0x1,%ebx
lea    0xe93(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movss  %xmm1,0x4(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
mov    0x8(%rsp),%eax
cmp    %r12d,%eax
mov    %eax,%ecx
cmovl  %r12d,%ecx
cmp    %ebp,%eax
cmovle %eax,%ebp
cmovg  %ecx,%r12d
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  %xmm0,%xmm1
add    $0x1,%ebx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
jl     1180 <main+0x60>
jmp    11c8 <main+0xa8>
mov    %r12d,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
lea    0xe1c(%rip),%rdi
mov    %r12d,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe12(%rip),%rdi
movss  0x4(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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