#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *, double);
scalar_t__ scanf(char *, ...);
int /*<<< orphan*/ sort(double *, int);
int main(int argc, const char *argv[]) {
  char name[40];
  int i;
  double s[7], sum, avg;
  while (scanf("%lf", &s[0]) != EOF) {
    sum = 0;
    for (i = 1; i < 7; i++) {
      scanf("%lf", &s[i]);
    }
    scanf("%s", name);
    sort(s, 7);
    for (i = 1; i < 6; i++) {
      sum += s[i];
    }
    avg = sum / 5.0;
    printf("%s %.2lf\n", name, avg);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
je     1244 <main+0x114>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movl   $0x1,-0x44(%rbp)
cmpl   $0x7,-0x44(%rbp)
jge    11b2 <main+0x82>
movslq -0x44(%rbp),%rax
lea    -0x80(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    117d <main+0x4d>
lea    -0x40(%rbp),%rsi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x7,%esi
call   1040 <sort@plt>
movl   $0x1,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jge    120b <main+0xdb>
movslq -0x44(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11d9 <main+0xa9>
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xde5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
lea    -0x40(%rbp),%rsi
movsd  -0x90(%rbp),%xmm0
ff
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rbp
cmp    0x0(%rbp),%rax
je     1244 <main+0x114>
lea    0xea9(%rip),%r14
lea    0xea6(%rip),%r15
lea    0x40(%rsp),%r12
mov    %rsp,%r13
lea    0xe9a(%rip),%rbx
nopl   (%rax)
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
lea    0x28(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r13,%rdi
mov    $0x7,%esi
call   1040 <sort@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe06(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
divsd  0xdde(%rip),%xmm0
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"%s %.2lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = alloca [7 x double]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = bitcast [7 x double]* %4 to i8*
%7 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 0
%8 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %42, label %11
11: ; preds = %2
%12 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 1
%13 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 2
%14 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 3
%15 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 4
%16 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 5
%17 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 6
br label %18
18: ; preds = %11, %18
%19 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %12)
%20 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %13)
%21 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %14)
%22 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %15)
%23 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %16)
%24 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %17)
%25 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%26 = call i32 @sort(double* %7, i32 7)
%27 = load double, double* %12
%28 = fadd double %27, 0.000000e+00
%29 = load double, double* %13
%30 = fadd double %28, %29
%31 = load double, double* %14
%32 = fadd double %30, %31
%33 = load double, double* %15
%34 = fadd double %32, %33
%35 = load double, double* %16
%36 = fadd double %34, %35
%37 = fdiv double %36, 5.000000e+00
%38 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %5, double %37)
%39 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%40 = load i64, i64* @EOF
%41 = icmp eq i64 %39, %40
br i1 %41, label %42, label %18
42: ; preds = %18, %2
ret i32 0
}