#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 *, int, double);
scalar_t__ scanf(char *, float *);
float searching_value(float *, int);
double summation(float *, int);
int main() {
  float number[100];
  int length = 0;
  while (scanf("%f", &number[length]) != EOF) {
    if (length == 0)
      length++;
    else if (number[length] == searching_value(number, length)) {
      length++;
      if (length >= 64)
        break;
    }
  }
  printf("%d\n%.3f", length, summation(number, length));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
movslq -0x1a4(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe88(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e64(%rip),%rcx
cmp    (%rcx),%rax
je     1222 <main+0xe2>
cmpl   $0x0,-0x1a4(%rbp)
jne    11ae <main+0x6e>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    121d <main+0xdd>
movslq -0x1a4(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x1a8(%rbp)
ff
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
call   1040 <searching_value@plt>
movaps %xmm0,%xmm1
movss  -0x1a8(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jne    1218 <main+0xd8>
jp     1218 <main+0xd8>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
cmpl   $0x40,-0x1a4(%rbp)
jl     1213 <main+0xd3>
jmp    1222 <main+0xe2>
jmp    1218 <main+0xd8>
jmp    121d <main+0xdd>
jmp    115c <main+0x1c>
mov    -0x1a4(%rbp),%eax
mov    %eax,-0x1ac(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
call   1060 <summation@plt>
mov    -0x1ac(%rbp),%esi
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a0,%rsp
lea    0xea9(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0x2e7d(%rip),%r13
xor    %r12d,%r12d
cmp    0x0(%r13),%rax
je     11e7 <main+0xa7>
xor    %r12d,%r12d
lea    0xe82(%rip),%r15
mov    %r14,%rbx
jmp    11b2 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%r12d
movslq %r12d,%rax
lea    (%rsp,%rax,4),%rbx
add    $0x10,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
je     11e7 <main+0xa7>
test   %r12d,%r12d
je     1190 <main+0x50>
movss  (%rbx),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14,%rdi
mov    %r12d,%esi
call   1040 <searching_value@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    1196 <main+0x56>
jp     1196 <main+0x56>
lea    0x1(%r12),%eax
cmp    $0x3e,%r12d
mov    %eax,%r12d
jle    1196 <main+0x56>
lea    0x10(%rsp),%rdi
mov    %r12d,%esi
call   1060 <summation@plt>
lea    0xe08(%rip),%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%d\0A%.3f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x float]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %34, %0
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %6
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %35
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %34
17: ; preds = %11
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %19
%21 = load float, float* %20
%22 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 0
%23 = load i32, i32* %3
%24 = call float @searching_value(float* %22, i32 %23)
%25 = fcmp oeq float %21, %24
br i1 %25, label %26, label %33
26: ; preds = %17
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
%29 = load i32, i32* %3
%30 = icmp sge i32 %29, 64
br i1 %30, label %31, label %32
31: ; preds = %26
br label %35
32: ; preds = %26
br label %33
33: ; preds = %32, %17
br label %34
34: ; preds = %33, %14
br label %4
35: ; preds = %31, %4
%36 = load i32, i32* %3
%37 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 0
%38 = load i32, i32* %3
%39 = call double @summation(float* %37, i32 %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %36, double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%d\0A%.3f\00"
define i32 @main() {
%1 = alloca [100 x float]
%2 = bitcast [100 x float]* %1 to i8*
%3 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %25, label %7
7: ; preds = %0, %18
%8 = phi float* [ %21, %18 ], [ %3, %0 ]
%9 = phi i32 [ %19, %18 ], [ 0, %0 ]
%10 = icmp eq i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %7
%12 = load float, float* %8
%13 = call float @searching_value(float* %3, i32 %9)
%14 = fcmp oeq float %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = add nsw i32 %9, 1
%17 = icmp sgt i32 %9, 62
br i1 %17, label %25, label %18
18: ; preds = %7, %11, %15
%19 = phi i32 [ %16, %15 ], [ %9, %11 ], [ 1, %7 ]
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 %20
%22 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %21)
%23 = load i64, i64* @EOF
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %7
25: ; preds = %18, %15, %0
%26 = phi i32 [ 0, %0 ], [ %16, %15 ], [ %19, %18 ]
%27 = call double @summation(float* %3, i32 %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %26, double %27)
ret i32 0
}