#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*/ MatAddition(float *, unsigned int *, float *, float *);
double MatDet2by2(float *);
float MatDet3by3(float *);
int /*<<< orphan*/ MatInv2by2(float *, float *);
int /*<<< orphan*/ MatInv3by3(float *, float *);
int /*<<< orphan*/ MatMultiplication(float *, unsigned int *, float *,
                                     unsigned int *, float *);
int /*<<< orphan*/ MatScalarMult(float *, unsigned int *, float, float *);
int /*<<< orphan*/ MatTranspose(float *, unsigned int *, float *);
int /*<<< orphan*/ NormalizeMatrix(float *, unsigned int *, float *);
int /*<<< orphan*/ crossSkew(float *, float *);
int /*<<< orphan*/ print(float *, int, int);
int /*<<< orphan*/ printf(char *, ...);
void MatLibtest(void) {
  printf("Matrix Library Test \n");
  float arr1[3][3] = {{1, 2, 3}, {1, 2, 3}, {1, 2, 3}};
  float arr2[3][3] = {{2, 0, 0}, {0, 2, 0}, {0, 0, 2}};
  float multiCheck[3][3] = {{0}};
  float additionCheck[3][3];
  float transposeCheck[3][3];
  float normCheck[3][3];
  float matInverse[3][3];
  unsigned int sizearr1[2] = {3, 3};
  unsigned int sizearr2[2] = {3, 3};
  printf("Matrix A \n");
  print((float *)arr1, 3, 3);
  printf("Matrix B \n");
  print((float *)arr2, 3, 3);
  MatMultiplication((float *)arr1, sizearr1, (float *)arr2, sizearr2,
                    (float *)multiCheck);
  printf("Matrix A*B \n");
  print((float *)multiCheck, 3, 3);
  float det = MatDet3by3((float *)multiCheck);
  printf("Determinant of Matrix A*B %f \n", det);
  MatAddition((float *)arr1, sizearr1, (float *)arr2, (float *)additionCheck);
  printf("Addition of Matrix A and B \n");
  print((float *)additionCheck, 3, 3);
  MatTranspose((float *)arr1, sizearr1, (float *)transposeCheck);
  printf("Transpose of Matrix A \n");
  print((float *)transposeCheck, 3, 3);
  MatInv3by3((float *)arr2, (float *)matInverse);
  printf("Inverse of Matrix B \n");
  print((float *)matInverse, 3, 3);
  float arr3[2][2] = {{2, 3}, {4, 2}};
  float invMat2by2[2][2];
  printf("Matrix C is \n");
  print((float *)arr3, 2, 2);
  printf("Determinant of Matrix C is %f \n", MatDet2by2((float *)arr3));
  MatInv2by2((float *)arr3, (float *)invMat2by2);
  printf("Inverse of Matrix C \n");
  print((float *)invMat2by2, 2, 2);
  float scalarMulti[3][3];
  float scalar = 2.0;
  MatScalarMult((float *)arr1, sizearr1, scalar, (float *)scalarMulti);
  printf("Scalar Multiplication of %f and Matrix A is \n", scalar);
  print((float *)scalarMulti, 3, 3);
  printf("Normalized Matrix B is \n");
  NormalizeMatrix((float *)arr2, sizearr2, (float *)normCheck);
  print((float *)normCheck, 3, 3);
  float omegaVec[3][1] = {{1}, {2}, {3}};
  float omegaVecT[1][3] = {{1, 2, 3}};
  float omegaSkew[3][3];
  printf("Vector \n");
  print((float *)omegaVec, 3, 1);
  printf("Vector \n");
  print((float *)omegaVecT, 1, 3);
  crossSkew((float *)omegaVec, (float *)omegaSkew);
  printf("SkewMatrix \n");
  print((float *)omegaSkew, 3, 3);
  crossSkew((float *)omegaVecT, (float *)omegaSkew);
  printf("SkewMatrix \n");
  print((float *)omegaSkew, 3, 3);
  float rotMat[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
  float accVec[3] = {1, 2, 3};
  unsigned int sizerotMat[2] = {3, 3};
  unsigned int sizeaccVec[2] = {3, 1};
  float op[3][1];
  MatMultiplication((float *)rotMat, sizerotMat, (float *)accVec, sizeaccVec,
                    (float *)op);
  printf("Rotation Matrix \n");
  print((float *)rotMat, 3, 3);
  printf("Vector \n");
  print((float *)accVec, 1, 3);
  printf("Matrix Array Multiplcation \n");
  print((float *)op, 3, 1);
  float xVec[1][2] = {{1, 1}};
  float xVecnorm[1][2];
  float yVec[2][1] = {{1}, {1}};
  float xyelem[1][1];
  unsigned int xSize[2] = {1, 2};
  unsigned int ySize[2] = {2, 1};
  MatMultiplication((float *)xVec, xSize, (float *)yVec, ySize,
                    (float *)xyelem);
  print((float *)xVec, 1, 2);
  print((float *)yVec, 2, 1);
  printf("%f \n", (xyelem[0][0] + 2.0));
  NormalizeMatrix((float *)xVec, xSize, (float *)xVecnorm);
  printf("Normalized Vector");
  print((float *)xVecnorm, 2, 1);
}


x86 assembly (clang, -O0):
<MatLibtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xfac(%rip),%rsi
mov    $0x24,%edx
call   10b0 <memcpy@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1080 <memset@plt>
movss  0xe0e(%rip),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  0xe01(%rip),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  0xdf4(%rip),%xmm0
movss  %xmm0,-0x40(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1080 <memset@plt>
mov    0xda9(%rip),%rax
mov    %rax,-0x158(%rbp)
mov    0xd9b(%rip),%rax
mov    %rax,-0x160(%rbp)
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x30(%rbp),%rdi
lea    -0x158(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x160(%rbp),%rcx
lea    -0x90(%rbp),%r8
call   10f0 <MatMultiplication@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x90(%rbp),%rdi
call   1050 <MatDet3by3@plt>
movss  %xmm0,-0x164(%rbp)
ff
movss  -0x164(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd41(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x158(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
call   10e0 <MatAddition@plt>
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc0(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x30(%rbp),%rdi
lea    -0x158(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
call   10c0 <MatTranspose@plt>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x60(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1030 <MatInv3by3@plt>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
mov    0xe33(%rip),%rax
mov    %rax,-0x180(%rbp)
mov    0xe2d(%rip),%rax
mov    %rax,-0x178(%rbp)
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x180(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x180(%rbp),%rdi
call   1090 <MatDet2by2@plt>
lea    0xcbd(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    -0x180(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1040 <MatInv2by2@plt>
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x190(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   10a0 <print@plt>
movss  0xbdb(%rip),%xmm0
movss  %xmm0,-0x1c4(%rbp)
ff
lea    -0x30(%rbp),%rdi
lea    -0x158(%rbp),%rsi
movss  -0x1c4(%rbp),%xmm0
ff
lea    -0x1c0(%rbp),%rdx
call   1060 <MatScalarMult@plt>
movss  -0x1c4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xc76(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    -0x1c0(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x160(%rbp),%rsi
lea    -0x120(%rbp),%rdx
call   10d0 <NormalizeMatrix@plt>
lea    -0x120(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
mov    0xce8(%rip),%rax
mov    %rax,-0x1d0(%rbp)
mov    0xce3(%rip),%eax
mov    %eax,-0x1c8(%rbp)
mov    0xcda(%rip),%rax
mov    %rax,-0x1dc(%rbp)
mov    0xcd5(%rip),%eax
mov    %eax,-0x1d4(%rbp)
lea    0xc30(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1d0(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1dc(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    -0x1d0(%rbp),%rdi
lea    -0x200(%rbp),%rsi
call   1100 <crossSkew@plt>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x200(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x1dc(%rbp),%rdi
lea    -0x200(%rbp),%rsi
call   1100 <crossSkew@plt>
lea    0xbaa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x200(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1080 <memset@plt>
movss  0xa4c(%rip),%xmm0
movss  %xmm0,-0x230(%rbp)
ff
movss  0xa3c(%rip),%xmm0
movss  %xmm0,-0x220(%rbp)
ff
movss  0xa2c(%rip),%xmm0
movss  %xmm0,-0x210(%rbp)
ff
mov    0xbd9(%rip),%rax
mov    %rax,-0x23c(%rbp)
mov    0xbd4(%rip),%eax
mov    %eax,-0x234(%rbp)
mov    0x9db(%rip),%rax
mov    %rax,-0x244(%rbp)
mov    0x9d5(%rip),%rax
mov    %rax,-0x24c(%rbp)
lea    -0x230(%rbp),%rdi
lea    -0x244(%rbp),%rsi
lea    -0x23c(%rbp),%rdx
lea    -0x24c(%rbp),%rcx
lea    -0x258(%rbp),%r8
call   10f0 <MatMultiplication@plt>
lea    0xaf5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x230(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   10a0 <print@plt>
lea    0xabe(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x23c(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0xac2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x258(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
mov    0x93e(%rip),%rax
mov    %rax,-0x260(%rbp)
mov    0x930(%rip),%rax
mov    %rax,-0x270(%rbp)
mov    0x92a(%rip),%rax
mov    %rax,-0x27c(%rbp)
mov    0x924(%rip),%rax
mov    %rax,-0x284(%rbp)
lea    -0x260(%rbp),%rdi
lea    -0x27c(%rbp),%rsi
lea    -0x270(%rbp),%rdx
lea    -0x284(%rbp),%rcx
lea    -0x274(%rbp),%r8
call   10f0 <MatMultiplication@plt>
lea    -0x260(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   10a0 <print@plt>
lea    -0x270(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
movss  -0x274(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0x88d(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0x8f7(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    -0x260(%rbp),%rdi
lea    -0x27c(%rbp),%rsi
lea    -0x268(%rbp),%rdx
call   10d0 <NormalizeMatrix@plt>
lea    0x9ef(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x268(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatLibtest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x288,%rsp
lea    0xeef(%rip),%rdi
call   1050 <puts@plt>
mov    0xe3d(%rip),%eax
mov    %eax,0x150(%rsp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe00(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movl   $0x40000000,0xb0(%rsp)
movl   $0x40000000,0xc0(%rsp)
movl   $0x40000000,0xd0(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movl   $0x0,0x120(%rsp)
movabs $0x300000003,%rax
mov    %rax,0x78(%rsp)
mov    %rax,0x70(%rsp)
lea    0xe9f(%rip),%rdi
call   1050 <puts@plt>
lea    0x130(%rsp),%r13
mov    %r13,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0xe8e(%rip),%rdi
call   1050 <puts@plt>
lea    0xb0(%rsp),%r15
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0x78(%rsp),%r12
lea    0x70(%rsp),%r14
lea    0x100(%rsp),%rbx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
call   10e0 <MatMultiplication@plt>
lea    0xdf8(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
mov    %rbx,%rdi
call   1060 <MatDet3by3@plt>
cvtss2sd %xmm0,%xmm0
lea    0xd3a(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0x260(%rsp),%rbx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   10d0 <MatAddition@plt>
lea    0xdb3(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0x230(%rsp),%rbx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10b0 <MatTranspose@plt>
lea    0xd9b(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0x1d0(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <MatInv3by3@plt>
lea    0xd81(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
movaps 0xdf8(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
lea    0xd69(%rip),%rdi
call   1050 <puts@plt>
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   10a0 <print@plt>
mov    %rbx,%rdi
call   1090 <MatDet2by2@plt>
lea    0xc72(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0x160(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <MatInv2by2@plt>
lea    0xd27(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   10a0 <print@plt>
movss  0xbbb(%rip),%xmm0
lea    0x1a0(%rsp),%rbx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1070 <MatScalarMult@plt>
lea    0xc35(%rip),%rdi
movsd  0xb9e(%rip),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0xcd8(%rip),%rdi
call   1050 <puts@plt>
lea    0x200(%rsp),%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   10c0 <NormalizeMatrix@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
mov    0xb7f(%rip),%eax
mov    %eax,0x68(%rsp)
mov    0xb6c(%rip),%rax
mov    %rax,0x60(%rsp)
mov    0xb75(%rip),%eax
mov    %eax,0x58(%rsp)
mov    0xb62(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xcad(%rip),%r14
mov    %r14,%rdi
call   1050 <puts@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
lea    0x50(%rsp),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0x170(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10f0 <crossSkew@plt>
lea    0xc38(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10f0 <crossSkew@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movl   $0x3f800000,0x80(%rsp)
movl   $0x3f800000,0x90(%rsp)
movl   $0x3f800000,0xa0(%rsp)
mov    0xa99(%rip),%eax
mov    %eax,0x48(%rsp)
mov    0xa86(%rip),%rax
mov    %rax,0x40(%rsp)
movabs $0x300000003,%rax
mov    %rax,0x38(%rsp)
movabs $0x100000002,%r12
lea    0x1(%r12),%rax
mov    %rax,0x30(%rsp)
lea    0x80(%rsp),%rbp
lea    0x38(%rsp),%rsi
lea    0x40(%rsp),%rbx
lea    0x30(%rsp),%rcx
lea    0x154(%rsp),%r15
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r15,%r8
call   10e0 <MatMultiplication@plt>
lea    0xb64(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   10a0 <print@plt>
lea    0xb45(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
movabs $0x3f8000003f800000,%rax
mov    %rax,0x28(%rsp)
mov    %rax,0x20(%rsp)
movabs $0x200000001,%rax
mov    %rax,0x18(%rsp)
mov    %r12,0x10(%rsp)
lea    0x28(%rsp),%rbx
lea    0x18(%rsp),%r14
lea    0x20(%rsp),%rbp
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   10e0 <MatMultiplication@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   10a0 <print@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0x912(%rip),%xmm0
lea    0x975(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xf8(%rsp),%rbp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   10c0 <NormalizeMatrix@plt>
lea    0x9a4(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   10a0 <print@plt>
add    $0x288,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Matrix Library Test \0A\00"
@__const.MatLibtest.arr1 = [3 x [3 x float]] [[3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00], [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00], [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]]
@__const.MatLibtest.sizearr1 = [2 x i32] [i32 3, i32 3]
@__const.MatLibtest.sizearr2 = [2 x i32] [i32 3, i32 3]
@.str.1 = [11 x i8] c"Matrix A \0A\00"
@.str.2 = [11 x i8] c"Matrix B \0A\00"
@.str.3 = [13 x i8] c"Matrix A*B \0A\00"
@.str.4 = [31 x i8] c"Determinant of Matrix A*B %f \0A\00"
@.str.5 = [29 x i8] c"Addition of Matrix A and B \0A\00"
@.str.6 = [24 x i8] c"Transpose of Matrix A \0A\00"
@.str.7 = [22 x i8] c"Inverse of Matrix B \0A\00"
@__const.MatLibtest.arr3 = [2 x [2 x float]] [[2 x float] [float 2.000000e+00, float 3.000000e+00], [2 x float] [float 4.000000e+00, float 2.000000e+00]]
@.str.8 = [14 x i8] c"Matrix C is \0A\00"
@.str.9 = [32 x i8] c"Determinant of Matrix C is %f \0A\00"
@.str.10 = [22 x i8] c"Inverse of Matrix C \0A\00"
@.str.11 = [46 x i8] c"Scalar Multiplication of %f and Matrix A is \0A\00"
@.str.12 = [25 x i8] c"Normalized Matrix B is \0A\00"
@__const.MatLibtest.omegaVec = [3 x [1 x float]] [[1 x float] [float 1.000000e+00], [1 x float] [float 2.000000e+00], [1 x float] [float 3.000000e+00]]
@__const.MatLibtest.omegaVecT = [1 x [3 x float]] [[3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]]
@.str.13 = [9 x i8] c"Vector \0A\00"
@.str.14 = [13 x i8] c"SkewMatrix \0A\00"
@__const.MatLibtest.accVec = [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]
@__const.MatLibtest.sizerotMat = [2 x i32] [i32 3, i32 3]
@__const.MatLibtest.sizeaccVec = [2 x i32] [i32 3, i32 1]
@.str.15 = [18 x i8] c"Rotation Matrix \0A\00"
@.str.16 = [29 x i8] c"Matrix Array Multiplcation \0A\00"
@__const.MatLibtest.xVec = [1 x [2 x float]] [[2 x float] [float 1.000000e+00, float 1.000000e+00]]
@__const.MatLibtest.yVec = [2 x [1 x float]] [[1 x float] [float 1.000000e+00], [1 x float] [float 1.000000e+00]]
@__const.MatLibtest.xSize = [2 x i32] [i32 1, i32 2]
@__const.MatLibtest.ySize = [2 x i32] [i32 2, i32 1]
@.str.17 = [5 x i8] c"%f \0A\00"
@.str.18 = [18 x i8] c"Normalized Vector\00"
define void @MatLibtest() {
%1 = alloca [3 x [3 x float]]
%2 = alloca [3 x [3 x float]]
%3 = alloca [3 x [3 x float]]
%4 = alloca [3 x [3 x float]]
%5 = alloca [3 x [3 x float]]
%6 = alloca [3 x [3 x float]]
%7 = alloca [3 x [3 x float]]
%8 = alloca [2 x i32]
%9 = alloca [2 x i32]
%10 = alloca float
%11 = alloca [2 x [2 x float]]
%12 = alloca [2 x [2 x float]]
%13 = alloca [3 x [3 x float]]
%14 = alloca float
%15 = alloca [3 x [1 x float]]
%16 = alloca [1 x [3 x float]]
%17 = alloca [3 x [3 x float]]
%18 = alloca [3 x [3 x float]]
%19 = alloca [3 x float]
%20 = alloca [2 x i32]
%21 = alloca [2 x i32]
%22 = alloca [3 x [1 x float]]
%23 = alloca [1 x [2 x float]]
%24 = alloca [1 x [2 x float]]
%25 = alloca [2 x [1 x float]]
%26 = alloca [1 x [1 x float]]
%27 = alloca [2 x i32]
%28 = alloca [2 x i32]
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%30 = bitcast [3 x [3 x float]]* %1 to i8*
%31 = bitcast [3 x [3 x float]]* %2 to i8*
%32 = bitcast i8* %31 to [3 x [3 x float]]*
%33 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %32, i32 0, i32 0
%34 = getelementptr inbounds [3 x float], [3 x float]* %33, i32 0, i32 0
store float 2.000000e+00, float* %34
%35 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %32, i32 0, i32 1
%36 = getelementptr inbounds [3 x float], [3 x float]* %35, i32 0, i32 1
store float 2.000000e+00, float* %36
%37 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %32, i32 0, i32 2
%38 = getelementptr inbounds [3 x float], [3 x float]* %37, i32 0, i32 2
store float 2.000000e+00, float* %38
%39 = bitcast [3 x [3 x float]]* %3 to i8*
%40 = bitcast [2 x i32]* %8 to i8*
%41 = bitcast [2 x i32]* %9 to i8*
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%43 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0
%44 = bitcast [3 x float]* %43 to float*
%45 = call i32 @print(float* %44, i32 3, i32 3)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%47 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0
%48 = bitcast [3 x float]* %47 to float*
%49 = call i32 @print(float* %48, i32 3, i32 3)
%50 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0
%51 = bitcast [3 x float]* %50 to float*
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%53 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0
%54 = bitcast [3 x float]* %53 to float*
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%56 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %3, i64 0, i64 0
%57 = bitcast [3 x float]* %56 to float*
%58 = call i32 @MatMultiplication(float* %51, i32* %52, float* %54, i32* %55, float* %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%60 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %3, i64 0, i64 0
%61 = bitcast [3 x float]* %60 to float*
%62 = call i32 @print(float* %61, i32 3, i32 3)
%63 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %3, i64 0, i64 0
%64 = bitcast [3 x float]* %63 to float*
%65 = call float @MatDet3by3(float* %64)
store float %65, float* %10
%66 = load float, float* %10
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %67)
%69 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0
%70 = bitcast [3 x float]* %69 to float*
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%72 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0
%73 = bitcast [3 x float]* %72 to float*
%74 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %4, i64 0, i64 0
%75 = bitcast [3 x float]* %74 to float*
%76 = call i32 @MatAddition(float* %70, i32* %71, float* %73, float* %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%78 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %4, i64 0, i64 0
%79 = bitcast [3 x float]* %78 to float*
%80 = call i32 @print(float* %79, i32 3, i32 3)
%81 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0
%82 = bitcast [3 x float]* %81 to float*
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%84 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 0
%85 = bitcast [3 x float]* %84 to float*
%86 = call i32 @MatTranspose(float* %82, i32* %83, float* %85)
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%88 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 0
%89 = bitcast [3 x float]* %88 to float*
%90 = call i32 @print(float* %89, i32 3, i32 3)
%91 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0
%92 = bitcast [3 x float]* %91 to float*
%93 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0
%94 = bitcast [3 x float]* %93 to float*
%95 = call i32 @MatInv3by3(float* %92, float* %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%97 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0
%98 = bitcast [3 x float]* %97 to float*
%99 = call i32 @print(float* %98, i32 3, i32 3)
%100 = bitcast [2 x [2 x float]]* %11 to i8*
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%102 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %11, i64 0, i64 0
%103 = bitcast [2 x float]* %102 to float*
%104 = call i32 @print(float* %103, i32 2, i32 2)
%105 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %11, i64 0, i64 0
%106 = bitcast [2 x float]* %105 to float*
%107 = call double @MatDet2by2(float* %106)
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), double %107)
%109 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %11, i64 0, i64 0
%110 = bitcast [2 x float]* %109 to float*
%111 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %12, i64 0, i64 0
%112 = bitcast [2 x float]* %111 to float*
%113 = call i32 @MatInv2by2(float* %110, float* %112)
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%115 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %12, i64 0, i64 0
%116 = bitcast [2 x float]* %115 to float*
%117 = call i32 @print(float* %116, i32 2, i32 2)
store float 2.000000e+00, float* %14
%118 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0
%119 = bitcast [3 x float]* %118 to float*
%120 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%121 = load float, float* %14
%122 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 0
%123 = bitcast [3 x float]* %122 to float*
%124 = call i32 @MatScalarMult(float* %119, i32* %120, float %121, float* %123)
%125 = load float, float* %14
%126 = fpext float %125 to double
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), double %126)
%128 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %13, i64 0, i64 0
%129 = bitcast [3 x float]* %128 to float*
%130 = call i32 @print(float* %129, i32 3, i32 3)
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
%132 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0
%133 = bitcast [3 x float]* %132 to float*
%134 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%135 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0
%136 = bitcast [3 x float]* %135 to float*
%137 = call i32 @NormalizeMatrix(float* %133, i32* %134, float* %136)
%138 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0
%139 = bitcast [3 x float]* %138 to float*
%140 = call i32 @print(float* %139, i32 3, i32 3)
%141 = bitcast [3 x [1 x float]]* %15 to i8*
%142 = bitcast [1 x [3 x float]]* %16 to i8*
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%144 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %15, i64 0, i64 0
%145 = bitcast [1 x float]* %144 to float*
%146 = call i32 @print(float* %145, i32 3, i32 1)
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%148 = getelementptr inbounds [1 x [3 x float]], [1 x [3 x float]]* %16, i64 0, i64 0
%149 = bitcast [3 x float]* %148 to float*
%150 = call i32 @print(float* %149, i32 1, i32 3)
%151 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %15, i64 0, i64 0
%152 = bitcast [1 x float]* %151 to float*
%153 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %17, i64 0, i64 0
%154 = bitcast [3 x float]* %153 to float*
%155 = call i32 @crossSkew(float* %152, float* %154)
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%157 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %17, i64 0, i64 0
%158 = bitcast [3 x float]* %157 to float*
%159 = call i32 @print(float* %158, i32 3, i32 3)
%160 = getelementptr inbounds [1 x [3 x float]], [1 x [3 x float]]* %16, i64 0, i64 0
%161 = bitcast [3 x float]* %160 to float*
%162 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %17, i64 0, i64 0
%163 = bitcast [3 x float]* %162 to float*
%164 = call i32 @crossSkew(float* %161, float* %163)
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%166 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %17, i64 0, i64 0
%167 = bitcast [3 x float]* %166 to float*
%168 = call i32 @print(float* %167, i32 3, i32 3)
%169 = bitcast [3 x [3 x float]]* %18 to i8*
%170 = bitcast i8* %169 to [3 x [3 x float]]*
%171 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %170, i32 0, i32 0
%172 = getelementptr inbounds [3 x float], [3 x float]* %171, i32 0, i32 0
store float 1.000000e+00, float* %172
%173 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %170, i32 0, i32 1
%174 = getelementptr inbounds [3 x float], [3 x float]* %173, i32 0, i32 1
store float 1.000000e+00, float* %174
%175 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %170, i32 0, i32 2
%176 = getelementptr inbounds [3 x float], [3 x float]* %175, i32 0, i32 2
store float 1.000000e+00, float* %176
%177 = bitcast [3 x float]* %19 to i8*
%178 = bitcast [2 x i32]* %20 to i8*
%179 = bitcast [2 x i32]* %21 to i8*
%180 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %18, i64 0, i64 0
%181 = bitcast [3 x float]* %180 to float*
%182 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 0
%183 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%184 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 0
%185 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %22, i64 0, i64 0
%186 = bitcast [1 x float]* %185 to float*
%187 = call i32 @MatMultiplication(float* %181, i32* %182, float* %183, i32* %184, float* %186)
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
%189 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %18, i64 0, i64 0
%190 = bitcast [3 x float]* %189 to float*
%191 = call i32 @print(float* %190, i32 3, i32 3)
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%193 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 0
%194 = call i32 @print(float* %193, i32 1, i32 3)
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0))
%196 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %22, i64 0, i64 0
%197 = bitcast [1 x float]* %196 to float*
%198 = call i32 @print(float* %197, i32 3, i32 1)
%199 = bitcast [1 x [2 x float]]* %23 to i8*
%200 = bitcast [2 x [1 x float]]* %25 to i8*
%201 = bitcast [2 x i32]* %27 to i8*
%202 = bitcast [2 x i32]* %28 to i8*
%203 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %23, i64 0, i64 0
%204 = bitcast [2 x float]* %203 to float*
%205 = getelementptr inbounds [2 x i32], [2 x i32]* %27, i64 0, i64 0
%206 = getelementptr inbounds [2 x [1 x float]], [2 x [1 x float]]* %25, i64 0, i64 0
%207 = bitcast [1 x float]* %206 to float*
%208 = getelementptr inbounds [2 x i32], [2 x i32]* %28, i64 0, i64 0
%209 = getelementptr inbounds [1 x [1 x float]], [1 x [1 x float]]* %26, i64 0, i64 0
%210 = bitcast [1 x float]* %209 to float*
%211 = call i32 @MatMultiplication(float* %204, i32* %205, float* %207, i32* %208, float* %210)
%212 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %23, i64 0, i64 0
%213 = bitcast [2 x float]* %212 to float*
%214 = call i32 @print(float* %213, i32 1, i32 2)
%215 = getelementptr inbounds [2 x [1 x float]], [2 x [1 x float]]* %25, i64 0, i64 0
%216 = bitcast [1 x float]* %215 to float*
%217 = call i32 @print(float* %216, i32 2, i32 1)
%218 = getelementptr inbounds [1 x [1 x float]], [1 x [1 x float]]* %26, i64 0, i64 0
%219 = getelementptr inbounds [1 x float], [1 x float]* %218, i64 0, i64 0
%220 = load float, float* %219
%221 = fpext float %220 to double
%222 = fadd double %221, 2.000000e+00
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), double %222)
%224 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %23, i64 0, i64 0
%225 = bitcast [2 x float]* %224 to float*
%226 = getelementptr inbounds [2 x i32], [2 x i32]* %27, i64 0, i64 0
%227 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %24, i64 0, i64 0
%228 = bitcast [2 x float]* %227 to float*
%229 = call i32 @NormalizeMatrix(float* %225, i32* %226, float* %228)
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0))
%231 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %24, i64 0, i64 0
%232 = bitcast [2 x float]* %231 to float*
%233 = call i32 @print(float* %232, i32 2, i32 1)
ret void
}

LLVM IR (-O2):
@__const.MatLibtest.arr1 = [3 x [3 x float]] [[3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00], [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00], [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]]
@.str.4 = [31 x i8] c"Determinant of Matrix A*B %f \0A\00"
@__const.MatLibtest.arr3 = [2 x [2 x float]] [[2 x float] [float 2.000000e+00, float 3.000000e+00], [2 x float] [float 4.000000e+00, float 2.000000e+00]]
@.str.9 = [32 x i8] c"Determinant of Matrix C is %f \0A\00"
@.str.11 = [46 x i8] c"Scalar Multiplication of %f and Matrix A is \0A\00"
@__const.MatLibtest.omegaVec = [3 x [1 x float]] [[1 x float] [float 1.000000e+00], [1 x float] [float 2.000000e+00], [1 x float] [float 3.000000e+00]]
@__const.MatLibtest.omegaVecT = [1 x [3 x float]] [[3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]]
@__const.MatLibtest.accVec = [3 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00]
@.str.17 = [5 x i8] c"%f \0A\00"
@.str.18 = [18 x i8] c"Normalized Vector\00"
@str = [21 x i8] c"Matrix Library Test \00"
@str.19 = [10 x i8] c"Matrix A \00"
@str.20 = [10 x i8] c"Matrix B \00"
@str.21 = [12 x i8] c"Matrix A*B \00"
@str.22 = [28 x i8] c"Addition of Matrix A and B \00"
@str.23 = [23 x i8] c"Transpose of Matrix A \00"
@str.24 = [21 x i8] c"Inverse of Matrix B \00"
@str.25 = [13 x i8] c"Matrix C is \00"
@str.26 = [21 x i8] c"Inverse of Matrix C \00"
@str.27 = [24 x i8] c"Normalized Matrix B is \00"
@str.31 = [12 x i8] c"SkewMatrix \00"
@str.32 = [17 x i8] c"Rotation Matrix \00"
@str.33 = [8 x i8] c"Vector \00"
@str.34 = [28 x i8] c"Matrix Array Multiplcation \00"
define void @MatLibtest() {
%1 = alloca [3 x [3 x float]]
%2 = alloca [3 x [3 x float]]
%3 = alloca [3 x [3 x float]]
%4 = alloca [3 x [3 x float]]
%5 = alloca [3 x [3 x float]]
%6 = alloca [3 x [3 x float]]
%7 = alloca [3 x [3 x float]]
%8 = alloca i64
%9 = alloca i64
%10 = alloca [2 x [2 x float]]
%11 = alloca [2 x [2 x float]]
%12 = alloca [3 x [3 x float]]
%13 = alloca [3 x [1 x float]]
%14 = alloca [1 x [3 x float]]
%15 = alloca [3 x [3 x float]]
%16 = alloca [3 x [3 x float]]
%17 = alloca [3 x float]
%18 = alloca i64
%19 = alloca i64
%20 = alloca [3 x [1 x float]]
%21 = alloca i64
%22 = alloca [1 x [2 x float]]
%23 = alloca i64
%24 = alloca [1 x [1 x float]]
%25 = alloca i64
%26 = alloca i64
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%28 = bitcast [3 x [3 x float]]* %1 to i8*
%29 = bitcast [3 x [3 x float]]* %2 to i8*
%30 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 0, i64 0
store float 2.000000e+00, float* %30
%31 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 1, i64 1
store float 2.000000e+00, float* %31
%32 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %2, i64 0, i64 2, i64 2
store float 2.000000e+00, float* %32
%33 = bitcast [3 x [3 x float]]* %3 to i8*
%34 = bitcast [3 x [3 x float]]* %4 to i8*
%35 = bitcast [3 x [3 x float]]* %5 to i8*
%36 = bitcast [3 x [3 x float]]* %6 to i8*
%37 = bitcast [3 x [3 x float]]* %7 to i8*
%38 = bitcast i64* %8 to i8*
store i64 12884901891, i64* %8
%39 = bitcast i64* %9 to i8*
store i64 12884901891, i64* %9
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.19, i64 0, i64 0))
%41 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0, i64 0
%42 = call i32 @print(float* %41, i32 3, i32 3)
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
%44 = call i32 @print(float* %30, i32 3, i32 3)
%45 = bitcast i64* %8 to i32*
%46 = bitcast i64* %9 to i32*
%47 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %3, i64 0, i64 0, i64 0
%48 = call i32 @MatMultiplication(float* %41, i32* %45, float* %30, i32* %46, float* %47)
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.21, i64 0, i64 0))
%50 = call i32 @print(float* %47, i32 3, i32 3)
%51 = call float @MatDet3by3(float* %47)
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %52)
%54 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %4, i64 0, i64 0, i64 0
%55 = call i32 @MatAddition(float* %41, i32* %45, float* %30, float* %54)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.22, i64 0, i64 0))
%57 = call i32 @print(float* %54, i32 3, i32 3)
%58 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 0, i64 0
%59 = call i32 @MatTranspose(float* %41, i32* %45, float* %58)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%61 = call i32 @print(float* %58, i32 3, i32 3)
%62 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %7, i64 0, i64 0, i64 0
%63 = call i32 @MatInv3by3(float* %30, float* %62)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.24, i64 0, i64 0))
%65 = call i32 @print(float* %62, i32 3, i32 3)
%66 = bitcast [2 x [2 x float]]* %10 to i8*
%67 = bitcast [2 x [2 x float]]* %11 to i8*
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.25, i64 0, i64 0))
%69 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %10, i64 0, i64 0, i64 0
%70 = call i32 @print(float* %69, i32 2, i32 2)
%71 = call double @MatDet2by2(float* %69)
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), double %71)
%73 = getelementptr inbounds [2 x [2 x float]], [2 x [2 x float]]* %11, i64 0, i64 0, i64 0
%74 = call i32 @MatInv2by2(float* %69, float* %73)
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.26, i64 0, i64 0))
%76 = call i32 @print(float* %73, i32 2, i32 2)
%77 = bitcast [3 x [3 x float]]* %12 to i8*
%78 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %12, i64 0, i64 0, i64 0
%79 = call i32 @MatScalarMult(float* %41, i32* %45, float 2.000000e+00, float* %78)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), double 2.000000e+00)
%81 = call i32 @print(float* %78, i32 3, i32 3)
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.27, i64 0, i64 0))
%83 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 0, i64 0
%84 = call i32 @NormalizeMatrix(float* %30, i32* %46, float* %83)
%85 = call i32 @print(float* %83, i32 3, i32 3)
%86 = bitcast [3 x [1 x float]]* %13 to i8*
%87 = bitcast [1 x [3 x float]]* %14 to i8*
%88 = bitcast [3 x [3 x float]]* %15 to i8*
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.33, i64 0, i64 0))
%90 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %13, i64 0, i64 0, i64 0
%91 = call i32 @print(float* %90, i32 3, i32 1)
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.33, i64 0, i64 0))
%93 = getelementptr inbounds [1 x [3 x float]], [1 x [3 x float]]* %14, i64 0, i64 0, i64 0
%94 = call i32 @print(float* %93, i32 1, i32 3)
%95 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %15, i64 0, i64 0, i64 0
%96 = call i32 @crossSkew(float* %90, float* %95)
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.31, i64 0, i64 0))
%98 = call i32 @print(float* %95, i32 3, i32 3)
%99 = call i32 @crossSkew(float* %93, float* %95)
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.31, i64 0, i64 0))
%101 = call i32 @print(float* %95, i32 3, i32 3)
%102 = bitcast [3 x [3 x float]]* %16 to i8*
%103 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %16, i64 0, i64 0, i64 0
store float 1.000000e+00, float* %103
%104 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %16, i64 0, i64 1, i64 1
store float 1.000000e+00, float* %104
%105 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %16, i64 0, i64 2, i64 2
store float 1.000000e+00, float* %105
%106 = bitcast [3 x float]* %17 to i8*
%107 = bitcast i64* %18 to i8*
store i64 12884901891, i64* %18
%108 = bitcast i64* %19 to i8*
store i64 4294967299, i64* %19
%109 = bitcast [3 x [1 x float]]* %20 to i8*
%110 = bitcast i64* %18 to i32*
%111 = getelementptr inbounds [3 x float], [3 x float]* %17, i64 0, i64 0
%112 = bitcast i64* %19 to i32*
%113 = getelementptr inbounds [3 x [1 x float]], [3 x [1 x float]]* %20, i64 0, i64 0, i64 0
%114 = call i32 @MatMultiplication(float* %103, i32* %110, float* %111, i32* %112, float* %113)
%115 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.32, i64 0, i64 0))
%116 = call i32 @print(float* %103, i32 3, i32 3)
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.33, i64 0, i64 0))
%118 = call i32 @print(float* %111, i32 1, i32 3)
%119 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.34, i64 0, i64 0))
%120 = call i32 @print(float* %113, i32 3, i32 1)
%121 = bitcast i64* %21 to i8*
store i64 4575657222473777152, i64* %21
%122 = bitcast [1 x [2 x float]]* %22 to i8*
%123 = bitcast i64* %23 to i8*
store i64 4575657222473777152, i64* %23
%124 = bitcast [1 x [1 x float]]* %24 to i8*
%125 = bitcast i64* %25 to i8*
store i64 8589934593, i64* %25
%126 = bitcast i64* %26 to i8*
store i64 4294967298, i64* %26
%127 = bitcast i64* %21 to float*
%128 = bitcast i64* %25 to i32*
%129 = bitcast i64* %23 to float*
%130 = bitcast i64* %26 to i32*
%131 = getelementptr inbounds [1 x [1 x float]], [1 x [1 x float]]* %24, i64 0, i64 0, i64 0
%132 = call i32 @MatMultiplication(float* %127, i32* %128, float* %129, i32* %130, float* %131)
%133 = call i32 @print(float* %127, i32 1, i32 2)
%134 = call i32 @print(float* %129, i32 2, i32 1)
%135 = load float, float* %131
%136 = fpext float %135 to double
%137 = fadd double %136, 2.000000e+00
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), double %137)
%139 = getelementptr inbounds [1 x [2 x float]], [1 x [2 x float]]* %22, i64 0, i64 0, i64 0
%140 = call i32 @NormalizeMatrix(float* %127, i32* %128, float* %139)
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0))
%142 = call i32 @print(float* %139, i32 2, i32 1)
ret void
}