#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 *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double sum = 0;
  double b = 0;
  int i;
  for (i = 0; i < 12; i++) {
    scanf("%lf", &b);
    sum += b;
  }
  printf("$%.2f", sum / 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jge    117d <main+0x5d>
lea    0xeb1(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <main+0x26>
movsd  -0x10(%rbp),%xmm0
movsd  0xe76(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0xed1(%rip),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
xorpd  %xmm0,%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
divsd  0xd68(%rip),%xmm0
lea    0xd6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"$%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 12
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = load double, double* %3
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
br label %13
13: ; preds = %8
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load double, double* %2
%18 = fdiv double %17, 1.200000e+01
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"$%.2f\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fadd double %4, 0.000000e+00
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%7 = load double, double* %1
%8 = fadd double %5, %7
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%10 = load double, double* %1
%11 = fadd double %8, %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%13 = load double, double* %1
%14 = fadd double %11, %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%16 = load double, double* %1
%17 = fadd double %14, %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%19 = load double, double* %1
%20 = fadd double %17, %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%22 = load double, double* %1
%23 = fadd double %20, %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%25 = load double, double* %1
%26 = fadd double %23, %25
%27 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%28 = load double, double* %1
%29 = fadd double %26, %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%31 = load double, double* %1
%32 = fadd double %29, %31
%33 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%34 = load double, double* %1
%35 = fadd double %32, %34
%36 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%37 = load double, double* %1
%38 = fadd double %35, %37
%39 = fdiv double %38, 1.200000e+01
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %39)
ret i32 0
}