#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 printf(char *, double);
int scanf(char *, double *);
int main(int i) {
  double v, s = 0;
  for (i = 0; i < 10 || 0 * printf("%.1lf", s / 2); i++)
    if (scanf("%lf", &v), !i || i == 9)
      s += v;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jl     1179 <main+0x59>
movsd  -0x18(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1189 <main+0x69>
jmp    11e4 <main+0xc4>
lea    0xe7e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x1a(%rbp)
je     11b2 <main+0x92>
cmpl   $0x9,-0x8(%rbp)
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    11c2 <main+0xa2>
jmp    11d1 <main+0xb1>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11d6 <main+0xb6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.1lf\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main(i32 %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fadd double %5, 0.000000e+00
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%16 = load double, double* %2
%17 = fadd double %6, %16
%18 = fmul double %17, 5.000000e-01
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %18)
ret i32 0
}