#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 *);
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\n", &v1, &v2)) != EOF) {
      media1 += v1;
      media2 += v2;
      linhas++;
    }
  fclose(arq);
  media1 /= (float)linhas;
  media2 /= (float)linhas;
  printf("%.10f\t%.10f", media1, media2);
}


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    1219 <main+0xd9>
jmp    11c0 <main+0x80>
mov    -0x18(%rbp),%rdi
lea    0xe5f(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <fscanf@plt>
mov    0x2e09(%rip),%rcx
cmp    (%rcx),%rax
je     1214 <main+0xd4>
movss  -0x1c(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11c0 <main+0x80>
jmp    1219 <main+0xd9>
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)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdd0(%rip),%rdi
mov    $0x2,%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    $0x18,%rsp
mov    0x8(%rsi),%rdi
lea    0xe97(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1217 <main+0xc7>
lea    0xe81(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
mov    0x2e4e(%rip),%r13
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
cmp    0x0(%r13),%rax
je     122c <main+0xdc>
xorps  %xmm0,%xmm0
xor    %ebp,%ebp
lea    0xe49(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
xorps  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
addss  0x10(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
addss  0xc(%rsp),%xmm1
movss  %xmm1,0x4(%rsp)
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1060 <fscanf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
cmp    0x0(%r13),%rax
jne    11d0 <main+0x80>
xorps  %xmm2,%xmm2
cvtsi2ss %ebp,%xmm2
jmp    122c <main+0xdc>
lea    0xdf7(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movss  %xmm2,0x14(%rsp)
movss  %xmm0,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
movss  0x8(%rsp),%xmm0
movss  0x14(%rsp),%xmm2
divss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm2,%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xd9a(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%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 = [7 x i8] c"%f\09%f\0A\00"
@EOF = global i64 0
@.str.3 = [12 x i8] c"%.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 %42
26: ; preds = %2
br label %27
27: ; preds = %32, %26
%28 = load i32*, i32** %6
%29 = call i64 @fscanf(i32* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), float* %7, float* %8)
%30 = load i64, i64* @EOF
%31 = icmp ne i64 %29, %30
br i1 %31, label %32, label %41
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 i32, i32* %17
%40 = add nsw i32 %39, 1
store i32 %40, i32* %17
br label %27
41: ; preds = %27
br label %42
42: ; preds = %41, %24
%43 = load i32*, i32** %6
%44 = call i32 @fclose(i32* %43)
%45 = load i32, i32* %17
%46 = sitofp i32 %45 to float
%47 = load float, float* %12
%48 = fdiv float %47, %46
store float %48, float* %12
%49 = load i32, i32* %17
%50 = sitofp i32 %49 to float
%51 = load float, float* %13
%52 = fdiv float %51, %50
store float %52, float* %13
%53 = load float, float* %12
%54 = fpext float %53 to double
%55 = load float, float* %13
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %54, double %56)
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"%f\09%f\0A\00"
@EOF = global i64 0
@.str.3 = [12 x i8] c"%.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 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = icmp eq i32* %7, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = call i64 @fscanf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), float* %3, float* %4)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %31, label %17
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %31
17: ; preds = %11, %17
%18 = phi i32 [ %25, %17 ], [ 0, %11 ]
%19 = phi float [ %22, %17 ], [ 0.000000e+00, %11 ]
%20 = phi float [ %24, %17 ], [ 0.000000e+00, %11 ]
%21 = load float, float* %3
%22 = fadd float %19, %21
%23 = load float, float* %4
%24 = fadd float %20, %23
%25 = add nuw nsw i32 %18, 1
%26 = call i64 @fscanf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), float* %3, float* %4)
%27 = load i64, i64* @EOF
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %17
29: ; preds = %17
%30 = sitofp i32 %25 to float
br label %31
31: ; preds = %29, %11, %15
%32 = phi float [ 0.000000e+00, %15 ], [ 0.000000e+00, %11 ], [ %24, %29 ]
%33 = phi float [ 0.000000e+00, %15 ], [ 0.000000e+00, %11 ], [ %22, %29 ]
%34 = phi float [ 0.000000e+00, %15 ], [ 0.000000e+00, %11 ], [ %30, %29 ]
%35 = call i32 @fclose(i32* %7)
%36 = fdiv float %33, %34
%37 = fdiv float %32, %34
%38 = fpext float %36 to double
%39 = fpext float %37 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %38, double %39)
ret i32 0
}