#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 */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, float *);
scalar_t__ pow(float, int);
int /*<<< orphan*/ printf(char *);
float sqrt(scalar_t__);
void dataNumber(char fileName[], int *dataNum, float *mean, float *deviation) {
  int i;
  float dataFile;
  int count = 0;
  float total = 0;
  float sumSquares = 0;
  FILE *fp1 = NULL;
  fp1 = fopen(fileName, "r");
  if (fp1 != NULL) {
    while (fscanf(fp1, "%f\n", &dataFile) == 1) {
      count += 1;
      total += dataFile;
      sumSquares += pow(dataFile, 2);
    }
    *dataNum = count;
    *mean = total / count;
    *deviation = sqrt((sumSquares / count) - pow(*mean, 2));
  } else
    printf("Failed to open file!\n");
  fclose(fp1);
}


x86 assembly (clang, -O0):
<dataNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     127c <dataNumber+0x11c>
jmp    11bb <dataNumber+0x5b>
mov    -0x40(%rbp),%rdi
lea    0xe3c(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    1213 <dataNumber+0xb3>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
cvtsi2ss %rax,%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    11bb <dataNumber+0x5b>
mov    -0x2c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x30(%rbp),%xmm0
cvtsi2ssl -0x2c(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x34(%rbp),%xmm0
cvtsi2ssl -0x2c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movss  -0x44(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1080 <sqrt@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1288 <dataNumber+0x128>
lea    0xd83(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dataNumber>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbp
mov    %rdx,%r15
mov    %rsi,%r12
lea    0xe82(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1221 <dataNumber+0xc1>
mov    %rbp,0x10(%rsp)
lea    0xe67(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    122f <dataNumber+0xcf>
xor    %r14d,%r14d
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xe3e(%rip),%r13
lea    0x8(%rsp),%rbp
xorps  %xmm1,%xmm1
nopl   0x0(%rax)
add    $0x1,%r14d
movss  0x8(%rsp),%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mov    $0x2,%edi
call   1070 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1050 <fscanf@plt>
movss  0xc(%rsp),%xmm1
cmp    $0x1,%eax
je     11d0 <dataNumber+0x70>
jmp    123e <dataNumber+0xde>
lea    0xdde(%rip),%rdi
call   1030 <puts@plt>
jmp    1295 <dataNumber+0x135>
xorps  %xmm1,%xmm1
xor    %r14d,%r14d
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
mov    %r14d,(%r12)
divss  %xmm0,%xmm1
movss  %xmm1,(%r15)
movss  0x4(%rsp),%xmm2
divss  %xmm0,%xmm2
movss  %xmm2,0x4(%rsp)
movaps %xmm1,%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%rdi
call   1080 <sqrt@plt>
mov    0x10(%rsp),%rax
movss  %xmm0,(%rax)
mov    %rbx,%rdi
call   1040 <fclose@plt>
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 = [4 x i8] c"%f\0A\00"
@.str.2 = [22 x i8] c"Failed to open file!\0A\00"
define void @dataNumber(i8* %0, i32* %1, float* %2, float* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store float* %2, float** %7
store float* %3, float** %8
store i32 0, i32* %11
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store i32* null, i32** %14
%15 = load i8*, i8** %5
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %16, i32** %14
%17 = load i32*, i32** %14
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %55
19: ; preds = %4
br label %20
20: ; preds = %24, %19
%21 = load i32*, i32** %14
%22 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %10)
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = load i32, i32* %11
%26 = add nsw i32 %25, 1
store i32 %26, i32* %11
%27 = load float, float* %10
%28 = load float, float* %12
%29 = fadd float %28, %27
store float %29, float* %12
%30 = load float, float* %10
%31 = call i64 @pow(float %30, i32 2)
%32 = sitofp i64 %31 to float
%33 = load float, float* %13
%34 = fadd float %33, %32
store float %34, float* %13
br label %20
35: ; preds = %20
%36 = load i32, i32* %11
%37 = load i32*, i32** %6
store i32 %36, i32* %37
%38 = load float, float* %12
%39 = load i32, i32* %11
%40 = sitofp i32 %39 to float
%41 = fdiv float %38, %40
%42 = load float*, float** %7
store float %41, float* %42
%43 = load float, float* %13
%44 = load i32, i32* %11
%45 = sitofp i32 %44 to float
%46 = fdiv float %43, %45
%47 = load float*, float** %7
%48 = load float, float* %47
%49 = call i64 @pow(float %48, i32 2)
%50 = sitofp i64 %49 to float
%51 = fsub float %46, %50
%52 = fptosi float %51 to i64
%53 = call float @sqrt(i64 %52)
%54 = load float*, float** %8
store float %53, float* %54
br label %57
55: ; preds = %4
%56 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %57
57: ; preds = %55, %35
%58 = load i32*, i32** %14
%59 = call i32 @fclose(i32* %58)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@str = [21 x i8] c"Failed to open file!\00"
define void @dataNumber(i8* nocapture %0, i32* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = alloca float
%6 = bitcast float* %5 to i8*
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %36, label %9
9: ; preds = %4
%10 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %5)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %24
12: ; preds = %9, %12
%13 = phi float [ %21, %12 ], [ 0.000000e+00, %9 ]
%14 = phi float [ %18, %12 ], [ 0.000000e+00, %9 ]
%15 = phi i32 [ %16, %12 ], [ 0, %9 ]
%16 = add nuw nsw i32 %15, 1
%17 = load float, float* %5
%18 = fadd float %14, %17
%19 = call i64 @pow(float %17, i32 2)
%20 = sitofp i64 %19 to float
%21 = fadd float %13, %20
%22 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %5)
%23 = icmp eq i32 %22, 1
br i1 %23, label %12, label %24
24: ; preds = %12, %9
%25 = phi i32 [ 0, %9 ], [ %16, %12 ]
%26 = phi float [ 0.000000e+00, %9 ], [ %18, %12 ]
%27 = phi float [ 0.000000e+00, %9 ], [ %21, %12 ]
store i32 %25, i32* %1
%28 = sitofp i32 %25 to float
%29 = fdiv float %26, %28
store float %29, float* %2
%30 = fdiv float %27, %28
%31 = call i64 @pow(float %29, i32 2)
%32 = sitofp i64 %31 to float
%33 = fsub float %30, %32
%34 = fptosi float %33 to i64
%35 = call float @sqrt(i64 %34)
store float %35, float* %3
br label %38
36: ; preds = %4
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %38
38: ; preds = %36, %24
%39 = call i32 @fclose(i32* %7)
ret void
}