#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 */
scalar_t__ isinf(double);
scalar_t__ isnan(double);
double sqrt(double);
double PearsonsCorrelation(const double *x, const double *y,
                           const double geneThreshold, int len) {
  int i, numSmallX = 0, numSmallY = 0, same;
  double dblBuf, sumx = 0.0, sumxx = 0.0, sumxy = 0.0, sumy = 0.0, sumyy = 0.0,
                 xx, xy, yy;
  for (i = 0; i < len; i++) {
    sumx += x[i];
    sumxx += x[i] * x[i];
    sumxy += x[i] * y[i];
    sumy += y[i];
    sumyy += y[i] * y[i];
  }
  if (((sumx < geneThreshold * sumy) || (sumy < geneThreshold * sumx)) ||
      ((sumx < 0.000000000001) && (sumy < 0.000000000001)))
    return 0.0;
  for (i = 0; i < len; i++) {
    if (x[i] < 0.0000000000001)
      numSmallX++;
    if (y[i] < 0.0000000000001)
      numSmallY++;
  }
  if ((numSmallX > len / 2) || (numSmallY > len / 2))
    return 0.0;
  if (sumx == sumy) {
    same = 1;
    for (i = 0; i < len; i++)
      if (x[i] != y[i]) {
        same = 0;
        break;
      }
    if (same)
      return 1.0;
  }
  xx = sumxx - (sumx * sumx) / len;
  xy = sumxy - (sumx * sumy) / len;
  yy = sumyy - (sumy * sumy) / len;
  dblBuf = xy / sqrt(xx * yy);
  if (isnan(dblBuf))
    return 0.0;
  else if (isinf(dblBuf))
    return 0.0;
  else
    return dblBuf;
}


x86 assembly (clang, -O0):
<PearsonsCorrelation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1254 <PearsonsCorrelation+0x124>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1188 <PearsonsCorrelation+0x58>
movsd  -0x48(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12ac <PearsonsCorrelation+0x17c>
movsd  -0x60(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12ac <PearsonsCorrelation+0x17c>
movsd  0xd72(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    12b9 <PearsonsCorrelation+0x189>
movsd  0xd5f(%rip),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    12b9 <PearsonsCorrelation+0x189>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f6 <PearsonsCorrelation+0x3c6>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1327 <PearsonsCorrelation+0x1f7>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  0xd34(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    12f0 <PearsonsCorrelation+0x1c0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  0xd10(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1314 <PearsonsCorrelation+0x1e4>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1319 <PearsonsCorrelation+0x1e9>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12c0 <PearsonsCorrelation+0x190>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jg     136f <PearsonsCorrelation+0x23f>
mov    -0x30(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x88(%rbp),%eax
cmp    %ecx,%eax
jle    137c <PearsonsCorrelation+0x24c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f6 <PearsonsCorrelation+0x3c6>
movsd  -0x48(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jne    1417 <PearsonsCorrelation+0x2e7>
jp     1417 <PearsonsCorrelation+0x2e7>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13f6 <PearsonsCorrelation+0x2c6>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    13d7 <PearsonsCorrelation+0x2a7>
jp     13d7 <PearsonsCorrelation+0x2a7>
jmp    13e3 <PearsonsCorrelation+0x2b3>
movl   $0x0,-0x34(%rbp)
jmp    13f6 <PearsonsCorrelation+0x2c6>
jmp    13e8 <PearsonsCorrelation+0x2b8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13a0 <PearsonsCorrelation+0x270>
cmpl   $0x0,-0x34(%rbp)
je     1412 <PearsonsCorrelation+0x2e2>
movsd  0xc00(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f6 <PearsonsCorrelation+0x3c6>
jmp    1417 <PearsonsCorrelation+0x2e7>
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     14cb <PearsonsCorrelation+0x39b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f6 <PearsonsCorrelation+0x3c6>
movsd  -0x40(%rbp),%xmm0
call   1050 <isinf@plt>
cmp    $0x0,%rax
je     14ec <PearsonsCorrelation+0x3bc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14f6 <PearsonsCorrelation+0x3c6>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PearsonsCorrelation>:
sub    $0x18,%rsp
xorps  %xmm10,%xmm10
test   %edx,%edx
jle    1162 <PearsonsCorrelation+0x32>
mov    %edx,%r8d
cmp    $0x1,%edx
jne    1174 <PearsonsCorrelation+0x44>
xorpd  %xmm3,%xmm3
xorpd  %xmm2,%xmm2
xor    %ecx,%ecx
xorpd  %xmm11,%xmm11
test   $0x1,%r8b
jne    11f7 <PearsonsCorrelation+0xc7>
jmp    121e <PearsonsCorrelation+0xee>
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
xorpd  %xmm11,%xmm11
jmp    121e <PearsonsCorrelation+0xee>
mov    %r8d,%eax
and    $0xfffffffe,%eax
xorpd  %xmm3,%xmm3
xorpd  %xmm2,%xmm2
xor    %ecx,%ecx
xorpd  %xmm11,%xmm11
nopl   0x0(%rax)
movsd  (%rdi,%rcx,8),%xmm4
movsd  0x8(%rdi,%rcx,8),%xmm1
movsd  (%rsi,%rcx,8),%xmm5
movsd  0x8(%rsi,%rcx,8),%xmm6
movapd %xmm4,%xmm7
mulsd  %xmm5,%xmm7
addsd  %xmm2,%xmm7
unpcklpd %xmm5,%xmm4
addpd  %xmm4,%xmm11
mulpd  %xmm4,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm1,%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm7,%xmm2
unpcklpd %xmm6,%xmm1
addpd  %xmm1,%xmm11
mulpd  %xmm1,%xmm1
movapd %xmm1,%xmm3
addpd  %xmm4,%xmm3
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1190 <PearsonsCorrelation+0x60>
addpd  %xmm4,%xmm1
test   $0x1,%r8b
je     121e <PearsonsCorrelation+0xee>
movsd  (%rdi,%rcx,8),%xmm1
movsd  (%rsi,%rcx,8),%xmm4
movapd %xmm1,%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm5,%xmm2
unpcklpd %xmm4,%xmm1
addpd  %xmm1,%xmm11
mulpd  %xmm1,%xmm1
addpd  %xmm3,%xmm1
movapd %xmm11,%xmm8
unpckhpd %xmm11,%xmm8
movapd %xmm11,%xmm4
mulsd  %xmm0,%xmm4
ucomisd %xmm8,%xmm4
ja     1463 <PearsonsCorrelation+0x333>
mulsd  %xmm8,%xmm0
ucomisd %xmm11,%xmm0
ja     1463 <PearsonsCorrelation+0x333>
movsd  0xdac(%rip),%xmm0
ucomisd %xmm11,%xmm0
jbe    1266 <PearsonsCorrelation+0x136>
ucomisd %xmm8,%xmm0
ja     1463 <PearsonsCorrelation+0x333>
test   %edx,%edx
jle    127f <PearsonsCorrelation+0x14f>
mov    %edx,%r8d
cmp    $0x4,%edx
jae    1289 <PearsonsCorrelation+0x159>
xor    %r9d,%r9d
xor    %ecx,%ecx
xor    %r10d,%r10d
jmp    133f <PearsonsCorrelation+0x20f>
xor    %r10d,%r10d
xor    %ecx,%ecx
jmp    1374 <PearsonsCorrelation+0x244>
mov    %r8d,%r9d
and    $0xfffffffc,%r9d
lea    0x0(,%r8,8),%rax
and    $0xffffffffffffffe0,%rax
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
movapd 0xd75(%rip),%xmm9
xorpd  %xmm4,%xmm4
xorpd  %xmm7,%xmm7
xorpd  %xmm5,%xmm5
nopw   0x0(%rax,%rax,1)
movupd (%rdi,%rcx,1),%xmm3
movupd 0x10(%rdi,%rcx,1),%xmm6
cmpltpd %xmm9,%xmm3
shufps $0xe8,%xmm3,%xmm3
psubd  %xmm3,%xmm0
cmpltpd %xmm9,%xmm6
shufps $0xe8,%xmm6,%xmm6
psubd  %xmm6,%xmm4
movupd (%rsi,%rcx,1),%xmm3
movupd 0x10(%rsi,%rcx,1),%xmm6
cmpltpd %xmm9,%xmm3
shufps $0xe8,%xmm3,%xmm3
psubd  %xmm3,%xmm7
cmpltpd %xmm9,%xmm6
shufps $0xe8,%xmm6,%xmm6
psubd  %xmm6,%xmm5
add    $0x20,%rcx
cmp    %rcx,%rax
jne    12c0 <PearsonsCorrelation+0x190>
paddd  %xmm7,%xmm5
pshufd $0x55,%xmm5,%xmm3
paddd  %xmm5,%xmm3
movd   %xmm3,%r10d
paddd  %xmm0,%xmm4
pshufd $0x55,%xmm4,%xmm0
paddd  %xmm4,%xmm0
movd   %xmm0,%ecx
cmp    %r8,%r9
je     1374 <PearsonsCorrelation+0x244>
movsd  0xcc1(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
ucomisd (%rdi,%r9,8),%xmm0
seta   %al
add    %eax,%ecx
xor    %eax,%eax
ucomisd (%rsi,%r9,8),%xmm0
seta   %al
add    %eax,%r10d
add    $0x1,%r9
cmp    %r9,%r8
jne    1350 <PearsonsCorrelation+0x220>
mov    %edx,%r8d
shr    $0x1f,%r8d
add    %edx,%r8d
sar    %r8d
cmp    %r8d,%ecx
jg     1463 <PearsonsCorrelation+0x333>
cmp    %r8d,%r10d
jg     1463 <PearsonsCorrelation+0x333>
ucomisd %xmm8,%xmm11
jne    13dc <PearsonsCorrelation+0x2ac>
jp     13dc <PearsonsCorrelation+0x2ac>
movsd  0xc6b(%rip),%xmm10
test   %edx,%edx
jle    1463 <PearsonsCorrelation+0x333>
mov    %edx,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rcx,8),%xmm0
ucomisd (%rsi,%rcx,8),%xmm0
jne    13dc <PearsonsCorrelation+0x2ac>
jp     13dc <PearsonsCorrelation+0x2ac>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13c0 <PearsonsCorrelation+0x290>
jmp    1463 <PearsonsCorrelation+0x333>
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
mulsd  %xmm11,%xmm8
divsd  %xmm0,%xmm8
subsd  %xmm8,%xmm2
mulpd  %xmm11,%xmm11
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm11
subpd  %xmm11,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1421 <PearsonsCorrelation+0x2f1>
sqrtsd %xmm0,%xmm0
jmp    1430 <PearsonsCorrelation+0x300>
movapd %xmm2,(%rsp)
call   1040 <sqrt@plt>
movapd (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,(%rsp)
movapd %xmm2,%xmm0
call   1030 <isnan@plt>
movdqa (%rsp),%xmm0
test   %rax,%rax
xorps  %xmm10,%xmm10
jne    1463 <PearsonsCorrelation+0x333>
call   1050 <isinf@plt>
movaps (%rsp),%xmm10
test   %rax,%rax
je     1463 <PearsonsCorrelation+0x333>
xorps  %xmm10,%xmm10
movaps %xmm10,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @PearsonsCorrelation(double* %0, double* %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double %2, double* %8
store i32 %3, i32* %9
store i32 0, i32* %11
store i32 0, i32* %12
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store i32 0, i32* %10
br label %23
23: ; preds = %78, %4
%24 = load i32, i32* %10
%25 = load i32, i32* %9
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %81
27: ; preds = %23
%28 = load double*, double** %6
%29 = load i32, i32* %10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = load double, double* %15
%34 = fadd double %33, %32
store double %34, double* %15
%35 = load double*, double** %6
%36 = load i32, i32* %10
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = load double*, double** %6
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = load double, double* %16
%46 = call double @llvm.fmuladd.f64(double %39, double %44, double %45)
store double %46, double* %16
%47 = load double*, double** %6
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = load double*, double** %7
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
%56 = load double, double* %55
%57 = load double, double* %17
%58 = call double @llvm.fmuladd.f64(double %51, double %56, double %57)
store double %58, double* %17
%59 = load double*, double** %7
%60 = load i32, i32* %10
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load double, double* %18
%65 = fadd double %64, %63
store double %65, double* %18
%66 = load double*, double** %7
%67 = load i32, i32* %10
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = load double*, double** %7
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = load double, double* %19
%77 = call double @llvm.fmuladd.f64(double %70, double %75, double %76)
store double %77, double* %19
br label %78
78: ; preds = %27
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %23
81: ; preds = %23
%82 = load double, double* %15
%83 = load double, double* %8
%84 = load double, double* %18
%85 = fmul double %83, %84
%86 = fcmp olt double %82, %85
br i1 %86, label %99, label %87
87: ; preds = %81
%88 = load double, double* %18
%89 = load double, double* %8
%90 = load double, double* %15
%91 = fmul double %89, %90
%92 = fcmp olt double %88, %91
br i1 %92, label %99, label %93
93: ; preds = %87
%94 = load double, double* %15
%95 = fcmp olt double %94, 0x3D719799812DEA11
br i1 %95, label %96, label %100
96: ; preds = %93
%97 = load double, double* %18
%98 = fcmp olt double %97, 0x3D719799812DEA11
br i1 %98, label %99, label %100
99: ; preds = %96, %87, %81
store double 0.000000e+00, double* %5
br label %213
100: ; preds = %96, %93
store i32 0, i32* %10
br label %101
101: ; preds = %126, %100
%102 = load i32, i32* %10
%103 = load i32, i32* %9
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %129
105: ; preds = %101
%106 = load double*, double** %6
%107 = load i32, i32* %10
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
%111 = fcmp olt double %110, 1.000000e-13
br i1 %111, label %112, label %115
112: ; preds = %105
%113 = load i32, i32* %11
%114 = add nsw i32 %113, 1
store i32 %114, i32* %11
br label %115
115: ; preds = %112, %105
%116 = load double*, double** %7
%117 = load i32, i32* %10
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %116, i64 %118
%120 = load double, double* %119
%121 = fcmp olt double %120, 1.000000e-13
br i1 %121, label %122, label %125
122: ; preds = %115
%123 = load i32, i32* %12
%124 = add nsw i32 %123, 1
store i32 %124, i32* %12
br label %125
125: ; preds = %122, %115
br label %126
126: ; preds = %125
%127 = load i32, i32* %10
%128 = add nsw i32 %127, 1
store i32 %128, i32* %10
br label %101
129: ; preds = %101
%130 = load i32, i32* %11
%131 = load i32, i32* %9
%132 = sdiv i32 %131, 2
%133 = icmp sgt i32 %130, %132
br i1 %133, label %139, label %134
134: ; preds = %129
%135 = load i32, i32* %12
%136 = load i32, i32* %9
%137 = sdiv i32 %136, 2
%138 = icmp sgt i32 %135, %137
br i1 %138, label %139, label %140
139: ; preds = %134, %129
store double 0.000000e+00, double* %5
br label %213
140: ; preds = %134
%141 = load double, double* %15
%142 = load double, double* %18
%143 = fcmp oeq double %141, %142
br i1 %143, label %144, label %171
144: ; preds = %140
store i32 1, i32* %13
store i32 0, i32* %10
br label %145
145: ; preds = %163, %144
%146 = load i32, i32* %10
%147 = load i32, i32* %9
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %166
149: ; preds = %145
%150 = load double*, double** %6
%151 = load i32, i32* %10
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
%154 = load double, double* %153
%155 = load double*, double** %7
%156 = load i32, i32* %10
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = fcmp une double %154, %159
br i1 %160, label %161, label %162
161: ; preds = %149
store i32 0, i32* %13
br label %166
162: ; preds = %149
br label %163
163: ; preds = %162
%164 = load i32, i32* %10
%165 = add nsw i32 %164, 1
store i32 %165, i32* %10
br label %145
166: ; preds = %161, %145
%167 = load i32, i32* %13
%168 = icmp ne i32 %167, 0
br i1 %168, label %169, label %170
169: ; preds = %166
store double 1.000000e+00, double* %5
br label %213
170: ; preds = %166
br label %171
171: ; preds = %170, %140
%172 = load double, double* %16
%173 = load double, double* %15
%174 = load double, double* %15
%175 = fmul double %173, %174
%176 = load i32, i32* %9
%177 = sitofp i32 %176 to double
%178 = fdiv double %175, %177
%179 = fsub double %172, %178
store double %179, double* %20
%180 = load double, double* %17
%181 = load double, double* %15
%182 = load double, double* %18
%183 = fmul double %181, %182
%184 = load i32, i32* %9
%185 = sitofp i32 %184 to double
%186 = fdiv double %183, %185
%187 = fsub double %180, %186
store double %187, double* %21
%188 = load double, double* %19
%189 = load double, double* %18
%190 = load double, double* %18
%191 = fmul double %189, %190
%192 = load i32, i32* %9
%193 = sitofp i32 %192 to double
%194 = fdiv double %191, %193
%195 = fsub double %188, %194
store double %195, double* %22
%196 = load double, double* %21
%197 = load double, double* %20
%198 = load double, double* %22
%199 = fmul double %197, %198
%200 = call double @sqrt(double %199)
%201 = fdiv double %196, %200
store double %201, double* %14
%202 = load double, double* %14
%203 = call i64 @isnan(double %202)
%204 = icmp ne i64 %203, 0
br i1 %204, label %205, label %206
205: ; preds = %171
store double 0.000000e+00, double* %5
br label %213
206: ; preds = %171
%207 = load double, double* %14
%208 = call i64 @isinf(double %207)
%209 = icmp ne i64 %208, 0
br i1 %209, label %210, label %211
210: ; preds = %206
store double 0.000000e+00, double* %5
br label %213
211: ; preds = %206
%212 = load double, double* %14
store double %212, double* %5
br label %213
213: ; preds = %211, %210, %205, %169, %139, %99
%214 = load double, double* %5
ret double %214
}

LLVM IR (-O2):
define double @PearsonsCorrelation(double* nocapture %0, double* nocapture %1, double %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %61
6: ; preds = %4
%7 = zext i32 %3 to i64
%8 = and i64 %7, 1
%9 = icmp eq i32 %3, 1
br i1 %9, label %42, label %10
10: ; preds = %6
%11 = and i64 %7, 4294967294
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 0, %10 ], [ %37, %12 ]
%14 = phi double [ 0.000000e+00, %10 ], [ %32, %12 ]
%15 = phi <2 x double> [ zeroinitializer, %10 ], [ %36, %12 ]
%16 = phi <2 x double> [ zeroinitializer, %10 ], [ %35, %12 ]
%17 = phi i64 [ 0, %10 ], [ %38, %12 ]
%18 = getelementptr inbounds double, double* %0, i64 %13
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %1, i64 %13
%21 = load double, double* %20
%22 = tail call double @llvm.fmuladd.f64(double %19, double %21, double %14)
%23 = insertelement <2 x double> poison, double %19, i64 0
%24 = insertelement <2 x double> %23, double %21, i64 1
%25 = fadd <2 x double> %16, %24
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %24, <2 x double> %15)
%27 = or i64 %13, 1
%28 = getelementptr inbounds double, double* %0, i64 %27
%29 = load double, double* %28
%30 = getelementptr inbounds double, double* %1, i64 %27
%31 = load double, double* %30
%32 = tail call double @llvm.fmuladd.f64(double %29, double %31, double %22)
%33 = insertelement <2 x double> poison, double %29, i64 0
%34 = insertelement <2 x double> %33, double %31, i64 1
%35 = fadd <2 x double> %25, %34
%36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %34, <2 x double> %26)
%37 = add nuw nsw i64 %13, 2
%38 = add i64 %17, 2
%39 = icmp eq i64 %38, %11
br i1 %39, label %40, label %12
40: ; preds = %12
%41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %34, <2 x double> %26)
br label %42
42: ; preds = %40, %6
%43 = phi double [ undef, %6 ], [ %32, %40 ]
%44 = phi <2 x double> [ undef, %6 ], [ %35, %40 ]
%45 = phi <2 x double> [ undef, %6 ], [ %41, %40 ]
%46 = phi i64 [ 0, %6 ], [ %37, %40 ]
%47 = phi double [ 0.000000e+00, %6 ], [ %32, %40 ]
%48 = phi <2 x double> [ zeroinitializer, %6 ], [ %36, %40 ]
%49 = phi <2 x double> [ zeroinitializer, %6 ], [ %35, %40 ]
%50 = icmp eq i64 %8, 0
br i1 %50, label %61, label %51
51: ; preds = %42
%52 = getelementptr inbounds double, double* %0, i64 %46
%53 = load double, double* %52
%54 = getelementptr inbounds double, double* %1, i64 %46
%55 = load double, double* %54
%56 = tail call double @llvm.fmuladd.f64(double %53, double %55, double %47)
%57 = insertelement <2 x double> poison, double %53, i64 0
%58 = insertelement <2 x double> %57, double %55, i64 1
%59 = fadd <2 x double> %49, %58
%60 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %58, <2 x double> %48)
br label %61
61: ; preds = %51, %42, %4
%62 = phi double [ 0.000000e+00, %4 ], [ %43, %42 ], [ %56, %51 ]
%63 = phi <2 x double> [ zeroinitializer, %4 ], [ %45, %42 ], [ %60, %51 ]
%64 = phi <2 x double> [ zeroinitializer, %4 ], [ %44, %42 ], [ %59, %51 ]
%65 = extractelement <2 x double> %64, i64 1
%66 = fmul double %65, %2
%67 = extractelement <2 x double> %64, i64 0
%68 = fcmp olt double %67, %66
%69 = fmul double %67, %2
%70 = fcmp olt double %65, %69
%71 = or i1 %70, %68
br i1 %71, label %183, label %72
72: ; preds = %61
%73 = fcmp olt double %67, 0x3D719799812DEA11
%74 = fcmp olt double %65, 0x3D719799812DEA11
%75 = select i1 %73, i1 %74, i1 false
br i1 %75, label %183, label %76
76: ; preds = %72
br i1 %5, label %77, label %140
77: ; preds = %76
%78 = zext i32 %3 to i64
%79 = icmp ult i32 %3, 4
br i1 %79, label %120, label %80
80: ; preds = %77
%81 = and i64 %78, 4294967292
br label %82
82: ; preds = %82, %80
%83 = phi i64 [ 0, %80 ], [ %112, %82 ]
%84 = phi <2 x i32> [ zeroinitializer, %80 ], [ %98, %82 ]
%85 = phi <2 x i32> [ zeroinitializer, %80 ], [ %99, %82 ]
%86 = phi <2 x i32> [ zeroinitializer, %80 ], [ %110, %82 ]
%87 = phi <2 x i32> [ zeroinitializer, %80 ], [ %111, %82 ]
%88 = getelementptr inbounds double, double* %0, i64 %83
%89 = bitcast double* %88 to <2 x double>*
%90 = load <2 x double>, <2 x double>* %89
%91 = getelementptr inbounds double, double* %88, i64 2
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = fcmp olt <2 x double> %90, <double 1.000000e-13, double 1.000000e-13>
%95 = fcmp olt <2 x double> %93, <double 1.000000e-13, double 1.000000e-13>
%96 = zext <2 x i1> %94 to <2 x i32>
%97 = zext <2 x i1> %95 to <2 x i32>
%98 = add <2 x i32> %84, %96
%99 = add <2 x i32> %85, %97
%100 = getelementptr inbounds double, double* %1, i64 %83
%101 = bitcast double* %100 to <2 x double>*
%102 = load <2 x double>, <2 x double>* %101
%103 = getelementptr inbounds double, double* %100, i64 2
%104 = bitcast double* %103 to <2 x double>*
%105 = load <2 x double>, <2 x double>* %104
%106 = fcmp olt <2 x double> %102, <double 1.000000e-13, double 1.000000e-13>
%107 = fcmp olt <2 x double> %105, <double 1.000000e-13, double 1.000000e-13>
%108 = zext <2 x i1> %106 to <2 x i32>
%109 = zext <2 x i1> %107 to <2 x i32>
%110 = add <2 x i32> %86, %108
%111 = add <2 x i32> %87, %109
%112 = add nuw i64 %83, 4
%113 = icmp eq i64 %112, %81
br i1 %113, label %114, label %82
114: ; preds = %82
%115 = add <2 x i32> %111, %110
%116 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %115)
%117 = add <2 x i32> %99, %98
%118 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %117)
%119 = icmp eq i64 %81, %78
br i1 %119, label %140, label %120
120: ; preds = %77, %114
%121 = phi i64 [ 0, %77 ], [ %81, %114 ]
%122 = phi i32 [ 0, %77 ], [ %118, %114 ]
%123 = phi i32 [ 0, %77 ], [ %116, %114 ]
br label %124
124: ; preds = %120, %124
%125 = phi i64 [ %138, %124 ], [ %121, %120 ]
%126 = phi i32 [ %132, %124 ], [ %122, %120 ]
%127 = phi i32 [ %137, %124 ], [ %123, %120 ]
%128 = getelementptr inbounds double, double* %0, i64 %125
%129 = load double, double* %128
%130 = fcmp olt double %129, 1.000000e-13
%131 = zext i1 %130 to i32
%132 = add nuw nsw i32 %126, %131
%133 = getelementptr inbounds double, double* %1, i64 %125
%134 = load double, double* %133
%135 = fcmp olt double %134, 1.000000e-13
%136 = zext i1 %135 to i32
%137 = add nuw nsw i32 %127, %136
%138 = add nuw nsw i64 %125, 1
%139 = icmp eq i64 %138, %78
br i1 %139, label %140, label %124
140: ; preds = %124, %114, %76
%141 = phi i32 [ 0, %76 ], [ %116, %114 ], [ %137, %124 ]
%142 = phi i32 [ 0, %76 ], [ %118, %114 ], [ %132, %124 ]
%143 = sdiv i32 %3, 2
%144 = icmp sgt i32 %142, %143
%145 = icmp sgt i32 %141, %143
%146 = select i1 %144, i1 true, i1 %145
br i1 %146, label %183, label %147
147: ; preds = %140
%148 = fcmp oeq double %67, %65
br i1 %148, label %149, label %162
149: ; preds = %147
br i1 %5, label %150, label %183
150: ; preds = %149
%151 = zext i32 %3 to i64
br label %154
152: ; preds = %154
%153 = icmp eq i64 %161, %151
br i1 %153, label %183, label %154
154: ; preds = %150, %152
%155 = phi i64 [ 0, %150 ], [ %161, %152 ]
%156 = getelementptr inbounds double, double* %0, i64 %155
%157 = load double, double* %156
%158 = getelementptr inbounds double, double* %1, i64 %155
%159 = load double, double* %158
%160 = fcmp une double %157, %159
%161 = add nuw nsw i64 %155, 1
br i1 %160, label %162, label %152
162: ; preds = %154, %147
%163 = sitofp i32 %3 to double
%164 = fmul double %67, %65
%165 = fdiv double %164, %163
%166 = fsub double %62, %165
%167 = fmul <2 x double> %64, %64
%168 = insertelement <2 x double> poison, double %163, i64 0
%169 = shufflevector <2 x double> %168, <2 x double> poison, <2 x i32> zeroinitializer
%170 = fdiv <2 x double> %167, %169
%171 = fsub <2 x double> %63, %170
%172 = shufflevector <2 x double> %171, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%173 = fmul <2 x double> %171, %172
%174 = extractelement <2 x double> %173, i64 0
%175 = tail call double @sqrt(double %174)
%176 = fdiv double %166, %175
%177 = tail call i64 @isnan(double %176)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %183
179: ; preds = %162
%180 = tail call i64 @isinf(double %176)
%181 = icmp eq i64 %180, 0
%182 = select i1 %181, double %176, double 0.000000e+00
br label %183
183: ; preds = %152, %149, %179, %162, %140, %61, %72
%184 = phi double [ 0.000000e+00, %72 ], [ 0.000000e+00, %61 ], [ 0.000000e+00, %140 ], [ 0.000000e+00, %162 ], [ %182, %179 ], [ 1.000000e+00, %149 ], [ 1.000000e+00, %152 ]
ret double %184
}