#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 *, double);
scalar_t__ scanf(char *, double *);
int main() {
  double a[12];
  double average, sum;
  int i;
  while (scanf("%lf", &a[0]) != EOF) {
    sum = a[0];
    for (i = 1; i < 12; i++) {
      scanf("%lf", &a[i]);
      sum += a[i];
    }
    average = sum / 12.0;
    printf("$%.2lf\n", average);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
je     11e8 <main+0xc8>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x84(%rbp)
cmpl   $0xc,-0x84(%rbp)
jge    11bc <main+0x9c>
movslq -0x84(%rbp),%rax
lea    -0x70(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe7c(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x84(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1166 <main+0x46>
movsd  -0x80(%rbp),%xmm0
movsd  0xe37(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
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    $0x78,%rsp
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%r12
cmp    (%r12),%rax
je     12ec <main+0x1cc>
lea    0x60(%rsp),%r13
lea    0x68(%rsp),%rbx
lea    0xea7(%rip),%rbp
lea    0xea4(%rip),%r14
lea    0x10(%rsp),%r15
nopl   (%rax)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x20(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x28(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x30(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x38(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x48(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x50(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
lea    0x58(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x68(%rsp),%xmm0
divsd  0xd31(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x78,%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 = [8 x i8] c"$%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x double]
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %31, %0
%7 = getelementptr inbounds [12 x double], [12 x double]* %2, i64 0, i64 0
%8 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %6
%12 = getelementptr inbounds [12 x double], [12 x double]* %2, i64 0, i64 0
%13 = load double, double* %12
store double %13, double* %4
store i32 1, i32* %5
br label %14
14: ; preds = %28, %11
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 12
br i1 %16, label %17, label %31
17: ; preds = %14
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [12 x double], [12 x double]* %2, i64 0, i64 %19
%21 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %20)
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [12 x double], [12 x double]* %2, i64 0, i64 %23
%25 = load double, double* %24
%26 = load double, double* %4
%27 = fadd double %26, %25
store double %27, double* %4
br label %28
28: ; preds = %17
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %14
31: ; preds = %14
%32 = load double, double* %4
%33 = fdiv double %32, 1.200000e+01
store double %33, double* %3
%34 = load double, double* %3
%35 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %34)
br label %6
36: ; preds = %6
ret i32 0
}

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