#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 */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mult(double *, double *, int, int);
int /*<<< orphan*/ sub(double *, double *, double *, int);
void cov(double **S, double **X, double *mu, int n, int m) {
  int i, j, k;
  memset(S[0], 0, m * m * sizeof(double));
  double dx[m];
  if (m == 3) {
    for (i = 0; i < n; i++) {
      dx[0] = X[i][0] - mu[0];
      dx[1] = X[i][1] - mu[1];
      dx[2] = X[i][2] - mu[2];
      S[0][0] += dx[0] * dx[0];
      S[0][1] += dx[0] * dx[1];
      S[0][2] += dx[0] * dx[2];
      S[1][0] += dx[1] * dx[0];
      S[1][1] += dx[1] * dx[1];
      S[1][2] += dx[1] * dx[2];
      S[2][0] += dx[2] * dx[0];
      S[2][1] += dx[2] * dx[1];
      S[2][2] += dx[2] * dx[2];
    }
  } else {
    for (i = 0; i < n; i++) {
      sub(dx, X[i], mu, m);
      for (j = 0; j < m; j++)
        for (k = 0; k < m; k++)
          S[j][k] += dx[j] * dx[k];
    }
  }
  mult(S[0], S[0], 1 / (double)n, m * m);
}


x86 assembly (clang, -O0):
<cov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%edx
imul   %edx,%edx
shl    $0x3,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
cmpl   $0x3,-0x20(%rbp)
jne    134c <cov+0x21c>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1347 <cov+0x217>
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  (%rcx),%xmm0
mov    -0x18(%rbp),%rcx
subsd  (%rcx),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  0x8(%rcx),%xmm0
mov    -0x18(%rbp),%rcx
subsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  0x10(%rcx),%xmm0
mov    -0x18(%rbp),%rcx
subsd  0x10(%rcx),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  (%rax),%xmm0
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsd  (%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx)
movsd  (%rax),%xmm0
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsd  0x8(%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  (%rax),%xmm0
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsd  0x10(%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x8(%rax),%xmm0
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
movsd  (%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx)
movsd  0x8(%rax),%xmm0
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
movsd  0x8(%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x8(%rax),%xmm0
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
movsd  0x10(%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x10(%rax),%xmm0
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
movsd  (%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx)
movsd  0x10(%rax),%xmm0
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
movsd  0x8(%rcx),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x10(%rax),%xmm0
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119a <cov+0x6a>
jmp    1412 <cov+0x2e2>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    140d <cov+0x2dd>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
call   1050 <sub@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13fa <cov+0x2ca>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13e7 <cov+0x2b7>
mov    -0x48(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1395 <cov+0x265>
jmp    13ec <cov+0x2bc>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1382 <cov+0x252>
jmp    13ff <cov+0x2cf>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1353 <cov+0x223>
jmp    1412 <cov+0x2e2>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xbd3(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
mov    -0x20(%rbp),%ecx
imul   -0x20(%rbp),%ecx
call   1040 <mult@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cov>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %rdx,-0x48(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    (%rdi),%rdi
mov    %r8d,%ebx
imul   %ebx,%ebx
lea    0x0(,%rbx,8),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r15d,%r13d
mov    %rsp,%r14
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
cmp    $0x3,%r15d
mov    %rbx,-0x50(%rbp)
mov    %r12d,-0x2c(%rbp)
jne    12a5 <cov+0x175>
test   %r12d,%r12d
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%r10
mov    -0x38(%rbp),%r9
jle    145d <cov+0x32d>
mov    (%r10),%rax
mov    0x8(%r10),%rcx
mov    0x10(%r10),%rdx
mov    -0x2c(%rbp),%r8d
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
mov    (%r9,%rdi,8),%rbx
movupd (%rbx),%xmm0
movupd (%rsi),%xmm1
subpd  %xmm1,%xmm0
movapd %xmm0,(%r14)
movsd  0x10(%rbx),%xmm1
subsd  0x10(%rsi),%xmm1
movsd  %xmm1,0x10(%r14)
mulsd  %xmm0,%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  (%r14),%xmm0
movsd  0x8(%r14),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rax),%xmm1
movsd  %xmm1,0x8(%rax)
movsd  0x10(%r14),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rax),%xmm1
movsd  %xmm1,0x10(%rax)
mulsd  0x8(%r14),%xmm0
addsd  (%rcx),%xmm0
movsd  %xmm0,(%rcx)
movsd  0x8(%r14),%xmm0
mulsd  %xmm0,%xmm0
addsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x8(%r14),%xmm0
mulsd  0x10(%r14),%xmm0
addsd  0x10(%rcx),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x10(%r14),%xmm0
mulsd  (%r14),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x10(%r14),%xmm0
mulsd  0x8(%r14),%xmm0
addsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%r14),%xmm0
mulsd  %xmm0,%xmm0
addsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdx)
add    $0x1,%rdi
cmp    %rdi,%r8
jne    11c0 <cov+0x90>
jmp    145d <cov+0x32d>
test   %r12d,%r12d
mov    -0x48(%rbp),%rdx
mov    -0x40(%rbp),%r10
mov    -0x38(%rbp),%rax
jle    145d <cov+0x32d>
mov    -0x2c(%rbp),%ecx
mov    %rcx,-0x60(%rbp)
lea    (%r14,%r13,8),%r11
mov    %r13d,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,-0x70(%rbp)
mov    %r13,%r12
neg    %r12
lea    0x0(,%r13,8),%rbx
and    $0xffffffffffffffe0,%rbx
xor    %ecx,%ecx
mov    %r11,-0x58(%rbp)
jmp    130a <cov+0x1da>
nopl   0x0(%rax)
mov    -0x68(%rbp),%rcx
add    $0x1,%rcx
cmp    -0x60(%rbp),%rcx
mov    -0x48(%rbp),%rdx
mov    -0x38(%rbp),%rax
je     145d <cov+0x32d>
mov    %rcx,-0x68(%rbp)
mov    (%rax,%rcx,8),%rsi
mov    %r14,%rdi
mov    %r15d,%ecx
call   1050 <sub@plt>
mov    -0x58(%rbp),%r11
mov    -0x40(%rbp),%r10
test   %r15d,%r15d
jle    12f0 <cov+0x1c0>
xor    %eax,%eax
jmp    1339 <cov+0x209>
xchg   %ax,%ax
add    $0x1,%rax
cmp    %r13,%rax
je     12f0 <cov+0x1c0>
mov    (%r10,%rax,8),%rcx
cmp    $0x4,%r15d
jb     13e0 <cov+0x2b0>
lea    (%r14,%rax,8),%rdx
add    $0x8,%rdx
lea    (%r14,%rax,8),%rsi
lea    (%rcx,%r13,8),%rdi
cmp    %r11,%rcx
setb   %r8b
cmp    %rdi,%r14
setb   %r9b
cmp    %rdx,%rcx
setb   %dl
cmp    %rdi,%rsi
setb   %dil
test   %r9b,%r8b
jne    13e0 <cov+0x2b0>
mov    $0x0,%esi
and    %dil,%dl
jne    13e2 <cov+0x2b2>
movsd  (%r14,%rax,8),%xmm0
unpcklpd %xmm0,%xmm0
xor    %edx,%edx
nopl   (%rax)
movupd (%rcx,%rdx,1),%xmm1
movupd 0x10(%rcx,%rdx,1),%xmm2
movapd (%r14,%rdx,1),%xmm3
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
movapd 0x10(%r14,%rdx,1),%xmm1
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm3,(%rcx,%rdx,1)
movupd %xmm1,0x10(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rbx
jne    1390 <cov+0x260>
mov    -0x70(%rbp),%rdx
mov    %rdx,%rsi
cmp    %r13,%rdx
je     1330 <cov+0x200>
jmp    13e2 <cov+0x2b2>
xchg   %ax,%ax
xor    %esi,%esi
mov    %rsi,%rdx
test   $0x1,%r13b
je     1408 <cov+0x2d8>
movsd  (%r14,%rax,8),%xmm0
mulsd  (%r14,%rsi,8),%xmm0
addsd  (%rcx,%rsi,8),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
mov    %rsi,%rdx
or     $0x1,%rdx
not    %rsi
cmp    %r12,%rsi
je     1330 <cov+0x200>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14,%rax,8),%xmm0
mulsd  (%r14,%rdx,8),%xmm0
addsd  (%rcx,%rdx,8),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
movsd  (%r14,%rax,8),%xmm0
mulsd  0x8(%r14,%rdx,8),%xmm0
addsd  0x8(%rcx,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rcx,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%r13
jne    1420 <cov+0x2f0>
jmp    1330 <cov+0x200>
mov    (%r10),%rdi
xorps  %xmm0,%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xb90(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
mov    %rdi,%rsi
mov    -0x50(%rbp),%rcx
call   1040 <mult@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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