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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movl   $0x0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    124c <main+0x10c>
lea    -0x140(%rbp),%rdi
mov    0x2e4b(%rip),%rax
mov    (%rax),%edx
mov    $0xfe,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    11bf <main+0x7f>
movl   $0x0,-0x4(%rbp)
jmp    1283 <main+0x143>
lea    -0x140(%rbp),%rdi
lea    0xe3b(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x24(%rbp),%r11
lea    -0x28(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <sscanf@plt>
mov    %eax,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
cmpl   $0x7,-0x38(%rbp)
jge    1239 <main+0xf9>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1283 <main+0x143>
jmp    123e <main+0xfe>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1185 <main+0x45>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xda3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x14(%rbp),%esi
movss  -0x30(%rbp),%xmm0
lea    0xdb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <main+0x36>
mov    -0x4(%rbp),%eax
add    $0x160,%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,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,(%rsp)
mov    0x2e79(%rip),%r15
mov    (%r15),%edx
lea    0x20(%rsp),%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
xor    %ecx,%ecx
test   %rax,%rax
je     13d7 <main+0x297>
lea    0x20(%rsp),%rbp
lea    0x10(%rsp),%r12
lea    0x14(%rsp),%r13
lea    0x1c(%rsp),%rbx
lea    0x18(%rsp),%r14
sub    $0x8,%rsp
mov    %rbp,%rdi
lea    0xe55(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r14,%r9
lea    0x8(%rsp),%rax
push   %rax
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x6,%eax
jle    13bd <main+0x27d>
movss  (%rsp),%xmm0
addss  0xe14(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     13b9 <main+0x279>
sub    $0x8,%rsp
mov    %rbp,%rdi
lea    0xdeb(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r14,%r9
lea    0x8(%rsp),%rax
push   %rax
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x7,%eax
jl     13bd <main+0x27d>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     13b9 <main+0x279>
sub    $0x8,%rsp
mov    %rbp,%rdi
lea    0xd83(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r14,%r9
lea    0x8(%rsp),%rax
push   %rax
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x7,%eax
jl     13bd <main+0x27d>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     13b9 <main+0x279>
sub    $0x8,%rsp
mov    %rbp,%rdi
lea    0xd1b(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r14,%r9
lea    0x8(%rsp),%rax
push   %rax
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x7,%eax
jl     13bd <main+0x27d>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     13b9 <main+0x279>
sub    $0x8,%rsp
mov    %rbp,%rdi
lea    0xcb7(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r14,%r9
lea    0x8(%rsp),%rax
push   %rax
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x7,%eax
jl     13bd <main+0x27d>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
divss  0xc70(%rip),%xmm0
mov    0x10(%rsp),%esi
lea    0xc90(%rip),%rdi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0xfe,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    11a5 <main+0x65>
xor    %ecx,%ecx
jmp    13d7 <main+0x297>
mov    0x2c14(%rip),%rax
mov    (%rax),%edi
lea    0xc50(%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 = [21 x i8] c"%d %d %f %f %f %f %f\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"parse error.\0A\00"
@.str.2 = [17 x i8] c"%d %f (size,bw)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca i32
%15 = alloca i32
%16 = 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 i32 0, i32* %7
store float 0.000000e+00, float* %12
store i32 0, i32* %15
br label %17
17: ; preds = %2, %42
store float 0.000000e+00, float* %13
store i32 0, i32* %14
br label %18
18: ; preds = %39, %17
%19 = load i32, i32* %14
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %42
21: ; preds = %18
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32* @fgets(i8* %22, i32 254, i32 %23)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 0, i32* %3
br label %50
27: ; preds = %21
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%29 = call i32 @sscanf(i8* %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, float* %8, float* %9, float* %10, float* %11, float* %12)
store i32 %29, i32* %15
%30 = load float, float* %12
%31 = load float, float* %13
%32 = fadd float %31, %30
store float %32, float* %13
%33 = load i32, i32* %15
%34 = icmp slt i32 %33, 7
br i1 %34, label %35, label %38
35: ; preds = %27
%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 %50
38: ; preds = %27
br label %39
39: ; preds = %38
%40 = load i32, i32* %14
%41 = add nsw i32 %40, 1
store i32 %41, i32* %14
br label %18
42: ; preds = %18
%43 = load float, float* %13
%44 = fpext float %43 to double
%45 = fdiv double %44, 5.000000e+00
%46 = fptrunc double %45 to float
store float %46, float* %13
%47 = load i32, i32* %6
%48 = load float, float* %13
%49 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %47, float %48)
br label %17
50: ; preds = %35, %26
%51 = load i32, i32* %3
ret i32 %51
}

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