#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 */
float getAverage(float *, int);
int /*<<< orphan*/ printf(char *, float);
float sumMult(float *, float *, int);
int main(int argc, char **argv) {
  float x[] = {2860, 2010, 2791, 2618, 2212, 2184, 3244,
               2692, 2206, 2914, 3034, 4240, 1400, 2257};
  float y[] = {2.66, 2.46, 2.95, 2.81, 2.90, 2.88, 2.13,
               3.03, 3.54, 3.1,  4.32, 2.85, 2.2,  2.69};
  int n = 14;
  float meanx, meany, ssqx, ssqy, sumxy, Sxx, Syy, Sxy, SSr;
  meanx = getAverage(x, n);
  meanx /= n;
  meany = getAverage(y, n);
  meany /= n;
  ssqx = sumMult(x, x, n);
  ssqy = sumMult(y, y, n);
  sumxy = sumMult(x, y, n);
  Sxx = ssqx - n * meanx * meanx;
  Syy = ssqy - n * meany * meany;
  Sxy = sumxy - n * meanx * meany;
  SSr = (Sxx * Syy - Sxy * Sxy) / Sxx;
  printf("SSR = %f", SSr);
  printf("%f", Syy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x38,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x38,%edx
call   1060 <memcpy@plt>
movl   $0xe,-0x94(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   1030 <getAverage@plt>
movss  %xmm0,-0x98(%rbp)
ff
cvtsi2ssl -0x94(%rbp),%xmm1
ff
movss  -0x98(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   1030 <getAverage@plt>
movss  %xmm0,-0x9c(%rbp)
ff
cvtsi2ssl -0x94(%rbp),%xmm1
ff
movss  -0x9c(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
lea    -0x50(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x94(%rbp),%edx
call   1040 <sumMult@plt>
movss  %xmm0,-0xa0(%rbp)
ff
lea    -0x90(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
call   1040 <sumMult@plt>
movss  %xmm0,-0xa4(%rbp)
ff
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
call   1040 <sumMult@plt>
movss  %xmm0,-0xa8(%rbp)
ff
movss  -0xa0(%rbp),%xmm1
ff
cvtsi2ssl -0x94(%rbp),%xmm0
ff
mulss  -0x98(%rbp),%xmm0
ff
movss  -0x98(%rbp),%xmm2
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xac(%rbp)
ff
movss  -0xa4(%rbp),%xmm1
ff
cvtsi2ssl -0x94(%rbp),%xmm0
ff
mulss  -0x9c(%rbp),%xmm0
ff
movss  -0x9c(%rbp),%xmm2
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb0(%rbp)
ff
movss  -0xa8(%rbp),%xmm1
ff
cvtsi2ssl -0x94(%rbp),%xmm0
ff
mulss  -0x98(%rbp),%xmm0
ff
movss  -0x9c(%rbp),%xmm2
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0xac(%rbp),%xmm0
ff
movss  -0xb0(%rbp),%xmm2
ff
movss  -0xb4(%rbp),%xmm1
ff
mulss  -0xb4(%rbp),%xmm1
ff
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
divss  -0xac(%rbp),%xmm0
ff
movss  %xmm0,-0xb8(%rbp)
ff
movss  -0xb8(%rbp),%xmm0
ff
lea    0xd1a(%rip),%rdi
call   1050 <printf@plt>
movss  -0xb0(%rbp),%xmm0
ff
lea    0xd0c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    0xeff(%rip),%rax
mov    %rax,0x80(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0xf0c(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0xe,%esi
call   1030 <getAverage@plt>
divss  0xe49(%rip),%xmm0
movss  %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <getAverage@plt>
divss  0xe2a(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14,%rdi
mov    %r14,%rsi
mov    $0xe,%edx
call   1040 <sumMult@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    $0xe,%edx
call   1040 <sumMult@plt>
movss  %xmm0,0x4(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xe,%edx
call   1040 <sumMult@plt>
movss  0xde4(%rip),%xmm4
movss  (%rsp),%xmm2
movaps %xmm2,%xmm1
mulss  %xmm4,%xmm1
mulss  %xmm1,%xmm2
addss  0x8(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
mulss  %xmm3,%xmm4
mulss  %xmm3,%xmm4
addss  0x4(%rsp),%xmm4
movss  %xmm4,(%rsp)
mulss  %xmm3,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm1,%xmm1
movaps %xmm2,%xmm0
mulss  %xmm4,%xmm0
subss  %xmm1,%xmm0
divss  %xmm2,%xmm0
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
lea    0xe11(%rip),%rdi
movss  (%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.x = [14 x float] [float 2.860000e+03, float 2.010000e+03, float 2.791000e+03, float 2.618000e+03, float 2.212000e+03, float 2.184000e+03, float 3.244000e+03, float 2.692000e+03, float 2.206000e+03, float 2.914000e+03, float 3.034000e+03, float 4.240000e+03, float 1.400000e+03, float 2.257000e+03]
@__const.main.y = [14 x float] [float 0x400547AE20000000, float 0x4003AE1480000000, float 0x40079999A0000000, float 0x40067AE140000000, float 0x4007333340000000, float 0x40070A3D80000000, float 0x40010A3D80000000, float 0x40083D70A0000000, float 0x400C51EB80000000, float 0x4008CCCCC0000000, float 0x401147AE20000000, float 0x4006CCCCC0000000, float 0x40019999A0000000, float 0x4005851EC0000000]
@.str = [9 x i8] c"SSR = %f\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x float]
%7 = alloca [14 x float]
%8 = alloca i32
%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 float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [14 x float]* %6 to i8*
%19 = bitcast [14 x float]* %7 to i8*
store i32 14, i32* %8
%20 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%21 = load i32, i32* %8
%22 = call float @getAverage(float* %20, i32 %21)
store float %22, float* %9
%23 = load i32, i32* %8
%24 = sitofp i32 %23 to float
%25 = load float, float* %9
%26 = fdiv float %25, %24
store float %26, float* %9
%27 = getelementptr inbounds [14 x float], [14 x float]* %7, i64 0, i64 0
%28 = load i32, i32* %8
%29 = call float @getAverage(float* %27, i32 %28)
store float %29, float* %10
%30 = load i32, i32* %8
%31 = sitofp i32 %30 to float
%32 = load float, float* %10
%33 = fdiv float %32, %31
store float %33, float* %10
%34 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%35 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%36 = load i32, i32* %8
%37 = call float @sumMult(float* %34, float* %35, i32 %36)
store float %37, float* %11
%38 = getelementptr inbounds [14 x float], [14 x float]* %7, i64 0, i64 0
%39 = getelementptr inbounds [14 x float], [14 x float]* %7, i64 0, i64 0
%40 = load i32, i32* %8
%41 = call float @sumMult(float* %38, float* %39, i32 %40)
store float %41, float* %12
%42 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%43 = getelementptr inbounds [14 x float], [14 x float]* %7, i64 0, i64 0
%44 = load i32, i32* %8
%45 = call float @sumMult(float* %42, float* %43, i32 %44)
store float %45, float* %13
%46 = load float, float* %11
%47 = load i32, i32* %8
%48 = sitofp i32 %47 to float
%49 = load float, float* %9
%50 = fmul float %48, %49
%51 = load float, float* %9
%52 = fneg float %50
%53 = call float @llvm.fmuladd.f32(float %52, float %51, float %46)
store float %53, float* %14
%54 = load float, float* %12
%55 = load i32, i32* %8
%56 = sitofp i32 %55 to float
%57 = load float, float* %10
%58 = fmul float %56, %57
%59 = load float, float* %10
%60 = fneg float %58
%61 = call float @llvm.fmuladd.f32(float %60, float %59, float %54)
store float %61, float* %15
%62 = load float, float* %13
%63 = load i32, i32* %8
%64 = sitofp i32 %63 to float
%65 = load float, float* %9
%66 = fmul float %64, %65
%67 = load float, float* %10
%68 = fneg float %66
%69 = call float @llvm.fmuladd.f32(float %68, float %67, float %62)
store float %69, float* %16
%70 = load float, float* %14
%71 = load float, float* %15
%72 = load float, float* %16
%73 = load float, float* %16
%74 = fmul float %72, %73
%75 = fneg float %74
%76 = call float @llvm.fmuladd.f32(float %70, float %71, float %75)
%77 = load float, float* %14
%78 = fdiv float %76, %77
store float %78, float* %17
%79 = load float, float* %17
%80 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %79)
%81 = load float, float* %15
%82 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float %81)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [14 x float] [float 2.860000e+03, float 2.010000e+03, float 2.791000e+03, float 2.618000e+03, float 2.212000e+03, float 2.184000e+03, float 3.244000e+03, float 2.692000e+03, float 2.206000e+03, float 2.914000e+03, float 3.034000e+03, float 4.240000e+03, float 1.400000e+03, float 2.257000e+03]
@__const.main.y = [14 x float] [float 0x400547AE20000000, float 0x4003AE1480000000, float 0x40079999A0000000, float 0x40067AE140000000, float 0x4007333340000000, float 0x40070A3D80000000, float 0x40010A3D80000000, float 0x40083D70A0000000, float 0x400C51EB80000000, float 0x4008CCCCC0000000, float 0x401147AE20000000, float 0x4006CCCCC0000000, float 0x40019999A0000000, float 0x4005851EC0000000]
@.str = [9 x i8] c"SSR = %f\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x float]
%4 = alloca [14 x float]
%5 = bitcast [14 x float]* %3 to i8*
%6 = bitcast [14 x float]* %4 to i8*
%7 = getelementptr inbounds [14 x float], [14 x float]* %3, i64 0, i64 0
%8 = call float @getAverage(float* %7, i32 14)
%9 = fdiv float %8, 1.400000e+01
%10 = getelementptr inbounds [14 x float], [14 x float]* %4, i64 0, i64 0
%11 = call float @getAverage(float* %10, i32 14)
%12 = fdiv float %11, 1.400000e+01
%13 = call float @sumMult(float* %7, float* %7, i32 14)
%14 = call float @sumMult(float* %10, float* %10, i32 14)
%15 = call float @sumMult(float* %7, float* %10, i32 14)
%16 = fmul float %9, -1.400000e+01
%17 = call float @llvm.fmuladd.f32(float %16, float %9, float %13)
%18 = fmul float %12, -1.400000e+01
%19 = call float @llvm.fmuladd.f32(float %18, float %12, float %14)
%20 = call float @llvm.fmuladd.f32(float %16, float %12, float %15)
%21 = fneg float %20
%22 = fmul float %20, %21
%23 = call float @llvm.fmuladd.f32(float %17, float %19, float %22)
%24 = fdiv float %23, %17
%25 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}