#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*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, float, float);
int sscanf(char *, char *, int *, float *, float *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int message_size = 0;
  float total_lat = 0.0;
  float ind_lat = 0.0;
  float ind_ave, total_ave;
  int i;
  int ret = 0;
  char char_buffer[256];
  while (1) {
    ind_ave = 0.0;
    total_ave = 0.0;
    for (i = 0; i < 5; i++) {
      if (fgets(char_buffer, 254, stdin) == NULL) {
        return (0);
      }
      ret = sscanf(char_buffer, "%d\t%f\t%f", &message_size, &total_lat,
                   &ind_lat);
      ind_ave += ind_lat;
      total_ave += total_lat;
      if (ret < 3) {
        fprintf(stderr, "parse error.\n");
        return (-1);
      }
    }
    ind_ave /= 5.0;
    total_ave /= 5.0;
    printf("%d %f %f (size,total,ind)\n", message_size, total_ave, ind_ave);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    1246 <main+0x106>
lea    -0x130(%rbp),%rdi
mov    0x2e42(%rip),%rax
mov    (%rax),%edx
mov    $0xfe,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    11c8 <main+0x88>
movl   $0x0,-0x4(%rbp)
jmp    12a0 <main+0x160>
lea    -0x130(%rbp),%rdi
lea    0xe32(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <sscanf@plt>
mov    %eax,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1233 <main+0xf3>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xdef(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a0 <main+0x160>
jmp    1238 <main+0xf8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    118e <main+0x4e>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xda9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x14(%rbp),%esi
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
lea    0xd89(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x37>
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
mov    0x2e78(%rip),%r14
mov    (%r14),%edx
lea    0x20(%rsp),%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
xor    %ecx,%ecx
test   %rax,%rax
je     1396 <main+0x256>
lea    0xe70(%rip),%r15
lea    0x20(%rsp),%rbp
lea    0x1c(%rsp),%r12
lea    0x18(%rsp),%r13
lea    0x14(%rsp),%rbx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jle    137c <main+0x23c>
movss  0x18(%rsp),%xmm1
xorps  %xmm0,%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
movss  0x14(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1378 <main+0x238>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jl     137c <main+0x23c>
movss  0x10(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1378 <main+0x238>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jl     137c <main+0x23c>
movss  0x10(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1378 <main+0x238>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jl     137c <main+0x23c>
movss  0x10(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1378 <main+0x238>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jl     137c <main+0x23c>
movss  0x10(%rsp),%xmm2
addss  0x18(%rsp),%xmm2
movss  0xc(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xcbc(%rip),%xmm0
divss  %xmm0,%xmm1
divss  %xmm0,%xmm2
mov    0x1c(%rsp),%esi
lea    0xcc4(%rip),%rdi
movaps %xmm2,%xmm0
call   1030 <printf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    11a8 <main+0x68>
xor    %ecx,%ecx
jmp    1396 <main+0x256>
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
lea    0xc81(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%ecx
mov    %ecx,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [9 x i8] c"%d\09%f\09%f\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"parse error.\0A\00"
@.str.2 = [27 x i8] c"%d %f %f (size,total,ind)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
store i32 0, i32* %12
br label %14
14: ; preds = %2, %42
store float 0.000000e+00, float* %9
store float 0.000000e+00, float* %10
store i32 0, i32* %11
br label %15
15: ; preds = %39, %14
%16 = load i32, i32* %11
%17 = icmp slt i32 %16, 5
br i1 %17, label %18, label %42
18: ; preds = %15
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%20 = load i32, i32* @stdin
%21 = call i32* @fgets(i8* %19, i32 254, i32 %20)
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 0, i32* %3
br label %55
24: ; preds = %18
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %6, float* %7, float* %8)
store i32 %26, i32* %12
%27 = load float, float* %8
%28 = load float, float* %9
%29 = fadd float %28, %27
store float %29, float* %9
%30 = load float, float* %7
%31 = load float, float* %10
%32 = fadd float %31, %30
store float %32, float* %10
%33 = load i32, i32* %12
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %38
35: ; preds = %24
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %55
38: ; preds = %24
br label %39
39: ; preds = %38
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %15
42: ; preds = %15
%43 = load float, float* %9
%44 = fpext float %43 to double
%45 = fdiv double %44, 5.000000e+00
%46 = fptrunc double %45 to float
store float %46, float* %9
%47 = load float, float* %10
%48 = fpext float %47 to double
%49 = fdiv double %48, 5.000000e+00
%50 = fptrunc double %49 to float
store float %50, float* %10
%51 = load i32, i32* %6
%52 = load float, float* %10
%53 = load float, float* %9
%54 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %51, float %52, float %53)
br label %14
55: ; preds = %35, %23
%56 = load i32, i32* %3
ret i32 %56
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [9 x i8] c"%d\09%f\09%f\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"parse error.\0A\00"
@.str.2 = [27 x i8] c"%d %f %f (size,total,ind)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca [256 x i8]
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast float* %4 to i8*
store float 0.000000e+00, float* %4
%9 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32* @fgets(i8* %10, i32 254, i32 %11)
%13 = icmp eq i32* %12, null
br i1 %13, label %76, label %14
14: ; preds = %2, %64
%15 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, float* %4, float* %5)
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %20
17: ; preds = %61, %50, %39, %28, %14
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %76
20: ; preds = %14
%21 = load float, float* %4
%22 = fadd float %21, 0.000000e+00
%23 = load float, float* %5
%24 = fadd float %23, 0.000000e+00
%25 = load i32, i32* @stdin
%26 = call i32* @fgets(i8* %10, i32 254, i32 %25)
%27 = icmp eq i32* %26, null
br i1 %27, label %76, label %28
28: ; preds = %20
%29 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, float* %4, float* %5)
%30 = icmp slt i32 %29, 3
br i1 %30, label %17, label %31
31: ; preds = %28
%32 = load float, float* %4
%33 = fadd float %22, %32
%34 = load float, float* %5
%35 = fadd float %24, %34
%36 = load i32, i32* @stdin
%37 = call i32* @fgets(i8* %10, i32 254, i32 %36)
%38 = icmp eq i32* %37, null
br i1 %38, label %76, label %39
39: ; preds = %31
%40 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, float* %4, float* %5)
%41 = icmp slt i32 %40, 3
br i1 %41, label %17, label %42
42: ; preds = %39
%43 = load float, float* %4
%44 = fadd float %33, %43
%45 = load float, float* %5
%46 = fadd float %35, %45
%47 = load i32, i32* @stdin
%48 = call i32* @fgets(i8* %10, i32 254, i32 %47)
%49 = icmp eq i32* %48, null
br i1 %49, label %76, label %50
50: ; preds = %42
%51 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, float* %4, float* %5)
%52 = icmp slt i32 %51, 3
br i1 %52, label %17, label %53
53: ; preds = %50
%54 = load float, float* %4
%55 = fadd float %44, %54
%56 = load float, float* %5
%57 = fadd float %46, %56
%58 = load i32, i32* @stdin
%59 = call i32* @fgets(i8* %10, i32 254, i32 %58)
%60 = icmp eq i32* %59, null
br i1 %60, label %76, label %61
61: ; preds = %53
%62 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, float* %4, float* %5)
%63 = icmp slt i32 %62, 3
br i1 %63, label %17, label %64
64: ; preds = %61
%65 = load float, float* %4
%66 = fadd float %55, %65
%67 = load float, float* %5
%68 = fadd float %57, %67
%69 = fdiv float %68, 5.000000e+00
%70 = fdiv float %66, 5.000000e+00
%71 = load i32, i32* %3
%72 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %71, float %70, float %69)
%73 = load i32, i32* @stdin
%74 = call i32* @fgets(i8* %10, i32 254, i32 %73)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %14
76: ; preds = %53, %42, %31, %20, %64, %2, %17
%77 = phi i32 [ -1, %17 ], [ 0, %2 ], [ 0, %64 ], [ 0, %20 ], [ 0, %31 ], [ 0, %42 ], [ 0, %53 ]
ret i32 %77
}