#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*/ freeMat(int, double ***);
int /*<<< orphan*/ initMat(int, int, double ***);
int /*<<< orphan*/ matrixMultiply(int, int, int, double **, double **,
                                  double **);
int /*<<< orphan*/ rref(int, int, double **);
double stub1(double);
int /*<<< orphan*/ transpose(int, int, double **, double **);
void discreteLeastSquares(int n, double *x, double *y, int m,
                          double (*(*phi))(double), double *result) {
  int i = 0;
  int j = 0;
  double *(*bMat);
  initMat(n, m, &bMat);
  double *(*bMatTr);
  initMat(m, n, &bMatTr);
  double *(*leastSqr);
  initMat(m, m + 1, &leastSqr);
  double *(*tempMat);
  initMat(m, m, &tempMat);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      bMat[i][j] = (*phi[j])(x[i]);
    }
  }
  transpose(n, m, bMat, bMatTr);
  matrixMultiply(m, n, m, bMatTr, bMat, tempMat);
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      leastSqr[i][m] += bMatTr[i][j] * y[j];
      if (j < m) {
        leastSqr[i][j] = tempMat[i][j];
      }
    }
  }
  rref(m, m + 1, leastSqr);
  for (i = 0; i < m; i++) {
    result[i] = leastSqr[i][m];
  }
  freeMat(n, &bMat);
  freeMat(m, &bMatTr);
  freeMat(m, &leastSqr);
  freeMat(m, &tempMat);
}


x86 assembly (clang, -O0):
<discreteLeastSquares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <initMat@plt>
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    -0x48(%rbp),%rdx
call   1030 <initMat@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    -0x50(%rbp),%rdx
call   1030 <initMat@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0x58(%rbp),%rdx
call   1030 <initMat@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1232 <discreteLeastSquares+0xe2>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    121f <discreteLeastSquares+0xcf>
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
call   *%rax
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11d5 <discreteLeastSquares+0x85>
jmp    1224 <discreteLeastSquares+0xd4>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c2 <discreteLeastSquares+0x72>
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
call   1050 <transpose@plt>
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x58(%rbp),%r9
call   1060 <matrixMultiply@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1325 <discreteLeastSquares+0x1d5>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1312 <discreteLeastSquares+0x1c2>
mov    -0x48(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x50(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12ff <discreteLeastSquares+0x1af>
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1304 <discreteLeastSquares+0x1b4>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1279 <discreteLeastSquares+0x129>
jmp    1317 <discreteLeastSquares+0x1c7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1266 <discreteLeastSquares+0x116>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x50(%rbp),%rdx
call   1070 <rref@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    137a <discreteLeastSquares+0x22a>
mov    -0x50(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    133e <discreteLeastSquares+0x1ee>
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   1040 <freeMat@plt>
mov    -0x1c(%rbp),%edi
lea    -0x48(%rbp),%rsi
call   1040 <freeMat@plt>
mov    -0x1c(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1040 <freeMat@plt>
mov    -0x1c(%rbp),%edi
lea    -0x58(%rbp),%rsi
call   1040 <freeMat@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discreteLeastSquares>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x40(%rsp)
mov    %r8,%rbx
mov    %ecx,%ebp
mov    %rdx,0x38(%rsp)
mov    %rsi,%r12
mov    %edi,%r13d
lea    0x18(%rsp),%rdx
mov    %ecx,%esi
call   1030 <initMat@plt>
lea    0x10(%rsp),%rdx
mov    %ebp,%edi
mov    %r13d,%esi
call   1030 <initMat@plt>
lea    0x1(%rbp),%esi
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %esi,0xc(%rsp)
call   1030 <initMat@plt>
lea    0x20(%rsp),%rdx
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <initMat@plt>
mov    %r13d,%r15d
mov    %rbp,0x30(%rsp)
mov    %ebp,%r14d
mov    %r13d,0x2c(%rsp)
test   %r13d,%r13d
jle    1212 <discreteLeastSquares+0xc2>
xor    %r13d,%r13d
jmp    11d9 <discreteLeastSquares+0x89>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    %r15,%r13
je     1212 <discreteLeastSquares+0xc2>
cmpl   $0x0,0x30(%rsp)
jle    11d0 <discreteLeastSquares+0x80>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12,%r13,8),%xmm0
call   *(%rbx,%rbp,8)
mov    0x18(%rsp),%rax
mov    (%rax,%r13,8),%rax
movsd  %xmm0,(%rax,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    11f0 <discreteLeastSquares+0xa0>
jmp    11d0 <discreteLeastSquares+0x80>
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    0x2c(%rsp),%r13d
mov    %r13d,%edi
mov    0x30(%rsp),%r12
mov    %r12d,%esi
call   1050 <transpose@plt>
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%r8
mov    0x20(%rsp),%r9
mov    %r12d,%edi
mov    %r13d,%esi
mov    %r12d,%edx
call   1060 <matrixMultiply@plt>
test   %r12d,%r12d
jle    12fb <discreteLeastSquares+0x1ab>
mov    0x10(%rsp),%r8
mov    (%rsp),%r9
xor    %edx,%edx
mov    0x38(%rsp),%rcx
jmp    1279 <discreteLeastSquares+0x129>
nopl   0x0(%rax)
add    $0x1,%rdx
cmp    %r14,%rdx
je     12c5 <discreteLeastSquares+0x175>
test   %r13d,%r13d
jle    1270 <discreteLeastSquares+0x120>
mov    (%r8,%rdx,8),%rsi
mov    (%r9,%rdx,8),%rdi
mov    0x20(%rsp),%rbx
xor    %eax,%eax
jmp    1299 <discreteLeastSquares+0x149>
nop
add    $0x1,%rax
cmp    %rax,%r15
je     1270 <discreteLeastSquares+0x120>
movsd  (%rsi,%rax,8),%xmm0
mulsd  (%rcx,%rax,8),%xmm0
addsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,(%rdi,%r14,8)
cmp    %r14,%rax
jae    1290 <discreteLeastSquares+0x140>
mov    (%rbx,%rdx,8),%rbp
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
jmp    1290 <discreteLeastSquares+0x140>
mov    (%rsp),%rdx
mov    %r12d,%edi
mov    0xc(%rsp),%esi
call   1070 <rref@plt>
test   %r12d,%r12d
mov    0x40(%rsp),%rbp
jle    13a8 <discreteLeastSquares+0x258>
mov    (%rsp),%rcx
lea    -0x1(%r14),%rdx
mov    %r14d,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    1310 <discreteLeastSquares+0x1c0>
xor    %edx,%edx
jmp    136c <discreteLeastSquares+0x21c>
mov    (%rsp),%rdx
mov    %r12d,%edi
mov    0xc(%rsp),%esi
call   1070 <rref@plt>
jmp    13a8 <discreteLeastSquares+0x258>
mov    %r14d,%esi
and    $0xfffffffc,%esi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    (%rcx,%rdx,8),%rdi
movsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rdx,8)
mov    0x8(%rcx,%rdx,8),%rdi
movsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,0x8(%rbp,%rdx,8)
mov    0x10(%rcx,%rdx,8),%rdi
movsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,0x10(%rbp,%rdx,8)
mov    0x18(%rcx,%rdx,8),%rdi
movsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,0x18(%rbp,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1320 <discreteLeastSquares+0x1d0>
test   %rax,%rax
je     13a8 <discreteLeastSquares+0x258>
lea    0x0(,%rdx,8),%rsi
add    %rbp,%rsi
lea    (%rcx,%rdx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rcx,%rdx,8),%rdi
movsd  (%rdi,%r14,8),%xmm0
movsd  %xmm0,(%rsi,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1390 <discreteLeastSquares+0x240>
lea    0x18(%rsp),%rsi
mov    %r13d,%edi
call   1040 <freeMat@plt>
lea    0x10(%rsp),%rsi
mov    %r12d,%edi
call   1040 <freeMat@plt>
mov    %rsp,%rsi
mov    %r12d,%edi
call   1040 <freeMat@plt>
lea    0x20(%rsp),%rsi
mov    %r12d,%edi
call   1040 <freeMat@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @discreteLeastSquares(i32 %0, double* nocapture %1, double* nocapture %2, i32 %3, double (double)** nocapture %4, double* nocapture writeonly %5) {
%7 = alloca double**
%8 = alloca double**
%9 = alloca double**
%10 = alloca double**
%11 = bitcast double*** %7 to i8*
%12 = call i32 @initMat(i32 %0, i32 %3, double*** %7)
%13 = bitcast double*** %8 to i8*
%14 = call i32 @initMat(i32 %3, i32 %0, double*** %8)
%15 = bitcast double*** %9 to i8*
%16 = add nsw i32 %3, 1
%17 = call i32 @initMat(i32 %3, i32 %16, double*** %9)
%18 = bitcast double*** %10 to i8*
%19 = call i32 @initMat(i32 %3, i32 %3, double*** %10)
%20 = icmp sgt i32 %0, 0
br i1 %20, label %21, label %44
21: ; preds = %6
%22 = icmp sgt i32 %3, 0
%23 = zext i32 %0 to i64
%24 = zext i32 %3 to i64
br label %25
25: ; preds = %21, %41
%26 = phi i64 [ 0, %21 ], [ %42, %41 ]
br i1 %22, label %27, label %41
27: ; preds = %25
%28 = getelementptr inbounds double, double* %1, i64 %26
br label %29
29: ; preds = %27, %29
%30 = phi i64 [ 0, %27 ], [ %39, %29 ]
%31 = getelementptr inbounds double (double)*, double (double)** %4, i64 %30
%32 = load double (double)*, double (double)** %31
%33 = load double, double* %28
%34 = call double %32(double %33)
%35 = load double**, double*** %7
%36 = getelementptr inbounds double*, double** %35, i64 %26
%37 = load double*, double** %36
%38 = getelementptr inbounds double, double* %37, i64 %30
store double %34, double* %38
%39 = add nuw nsw i64 %30, 1
%40 = icmp eq i64 %39, %24
br i1 %40, label %41, label %29
41: ; preds = %29, %25
%42 = add nuw nsw i64 %26, 1
%43 = icmp eq i64 %42, %23
br i1 %43, label %44, label %25
44: ; preds = %41, %6
%45 = load double**, double*** %7
%46 = load double**, double*** %8
%47 = call i32 @transpose(i32 %0, i32 %3, double** %45, double** %46)
%48 = load double**, double*** %8
%49 = load double**, double*** %7
%50 = load double**, double*** %10
%51 = call i32 @matrixMultiply(i32 %3, i32 %0, i32 %3, double** %48, double** %49, double** %50)
%52 = icmp sgt i32 %3, 0
br i1 %52, label %56, label %53
53: ; preds = %44
%54 = load double**, double*** %9
%55 = call i32 @rref(i32 %3, i32 %16, double** %54)
br label %146
56: ; preds = %44
%57 = load double**, double*** %8
%58 = load double**, double*** %9
%59 = zext i32 %3 to i64
%60 = zext i32 %3 to i64
%61 = zext i32 %0 to i64
br label %62
62: ; preds = %56, %89
%63 = phi i64 [ 0, %56 ], [ %90, %89 ]
br i1 %20, label %64, label %89
64: ; preds = %62
%65 = getelementptr inbounds double*, double** %57, i64 %63
%66 = load double*, double** %65
%67 = getelementptr inbounds double*, double** %58, i64 %63
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 %59
%70 = load double**, double*** %10
%71 = getelementptr inbounds double*, double** %70, i64 %63
br label %72
72: ; preds = %64, %86
%73 = phi i64 [ 0, %64 ], [ %87, %86 ]
%74 = getelementptr inbounds double, double* %66, i64 %73
%75 = load double, double* %74
%76 = getelementptr inbounds double, double* %2, i64 %73
%77 = load double, double* %76
%78 = load double, double* %69
%79 = call double @llvm.fmuladd.f64(double %75, double %77, double %78)
store double %79, double* %69
%80 = icmp ult i64 %73, %59
br i1 %80, label %81, label %86
81: ; preds = %72
%82 = load double*, double** %71
%83 = getelementptr inbounds double, double* %82, i64 %73
%84 = load double, double* %83
%85 = getelementptr inbounds double, double* %68, i64 %73
store double %84, double* %85
br label %86
86: ; preds = %72, %81
%87 = add nuw nsw i64 %73, 1
%88 = icmp eq i64 %87, %61
br i1 %88, label %89, label %72
89: ; preds = %86, %62
%90 = add nuw nsw i64 %63, 1
%91 = icmp eq i64 %90, %60
br i1 %91, label %92, label %62
92: ; preds = %89
%93 = load double**, double*** %9
%94 = call i32 @rref(i32 %3, i32 %16, double** %93)
br i1 %52, label %95, label %146
95: ; preds = %92
%96 = load double**, double*** %9
%97 = zext i32 %3 to i64
%98 = add nsw i64 %59, -1
%99 = and i64 %59, 3
%100 = icmp ult i64 %98, 3
br i1 %100, label %132, label %101
101: ; preds = %95
%102 = and i64 %59, 4294967292
br label %103
103: ; preds = %103, %101
%104 = phi i64 [ 0, %101 ], [ %129, %103 ]
%105 = phi i64 [ 0, %101 ], [ %130, %103 ]
%106 = getelementptr inbounds double*, double** %96, i64 %104
%107 = load double*, double** %106
%108 = getelementptr inbounds double, double* %107, i64 %97
%109 = load double, double* %108
%110 = getelementptr inbounds double, double* %5, i64 %104
store double %109, double* %110
%111 = or i64 %104, 1
%112 = getelementptr inbounds double*, double** %96, i64 %111
%113 = load double*, double** %112
%114 = getelementptr inbounds double, double* %113, i64 %97
%115 = load double, double* %114
%116 = getelementptr inbounds double, double* %5, i64 %111
store double %115, double* %116
%117 = or i64 %104, 2
%118 = getelementptr inbounds double*, double** %96, i64 %117
%119 = load double*, double** %118
%120 = getelementptr inbounds double, double* %119, i64 %97
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %5, i64 %117
store double %121, double* %122
%123 = or i64 %104, 3
%124 = getelementptr inbounds double*, double** %96, i64 %123
%125 = load double*, double** %124
%126 = getelementptr inbounds double, double* %125, i64 %97
%127 = load double, double* %126
%128 = getelementptr inbounds double, double* %5, i64 %123
store double %127, double* %128
%129 = add nuw nsw i64 %104, 4
%130 = add i64 %105, 4
%131 = icmp eq i64 %130, %102
br i1 %131, label %132, label %103
132: ; preds = %103, %95
%133 = phi i64 [ 0, %95 ], [ %129, %103 ]
%134 = icmp eq i64 %99, 0
br i1 %134, label %146, label %135
135: ; preds = %132, %135
%136 = phi i64 [ %143, %135 ], [ %133, %132 ]
%137 = phi i64 [ %144, %135 ], [ 0, %132 ]
%138 = getelementptr inbounds double*, double** %96, i64 %136
%139 = load double*, double** %138
%140 = getelementptr inbounds double, double* %139, i64 %97
%141 = load double, double* %140
%142 = getelementptr inbounds double, double* %5, i64 %136
store double %141, double* %142
%143 = add nuw nsw i64 %136, 1
%144 = add i64 %137, 1
%145 = icmp eq i64 %144, %99
br i1 %145, label %146, label %135
146: ; preds = %132, %135, %53, %92
%147 = call i32 @freeMat(i32 %0, double*** %7)
%148 = call i32 @freeMat(i32 %3, double*** %8)
%149 = call i32 @freeMat(i32 %3, double*** %9)
%150 = call i32 @freeMat(i32 %3, double*** %10)
ret void
}