#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 **convert_matrix(float *, int, int, int, int);
int /*<<< orphan*/ free_convert_matrix(float **, int, int, int, int);
int /*<<< orphan*/ free_matrix(float **, int, int, int, int);
float **matrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ svdvar(float **, int, float *, float **);
int main(void) {
  int i, j;
  float **cvm, **v;
  static float vtemp[6][6] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0,
                              2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
                              4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0,
                              5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0};
  static float w[6 + 1] = {0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
  static float tru[3][3] = {1.25, 2.5, 3.75, 2.5, 5.0, 7.5, 3.75, 7.5, 11.25};
  cvm = matrix(1, 3, 1, 3);
  v = convert_matrix(&vtemp[0][0], 1, 6, 1, 6);
  printf("\nmatrix v\n");
  for (i = 1; i <= 6; i++) {
    for (j = 1; j <= 6; j++)
      printf("%12.6f", v[i][j]);
    printf("\n");
  }
  printf("\nvector w\n");
  for (i = 1; i <= 6; i++)
    printf("%12.6f", w[i]);
  printf("\n");
  svdvar(v, 3, w, cvm);
  printf("\ncovariance matrix from svdvar\n");
  for (i = 1; i <= 3; i++) {
    for (j = 1; j <= 3; j++)
      printf("%12.6f", cvm[i][j]);
    printf("\n");
  }
  printf("\nexpected covariance matrix\n");
  for (i = 1; i <= 3; i++) {
    for (j = 1; j <= 3; j++)
      printf("%12.6f", tru[i - 1][j - 1]);
    printf("\n");
  }
  free_convert_matrix(v, 1, 6, 1, 6);
  free_matrix(cvm, 1, 3, 1, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1060 <matrix@plt>
mov    %rax,-0x18(%rbp)
lea    0x2ed3(%rip),%rdi
mov    $0x1,%ecx
mov    $0x6,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1080 <convert_matrix@plt>
mov    %rax,-0x20(%rbp)
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     1227 <main+0xc7>
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jg     120b <main+0xab>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe15(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11cc <main+0x6c>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bb <main+0x5b>
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     1276 <main+0x116>
movslq -0x8(%rbp),%rcx
lea    0x2e9f(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdaa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123c <main+0xdc>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x3,%esi
lea    0x2e58(%rip),%rdx
call   1070 <svdvar@plt>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     131e <main+0x1be>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     1302 <main+0x1a2>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd1e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12c3 <main+0x163>
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b2 <main+0x152>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     13af <main+0x24f>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     1393 <main+0x233>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2db2(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc8d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1344 <main+0x1e4>
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1333 <main+0x1d3>
mov    -0x20(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x6,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1030 <free_convert_matrix@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1040 <free_matrix@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1080 <matrix@plt>
mov    %rax,%r14
lea    0x2ec5(%rip),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
call   10a0 <convert_matrix@plt>
mov    %rax,%r12
lea    0xe68(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
lea    0xe50(%rip),%r15
mov    (%r12,%rbx,8),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    (%r12,%rbx,8),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    (%r12,%rbx,8),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    (%r12,%rbx,8),%rax
movss  0x10(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    (%r12,%rbx,8),%rax
movss  0x14(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    (%r12,%rbx,8),%rax
movss  0x18(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x7,%rbx
jne    11e0 <main+0x60>
lea    0xdb8(%rip),%rdi
call   1050 <puts@plt>
lea    0x2e6b(%rip),%rbx
movss  0x2e67(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd88(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x2e4e(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x2e3c(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x2e2a(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x2e18(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x2e06(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1090 <svdvar@plt>
lea    0xd07(%rip),%rdi
call   1050 <puts@plt>
mov    0x8(%r14),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x8(%r14),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x8(%r14),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%r14),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x10(%r14),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x10(%r14),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%r14),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x18(%r14),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x18(%r14),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc2d(%rip),%rdi
call   1050 <puts@plt>
movsd  0xbb6(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xbac(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xba2(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
movsd  0xb7b(%rip),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xb7c(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xb72(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
movsd  0xb43(%rip),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r15,%rdi
movsd  0xb41(%rip),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xb3a(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
call   1040 <free_convert_matrix@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1060 <free_matrix@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@main.vtemp = internal global [6 x [6 x float]] [[6 x float] [float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00], [6 x float] [float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00], [6 x float] [float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00], [6 x float] [float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00], [6 x float] [float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00], [6 x float] [float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00]]
@main.w = internal global [7 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00]
@main.tru = internal global [3 x [3 x float]] [[3 x float] [float 1.250000e+00, float 2.500000e+00, float 3.750000e+00], [3 x float] [float 2.500000e+00, float 5.000000e+00, float 7.500000e+00], [3 x float] [float 3.750000e+00, float 7.500000e+00, float 1.125000e+01]]
@.str = [11 x i8] c"\0Amatrix v\0A\00"
@.str.1 = [7 x i8] c"%12.6f\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [11 x i8] c"\0Avector w\0A\00"
@.str.4 = [32 x i8] c"\0Acovariance matrix from svdvar\0A\00"
@.str.5 = [29 x i8] c"\0Aexpected covariance matrix\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float**
%5 = alloca float**
store i32 0, i32* %1
%6 = call float** @matrix(i32 1, i32 3, i32 1, i32 3)
store float** %6, float*** %4
%7 = call float** @convert_matrix(float* getelementptr inbounds ([6 x [6 x float]], [6 x [6 x float]]* @main.vtemp, i64 0, i64 0, i64 0), i32 1, i32 6, i32 1, i32 6)
store float** %7, float*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %9
9: ; preds = %33, %0
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 6
br i1 %11, label %12, label %36
12: ; preds = %9
store i32 1, i32* %3
br label %13
13: ; preds = %28, %12
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 6
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = load float**, float*** %5
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float*, float** %17, i64 %19
%21 = load float*, float** %20
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %26)
br label %28
28: ; preds = %16
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %13
31: ; preds = %13
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %9
36: ; preds = %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %38
38: ; preds = %48, %36
%39 = load i32, i32* %2
%40 = icmp sle i32 %39, 6
br i1 %40, label %41, label %51
41: ; preds = %38
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [7 x float], [7 x float]* @main.w, i64 0, i64 %43
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %46)
br label %48
48: ; preds = %41
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %38
51: ; preds = %38
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%53 = load float**, float*** %5
%54 = load float**, float*** %4
%55 = call i32 @svdvar(float** %53, i32 3, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 0), float** %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %57
57: ; preds = %81, %51
%58 = load i32, i32* %2
%59 = icmp sle i32 %58, 3
br i1 %59, label %60, label %84
60: ; preds = %57
store i32 1, i32* %3
br label %61
61: ; preds = %76, %60
%62 = load i32, i32* %3
%63 = icmp sle i32 %62, 3
br i1 %63, label %64, label %79
64: ; preds = %61
%65 = load float**, float*** %4
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float*, float** %65, i64 %67
%69 = load float*, float** %68
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
%73 = load float, float* %72
%74 = fpext float %73 to double
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %74)
br label %76
76: ; preds = %64
%77 = load i32, i32* %3
%78 = add nsw i32 %77, 1
store i32 %78, i32* %3
br label %61
79: ; preds = %61
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %81
81: ; preds = %79
%82 = load i32, i32* %2
%83 = add nsw i32 %82, 1
store i32 %83, i32* %2
br label %57
84: ; preds = %57
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %86
86: ; preds = %110, %84
%87 = load i32, i32* %2
%88 = icmp sle i32 %87, 3
br i1 %88, label %89, label %113
89: ; preds = %86
store i32 1, i32* %3
br label %90
90: ; preds = %105, %89
%91 = load i32, i32* %3
%92 = icmp sle i32 %91, 3
br i1 %92, label %93, label %108
93: ; preds = %90
%94 = load i32, i32* %2
%95 = sub nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* @main.tru, i64 0, i64 %96
%98 = load i32, i32* %3
%99 = sub nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [3 x float], [3 x float]* %97, i64 0, i64 %100
%102 = load float, float* %101
%103 = fpext float %102 to double
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %103)
br label %105
105: ; preds = %93
%106 = load i32, i32* %3
%107 = add nsw i32 %106, 1
store i32 %107, i32* %3
br label %90
108: ; preds = %90
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %110
110: ; preds = %108
%111 = load i32, i32* %2
%112 = add nsw i32 %111, 1
store i32 %112, i32* %2
br label %86
113: ; preds = %86
%114 = load float**, float*** %5
%115 = call i32 @free_convert_matrix(float** %114, i32 1, i32 6, i32 1, i32 6)
%116 = load float**, float*** %4
%117 = call i32 @free_matrix(float** %116, i32 1, i32 3, i32 1, i32 3)
ret i32 0
}

LLVM IR (-O2):
@main.vtemp = internal global [6 x [6 x float]] [[6 x float] [float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00], [6 x float] [float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00], [6 x float] [float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00], [6 x float] [float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00, float 4.000000e+00], [6 x float] [float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00], [6 x float] [float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00, float 6.000000e+00]]
@main.w = internal global [7 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00]
@.str.1 = [7 x i8] c"%12.6f\00"
@str = [10 x i8] c"\0Amatrix v\00"
@str.6 = [10 x i8] c"\0Avector w\00"
@str.7 = [31 x i8] c"\0Acovariance matrix from svdvar\00"
@str.8 = [28 x i8] c"\0Aexpected covariance matrix\00"
define i32 @main() {
%1 = tail call float** @matrix(i32 1, i32 3, i32 1, i32 3)
%2 = tail call float** @convert_matrix(float* getelementptr inbounds ([6 x [6 x float]], [6 x [6 x float]]* @main.vtemp, i64 0, i64 0, i64 0), i32 1, i32 6, i32 1, i32 6)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 1, %0 ], [ %38, %4 ]
%6 = getelementptr inbounds float*, float** %2, i64 %5
%7 = load float*, float** %6
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %15)
%17 = load float*, float** %6
%18 = getelementptr inbounds float, float* %17, i64 3
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = load float*, float** %6
%23 = getelementptr inbounds float, float* %22, i64 4
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %25)
%27 = load float*, float** %6
%28 = getelementptr inbounds float, float* %27, i64 5
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %30)
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 6
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %35)
%37 = tail call i32 @putchar(i32 10)
%38 = add nuw nsw i64 %5, 1
%39 = icmp eq i64 %38, 7
br i1 %39, label %40, label %4
40: ; preds = %4
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
%42 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 1)
%43 = fpext float %42 to double
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %43)
%45 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 2)
%46 = fpext float %45 to double
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %46)
%48 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 3)
%49 = fpext float %48 to double
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %49)
%51 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 4)
%52 = fpext float %51 to double
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %52)
%54 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 5)
%55 = fpext float %54 to double
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %55)
%57 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 6)
%58 = fpext float %57 to double
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %58)
%60 = tail call i32 @putchar(i32 10)
%61 = tail call i32 @svdvar(float** %2, i32 3, float* getelementptr inbounds ([7 x float], [7 x float]* @main.w, i64 0, i64 0), float** %1)
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.7, i64 0, i64 0))
%63 = getelementptr inbounds float*, float** %1, i64 1
%64 = load float*, float** %63
%65 = getelementptr inbounds float, float* %64, i64 1
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %67)
%69 = load float*, float** %63
%70 = getelementptr inbounds float, float* %69, i64 2
%71 = load float, float* %70
%72 = fpext float %71 to double
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %72)
%74 = load float*, float** %63
%75 = getelementptr inbounds float, float* %74, i64 3
%76 = load float, float* %75
%77 = fpext float %76 to double
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %77)
%79 = tail call i32 @putchar(i32 10)
%80 = getelementptr inbounds float*, float** %1, i64 2
%81 = load float*, float** %80
%82 = getelementptr inbounds float, float* %81, i64 1
%83 = load float, float* %82
%84 = fpext float %83 to double
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %84)
%86 = load float*, float** %80
%87 = getelementptr inbounds float, float* %86, i64 2
%88 = load float, float* %87
%89 = fpext float %88 to double
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %89)
%91 = load float*, float** %80
%92 = getelementptr inbounds float, float* %91, i64 3
%93 = load float, float* %92
%94 = fpext float %93 to double
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %94)
%96 = tail call i32 @putchar(i32 10)
%97 = getelementptr inbounds float*, float** %1, i64 3
%98 = load float*, float** %97
%99 = getelementptr inbounds float, float* %98, i64 1
%100 = load float, float* %99
%101 = fpext float %100 to double
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %101)
%103 = load float*, float** %97
%104 = getelementptr inbounds float, float* %103, i64 2
%105 = load float, float* %104
%106 = fpext float %105 to double
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %106)
%108 = load float*, float** %97
%109 = getelementptr inbounds float, float* %108, i64 3
%110 = load float, float* %109
%111 = fpext float %110 to double
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %111)
%113 = tail call i32 @putchar(i32 10)
%114 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.8, i64 0, i64 0))
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 1.250000e+00)
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 2.500000e+00)
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 3.750000e+00)
%118 = tail call i32 @putchar(i32 10)
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 2.500000e+00)
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00)
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 7.500000e+00)
%122 = tail call i32 @putchar(i32 10)
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 3.750000e+00)
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 7.500000e+00)
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 1.125000e+01)
%126 = tail call i32 @putchar(i32 10)
%127 = tail call i32 @free_convert_matrix(float** %2, i32 1, i32 6, i32 1, i32 6)
%128 = tail call i32 @free_matrix(float** %1, i32 1, i32 3, i32 1, i32 3)
ret i32 0
}