#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, float *, float *, float *,
                  float *, float *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **arvgv) {
  FILE *arq = fopen(arvgv[1], "r");
  float v1, v2, v3, v4, v5;
  float media1 = 0, media2 = 0, media3 = 0, media4 = 0, media5 = 0;
  int linhas = 0;
  if (arq == NULL)
    printf("Erro, nao foi possivel abrir o arquivo\n");
  else
    while ((fscanf(arq, "%f\t%f\t%f\t%f\t%f\n", &v1, &v2, &v3, &v4, &v5)) !=
           EOF) {
      media1 += v1;
      media2 += v2;
      media3 += v3;
      media4 += v4;
      media5 += v5;
      linhas++;
    }
  fclose(arq);
  media1 /= (float)linhas;
  media2 /= (float)linhas;
  media3 /= (float)linhas;
  media4 /= (float)linhas;
  media5 /= (float)linhas;
  printf("%.10f\t%.10f\t%.10f\t%.10f\t%.10f", media1, media2, media3, media4,
         media5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11bb <main+0x7b>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1256 <main+0x116>
jmp    11c0 <main+0x80>
mov    -0x18(%rbp),%rdi
lea    0xe5f(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x28(%rbp),%r9
lea    -0x2c(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <fscanf@plt>
mov    0x2df9(%rip),%rcx
cmp    (%rcx),%rax
je     1251 <main+0x111>
movss  -0x1c(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x2c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11c0 <main+0x80>
jmp    1256 <main+0x116>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cvtsi2ssl -0x44(%rbp),%xmm1
movss  -0x30(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
cvtsi2ssl -0x44(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
cvtsi2ssl -0x44(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
cvtsi2ssl -0x44(%rbp),%xmm1
movss  -0x3c(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
cvtsi2ssl -0x44(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x38(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x3c(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x40(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
lea    0xd48(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0x8(%rsi),%rdi
lea    0xe97(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1287 <main+0x137>
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
lea    0xe78(%rip),%rsi
lea    0x30(%rsp),%rdx
lea    0x2c(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x24(%rsp),%r9
mov    %rbx,%rdi
call   1060 <fscanf@plt>
mov    0x2e3b(%rip),%r15
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm0,%xmm0
xorps  %xmm5,%xmm5
cmp    (%r15),%rax
je     12a5 <main+0x155>
xorps  %xmm0,%xmm0
xor    %r14d,%r14d
lea    0x2c(%rsp),%r12
lea    0x28(%rsp),%r13
lea    0x24(%rsp),%rbp
xorps  %xmm4,%xmm4
xorps  %xmm3,%xmm3
xorps  %xmm2,%xmm2
xorps  %xmm1,%xmm1
nopl   0x0(%rax)
addss  0x30(%rsp),%xmm1
movss  %xmm1,0x18(%rsp)
addss  0x2c(%rsp),%xmm2
movss  %xmm2,0x14(%rsp)
addss  0x28(%rsp),%xmm3
movss  %xmm3,0x10(%rsp)
addss  0x24(%rsp),%xmm4
movss  %xmm4,0xc(%rsp)
addss  0x20(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
add    $0x1,%r14d
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
lea    0xdbf(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbp,%r9
call   1060 <fscanf@plt>
movss  0xc(%rsp),%xmm4
movss  0x10(%rsp),%xmm3
movss  0x14(%rsp),%xmm2
movss  0x18(%rsp),%xmm1
movss  0x1c(%rsp),%xmm0
cmp    (%r15),%rax
jne    11f0 <main+0xa0>
xorps  %xmm5,%xmm5
cvtsi2ss %r14d,%xmm5
jmp    12a5 <main+0x155>
lea    0xda2(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm0,%xmm0
xorps  %xmm5,%xmm5
movss  %xmm5,0x34(%rsp)
movss  %xmm1,0x18(%rsp)
movss  %xmm2,0x14(%rsp)
movss  %xmm3,0x10(%rsp)
movss  %xmm4,0xc(%rsp)
movss  %xmm0,0x1c(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
movss  0x18(%rsp),%xmm0
movss  0x34(%rsp),%xmm4
divss  %xmm4,%xmm0
movss  0x14(%rsp),%xmm1
divss  %xmm4,%xmm1
movss  0x10(%rsp),%xmm2
divss  %xmm4,%xmm2
movss  0xc(%rsp),%xmm3
divss  %xmm4,%xmm3
movaps %xmm4,%xmm5
movss  0x1c(%rsp),%xmm4
divss  %xmm5,%xmm4
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm3,%xmm3
cvtss2sd %xmm4,%xmm4
lea    0xceb(%rip),%rdi
mov    $0x5,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [40 x i8] c"Erro, nao foi possivel abrir o arquivo\0A\00"
@.str.2 = [16 x i8] c"%f\09%f\09%f\09%f\09%f\0A\00"
@EOF = global i64 0
@.str.3 = [30 x i8] c"%.10f\09%.10f\09%.10f\09%.10f\09%.10f\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 float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %21, i32** %6
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
store float 0.000000e+00, float* %16
store i32 0, i32* %17
%22 = load i32*, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %51
26: ; preds = %2
br label %27
27: ; preds = %32, %26
%28 = load i32*, i32** %6
%29 = call i64 @fscanf(i32* %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float* %7, float* %8, float* %9, float* %10, float* %11)
%30 = load i64, i64* @EOF
%31 = icmp ne i64 %29, %30
br i1 %31, label %32, label %50
32: ; preds = %27
%33 = load float, float* %7
%34 = load float, float* %12
%35 = fadd float %34, %33
store float %35, float* %12
%36 = load float, float* %8
%37 = load float, float* %13
%38 = fadd float %37, %36
store float %38, float* %13
%39 = load float, float* %9
%40 = load float, float* %14
%41 = fadd float %40, %39
store float %41, float* %14
%42 = load float, float* %10
%43 = load float, float* %15
%44 = fadd float %43, %42
store float %44, float* %15
%45 = load float, float* %11
%46 = load float, float* %16
%47 = fadd float %46, %45
store float %47, float* %16
%48 = load i32, i32* %17
%49 = add nsw i32 %48, 1
store i32 %49, i32* %17
br label %27
50: ; preds = %27
br label %51
51: ; preds = %50, %24
%52 = load i32*, i32** %6
%53 = call i32 @fclose(i32* %52)
%54 = load i32, i32* %17
%55 = sitofp i32 %54 to float
%56 = load float, float* %12
%57 = fdiv float %56, %55
store float %57, float* %12
%58 = load i32, i32* %17
%59 = sitofp i32 %58 to float
%60 = load float, float* %13
%61 = fdiv float %60, %59
store float %61, float* %13
%62 = load i32, i32* %17
%63 = sitofp i32 %62 to float
%64 = load float, float* %14
%65 = fdiv float %64, %63
store float %65, float* %14
%66 = load i32, i32* %17
%67 = sitofp i32 %66 to float
%68 = load float, float* %15
%69 = fdiv float %68, %67
store float %69, float* %15
%70 = load i32, i32* %17
%71 = sitofp i32 %70 to float
%72 = load float, float* %16
%73 = fdiv float %72, %71
store float %73, float* %16
%74 = load float, float* %12
%75 = fpext float %74 to double
%76 = load float, float* %13
%77 = fpext float %76 to double
%78 = load float, float* %14
%79 = fpext float %78 to double
%80 = load float, float* %15
%81 = fpext float %80 to double
%82 = load float, float* %16
%83 = fpext float %82 to double
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %75, double %77, double %79, double %81, double %83)
%85 = load i32, i32* %3
ret i32 %85
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"%f\09%f\09%f\09%f\09%f\0A\00"
@EOF = global i64 0
@.str.3 = [30 x i8] c"%.10f\09%.10f\09%.10f\09%.10f\09%.10f\00"
@str = [39 x i8] c"Erro, nao foi possivel abrir o arquivo\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = bitcast float* %3 to i8*
%12 = bitcast float* %4 to i8*
%13 = bitcast float* %5 to i8*
%14 = bitcast float* %6 to i8*
%15 = bitcast float* %7 to i8*
%16 = icmp eq i32* %10, null
br i1 %16, label %21, label %17
17: ; preds = %2
%18 = call i64 @fscanf(i32* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float* %3, float* %4, float* %5, float* %6, float* %7)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %46, label %23
21: ; preds = %2
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %46
23: ; preds = %17, %23
%24 = phi i32 [ %40, %23 ], [ 0, %17 ]
%25 = phi float [ %39, %23 ], [ 0.000000e+00, %17 ]
%26 = phi float [ %37, %23 ], [ 0.000000e+00, %17 ]
%27 = phi float [ %35, %23 ], [ 0.000000e+00, %17 ]
%28 = phi float [ %33, %23 ], [ 0.000000e+00, %17 ]
%29 = phi float [ %31, %23 ], [ 0.000000e+00, %17 ]
%30 = load float, float* %3
%31 = fadd float %29, %30
%32 = load float, float* %4
%33 = fadd float %28, %32
%34 = load float, float* %5
%35 = fadd float %27, %34
%36 = load float, float* %6
%37 = fadd float %26, %36
%38 = load float, float* %7
%39 = fadd float %25, %38
%40 = add nuw nsw i32 %24, 1
%41 = call i64 @fscanf(i32* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float* %3, float* %4, float* %5, float* %6, float* %7)
%42 = load i64, i64* @EOF
%43 = icmp eq i64 %41, %42
br i1 %43, label %44, label %23
44: ; preds = %23
%45 = sitofp i32 %40 to float
br label %46
46: ; preds = %44, %17, %21
%47 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %31, %44 ]
%48 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %33, %44 ]
%49 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %35, %44 ]
%50 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %37, %44 ]
%51 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %39, %44 ]
%52 = phi float [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ %45, %44 ]
%53 = call i32 @fclose(i32* %10)
%54 = fdiv float %47, %52
%55 = fdiv float %48, %52
%56 = fdiv float %49, %52
%57 = fdiv float %50, %52
%58 = fdiv float %51, %52
%59 = fpext float %54 to double
%60 = fpext float %55 to double
%61 = fpext float %56 to double
%62 = fpext float %57 to double
%63 = fpext float %58 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %59, double %60, double %61, double %62, double %63)
ret i32 0
}