#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 EOF;
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ stdin;
int main(void) {
  double distancia, distanciaTotal = 0;
  int caractere, quantidade = 0;
  while (caractere = getc(stdin), caractere != EOF) {
    while (caractere != '\n') {
      caractere = getc(stdin);
    }
    scanf("%lf\n", &distancia);
    distanciaTotal += distancia;
    quantidade++;
  }
  printf("%.1f\n", distanciaTotal / quantidade);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%eax
je     11c3 <main+0x93>
jmp    1176 <main+0x46>
cmpl   $0xa,-0x1c(%rbp)
je     1196 <main+0x66>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x1c(%rbp)
jmp    1176 <main+0x46>
lea    0xe63(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114e <main+0x1e>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xe2d(%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   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
call   1050 <getc@plt>
mov    0x2e8f(%rip),%r12
cmp    (%r12),%eax
jne    1161 <main+0x31>
movsd  0xea1(%rip),%xmm0
jmp    11cb <main+0x9b>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xor    %ebp,%ebp
lea    0xe95(%rip),%r14
lea    0x8(%rsp),%r15
jmp    1187 <main+0x57>
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1050 <getc@plt>
cmp    $0xa,%eax
jne    1180 <main+0x50>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
add    $0x1,%ebp
mov    (%rbx),%edi
call   1050 <getc@plt>
cmp    (%r12),%eax
jne    1187 <main+0x57>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i32 @getc(i32 %3)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %28, label %7
7: ; preds = %0, %16
%8 = phi i32 [ %22, %16 ], [ %4, %0 ]
%9 = phi i32 [ %20, %16 ], [ 0, %0 ]
%10 = phi double [ %19, %16 ], [ 0.000000e+00, %0 ]
%11 = icmp eq i32 %8, 10
br i1 %11, label %16, label %12
12: ; preds = %7, %12
%13 = load i32, i32* @stdin
%14 = call i32 @getc(i32 %13)
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %12
16: ; preds = %12, %7
%17 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %1)
%18 = load double, double* %1
%19 = fadd double %10, %18
%20 = add nuw nsw i32 %9, 1
%21 = load i32, i32* @stdin
%22 = call i32 @getc(i32 %21)
%23 = load i32, i32* @EOF
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %7
25: ; preds = %16
%26 = sitofp i32 %20 to double
%27 = fdiv double %19, %26
br label %28
28: ; preds = %25, %0
%29 = phi double [ %27, %25 ], [ 0x7FF8000000000000, %0 ]
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %29)
ret i32 0
}