#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*/ copyMatrix(int, int, double **, double **);
int /*<<< orphan*/ freeMat(int, double ***);
int /*<<< orphan*/ initMat(int, int, double ***);
double invert(int, int, double **);
int /*<<< orphan*/ matrixMultiply(int, int, int, double **, double **,
                                  double **);
double pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
double ref(int, int, double **);
int /*<<< orphan*/ setDelta(double);
double strtod(char *, char **);
int strtol(char *, char **, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i;
  int j;
  if (argc < 3 || 4 < argc) {
    printf(
        "\nUsage: LinAlg [ROWS] [COLS] [BUFFER]\n"
        "NOTE: 3rd argument is optional floating point percision setting.\n\n");
    return 1;
  }
  char *end = 0;
  int ROWS = strtol(argv[1], &end, 0);
  int COLS = strtol(argv[2], &end, 0);
  if (argv[3] != 0) {
    double deltaBuffer = strtod(argv[3], &end);
    setDelta(deltaBuffer);
  }
  double **myMatrix;
  initMat(ROWS, COLS, &myMatrix);
  for (i = 0; i < ROWS; i++) {
    for (j = 0; j < COLS; j++) {
      myMatrix[i][j] = pow(i, j);
    }
  }
  double **copiedMat;
  initMat(ROWS, COLS, &copiedMat);
  double **product;
  initMat(ROWS, COLS, &product);
  copyMatrix(ROWS, COLS, myMatrix, copiedMat);
  double det = ref(ROWS, COLS, copiedMat);
  printf("\nThis main serves a short testing file.\n"
         "An example of the library is shown here.\n"
         "\nOur Original Matrix. Here we will call it A:\n");
  for (i = 0; i < ROWS; i++) {
    printf("\n");
    for (j = 0; j < COLS; j++) {
      printf(" %+2.4f ", (float)myMatrix[i][j]);
    }
  }
  printf("\n\nUsing ref(), this is a Row Echelon Form of A.\n");
  for (i = 0; i < ROWS; i++) {
    printf("\n");
    for (j = 0; j < COLS; j++) {
      printf(" %+2.4f ", (float)copiedMat[i][j]);
    }
  }
  printf("\n\nAnd this is its determinant %+2.4f according to ref().",
         (float)det);
  copyMatrix(ROWS, COLS, myMatrix, copiedMat);
  det = invert(ROWS, COLS, copiedMat);
  printf("\n\nThis is the inverse of A:\n");
  for (i = 0; i < ROWS; i++) {
    printf("\n");
    for (j = 0; j < COLS; j++) {
      printf(" %+2.4f ", (float)copiedMat[i][j]);
    }
  }
  printf("\n\nIts determinant is as calculated by invert() is %+2.4f.",
         (float)det);
  printf("\n\nThis is the Product of A and its inverse:\n");
  matrixMultiply(ROWS, COLS, COLS, myMatrix, copiedMat, product);
  for (i = 0; i < ROWS; i++) {
    printf("\n");
    for (j = 0; j < COLS; j++) {
      printf(" %+2.4f ", (float)product[i][j]);
    }
  }
  printf("\n\nYou did it, Hooray!\n");
  freeMat(ROWS, &myMatrix);
  freeMat(ROWS, &copiedMat);
  freeMat(ROWS, &product);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11de <main+0x2e>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jge    11f8 <main+0x48>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15fe <main+0x44e>
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     125b <main+0xab>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <strtod@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <setDelta@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
lea    -0x38(%rbp),%rdx
call   1080 <initMat@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12d1 <main+0x121>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12be <main+0x10e>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10b0 <pow@plt>
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1284 <main+0xd4>
jmp    12c3 <main+0x113>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1271 <main+0xc1>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1080 <initMat@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
lea    -0x48(%rbp),%rdx
call   1080 <initMat@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   10d0 <copyMatrix@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   1060 <ref@plt>
movsd  %xmm0,-0x50(%rbp)
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13a4 <main+0x1f4>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1391 <main+0x1e1>
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd6d(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    134c <main+0x19c>
jmp    1396 <main+0x1e6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    132b <main+0x17b>
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1432 <main+0x282>
lea    0xc9b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    141f <main+0x26f>
mov    -0x40(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcdf(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13da <main+0x22a>
jmp    1424 <main+0x274>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13b9 <main+0x209>
movsd  -0x50(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcdd(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   10d0 <copyMatrix@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   1040 <invert@plt>
movsd  %xmm0,-0x50(%rbp)
lea    0xce1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1502 <main+0x352>
lea    0xbcb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    14ef <main+0x33f>
mov    -0x40(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc0f(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14aa <main+0x2fa>
jmp    14f4 <main+0x344>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1489 <main+0x2d9>
movsd  -0x50(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc63(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
call   10c0 <matrixMultiply@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    15c5 <main+0x415>
lea    0xb08(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    15b2 <main+0x402>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb4c(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    156d <main+0x3bd>
jmp    15b7 <main+0x407>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    154c <main+0x39c>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   1090 <freeMat@plt>
mov    -0x24(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   1090 <freeMat@plt>
mov    -0x24(%rbp),%edi
lea    -0x48(%rbp),%rsi
call   1090 <freeMat@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
add    $0xfffffffb,%edi
cmp    $0xfffffffd,%edi
ja     11fc <main+0x2c>
lea    0xf9c(%rip),%rdi
call   1060 <puts@plt>
mov    $0x1,%eax
jmp    1685 <main+0x4b5>
mov    %rsi,%rbx
movq   $0x0,0x38(%rsp)
mov    0x8(%rsi),%rdi
lea    0x38(%rsp),%r14
mov    %r14,%rsi
xor    %edx,%edx
call   10c0 <strtol@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   10c0 <strtol@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1246 <main+0x76>
lea    0x38(%rsp),%rsi
call   1070 <strtod@plt>
call   1030 <setDelta@plt>
lea    0x8(%rsp),%rdx
mov    %ebp,%edi
mov    %r15d,%esi
call   10a0 <initMat@plt>
mov    %ebp,%eax
mov    %rax,0x20(%rsp)
mov    %r15d,%r13d
mov    %ebp,0x34(%rsp)
test   %ebp,%ebp
jle    1366 <main+0x196>
lea    -0x1(%r13),%rax
mov    %rax,0x40(%rsp)
mov    %r13d,%eax
and    $0x3,%eax
mov    %rax,0x18(%rsp)
mov    %r13d,%r14d
and    $0xfffffffc,%r14d
xor    %ebx,%ebx
jmp    129f <main+0xcf>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    0x20(%rsp),%rbx
je     1366 <main+0x196>
test   %r15d,%r15d
jle    1290 <main+0xc0>
cmpq   $0x3,0x40(%rsp)
jae    12b0 <main+0xe0>
xor    %ebp,%ebp
jmp    132b <main+0x15b>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
call   10d0 <pow@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,(%rax,%rbp,8)
lea    0x1(%rbp),%esi
mov    %ebx,%edi
call   10d0 <pow@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,0x8(%rax,%rbp,8)
lea    0x2(%rbp),%esi
mov    %ebx,%edi
call   10d0 <pow@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,0x10(%rax,%rbp,8)
lea    0x3(%rbp),%esi
mov    %ebx,%edi
call   10d0 <pow@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,0x18(%rax,%rbp,8)
add    $0x4,%rbp
cmp    %r14,%rbp
jne    12c0 <main+0xf0>
cmpq   $0x0,0x18(%rsp)
je     1290 <main+0xc0>
mov    0x18(%rsp),%r12
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
call   10d0 <pow@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,(%rax,%rbp,8)
add    $0x1,%rbp
add    $0xffffffffffffffff,%r12
jne    1340 <main+0x170>
jmp    1290 <main+0xc0>
lea    0x10(%rsp),%rdx
mov    0x34(%rsp),%r12d
mov    %r12d,%edi
mov    %r15d,%esi
call   10a0 <initMat@plt>
lea    0x28(%rsp),%rdx
mov    %r12d,%edi
mov    %r15d,%esi
call   10a0 <initMat@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    %r12d,%edi
mov    %r15d,%esi
call   10f0 <copyMatrix@plt>
mov    0x10(%rsp),%rdx
mov    %r12d,%edi
mov    %r15d,%esi
call   1080 <ref@plt>
movsd  %xmm0,0x18(%rsp)
lea    0xcbf(%rip),%rdi
call   1060 <puts@plt>
test   %r12d,%r12d
jle    149b <main+0x2cb>
xor    %ebp,%ebp
lea    0xc2c(%rip),%r14
jmp    13eb <main+0x21b>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    0x20(%rsp),%rbp
je     142b <main+0x25b>
mov    $0xa,%edi
call   1040 <putchar@plt>
test   %r15d,%r15d
jle    13e0 <main+0x210>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x8(%rsp),%rax
mov    (%rax,%rbp,8),%rax
movsd  (%rax,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1400 <main+0x230>
jmp    13e0 <main+0x210>
lea    0xcc9(%rip),%rdi
call   1060 <puts@plt>
test   %r12d,%r12d
jle    14a7 <main+0x2d7>
xor    %ebp,%ebp
lea    0xbbb(%rip),%r14
jmp    145b <main+0x28b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    0x20(%rsp),%rbp
je     14a7 <main+0x2d7>
mov    $0xa,%edi
call   1040 <putchar@plt>
test   %r15d,%r15d
jle    1450 <main+0x280>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%rsp),%rax
mov    (%rax,%rbp,8),%rax
movsd  (%rax,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1470 <main+0x2a0>
jmp    1450 <main+0x280>
lea    0xc59(%rip),%rdi
call   1060 <puts@plt>
movsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb4d(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    %r12d,%edi
mov    %r15d,%esi
call   10f0 <copyMatrix@plt>
mov    0x10(%rsp),%rdx
mov    %r12d,%edi
mov    %r15d,%esi
call   1050 <invert@plt>
movsd  %xmm0,0x18(%rsp)
lea    0xc36(%rip),%rdi
call   1060 <puts@plt>
test   %r12d,%r12d
jle    160b <main+0x43b>
xor    %ebp,%ebp
lea    0xaf4(%rip),%r14
jmp    151b <main+0x34b>
xchg   %ax,%ax
add    $0x1,%rbp
cmp    0x20(%rsp),%rbp
je     155b <main+0x38b>
mov    $0xa,%edi
call   1040 <putchar@plt>
test   %r15d,%r15d
jle    1510 <main+0x340>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%rsp),%rax
mov    (%rax,%rbp,8),%rax
movsd  (%rax,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1530 <main+0x360>
jmp    1510 <main+0x340>
movsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xad2(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xbc9(%rip),%rdi
call   1060 <puts@plt>
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%r8
mov    0x28(%rsp),%r9
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r15d,%edx
call   10e0 <matrixMultiply@plt>
test   %r12d,%r12d
jle    1650 <main+0x480>
xor    %ebp,%ebp
lea    0xa4e(%rip),%r14
jmp    15cf <main+0x3ff>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
cmp    0x20(%rsp),%rbp
je     1650 <main+0x480>
mov    $0xa,%edi
call   1040 <putchar@plt>
test   %r15d,%r15d
jle    15c0 <main+0x3f0>
xor    %ebx,%ebx
mov    0x28(%rsp),%rax
mov    (%rax,%rbp,8),%rax
movsd  (%rax,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    15e0 <main+0x410>
jmp    15c0 <main+0x3f0>
movsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xa22(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xb19(%rip),%rdi
call   1060 <puts@plt>
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%r8
mov    0x28(%rsp),%r9
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r15d,%edx
call   10e0 <matrixMultiply@plt>
lea    0xb1c(%rip),%rdi
call   1060 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %r12d,%edi
call   10b0 <freeMat@plt>
lea    0x10(%rsp),%rsi
mov    %r12d,%edi
call   10b0 <freeMat@plt>
lea    0x28(%rsp),%rsi
mov    %r12d,%edi
call   10b0 <freeMat@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [105 x i8] c"\0AUsage: LinAlg [ROWS] [COLS] [BUFFER]\0ANOTE: 3rd argument is optional floating point percision setting.\0A\0A\00"
@.str.1 = [128 x i8] c"\0AThis main serves a short testing file.\0AAn example of the library is shown here.\0A\0AOur Original Matrix. Here we will call it A:\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [9 x i8] c" %+2.4f \00"
@.str.4 = [49 x i8] c"\0A\0AUsing ref(), this is a Row Echelon Form of A.\0A\00"
@.str.5 = [57 x i8] c"\0A\0AAnd this is its determinant %+2.4f according to ref().\00"
@.str.6 = [29 x i8] c"\0A\0AThis is the inverse of A:\0A\00"
@.str.7 = [58 x i8] c"\0A\0AIts determinant is as calculated by invert() is %+2.4f.\00"
@.str.8 = [45 x i8] c"\0A\0AThis is the Product of A and its inverse:\0A\00"
@.str.9 = [23 x i8] c"\0A\0AYou did it, Hooray!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double**
%13 = alloca double**
%14 = alloca double**
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %4
%20 = icmp slt i32 4, %19
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %250
23: ; preds = %18
store i8* null, i8** %8
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strtol(i8* %26, i8** %8, i32 0)
store i32 %27, i32* %9
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @strtol(i8* %30, i8** %8, i32 0)
store i32 %31, i32* %10
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %43
36: ; preds = %23
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 3
%39 = load i8*, i8** %38
%40 = call double @strtod(i8* %39, i8** %8)
store double %40, double* %11
%41 = load double, double* %11
%42 = call i32 @setDelta(double %41)
br label %43
43: ; preds = %36, %23
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = call i32 @initMat(i32 %44, i32 %45, double*** %12)
store i32 0, i32* %6
br label %47
47: ; preds = %72, %43
%48 = load i32, i32* %6
%49 = load i32, i32* %9
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %75
51: ; preds = %47
store i32 0, i32* %7
br label %52
52: ; preds = %68, %51
%53 = load i32, i32* %7
%54 = load i32, i32* %10
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %71
56: ; preds = %52
%57 = load i32, i32* %6
%58 = load i32, i32* %7
%59 = call double @pow(i32 %57, i32 %58)
%60 = load double**, double*** %12
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double*, double** %60, i64 %62
%64 = load double*, double** %63
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
store double %59, double* %67
br label %68
68: ; preds = %56
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %52
71: ; preds = %52
br label %72
72: ; preds = %71
%73 = load i32, i32* %6
%74 = add nsw i32 %73, 1
store i32 %74, i32* %6
br label %47
75: ; preds = %47
%76 = load i32, i32* %9
%77 = load i32, i32* %10
%78 = call i32 @initMat(i32 %76, i32 %77, double*** %13)
%79 = load i32, i32* %9
%80 = load i32, i32* %10
%81 = call i32 @initMat(i32 %79, i32 %80, double*** %14)
%82 = load i32, i32* %9
%83 = load i32, i32* %10
%84 = load double**, double*** %12
%85 = load double**, double*** %13
%86 = call i32 @copyMatrix(i32 %82, i32 %83, double** %84, double** %85)
%87 = load i32, i32* %9
%88 = load i32, i32* %10
%89 = load double**, double*** %13
%90 = call double @ref(i32 %87, i32 %88, double** %89)
store double %90, double* %15
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %92
92: ; preds = %119, %75
%93 = load i32, i32* %6
%94 = load i32, i32* %9
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %122
96: ; preds = %92
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %98
98: ; preds = %115, %96
%99 = load i32, i32* %7
%100 = load i32, i32* %10
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %118
102: ; preds = %98
%103 = load double**, double*** %12
%104 = load i32, i32* %6
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double*, double** %103, i64 %105
%107 = load double*, double** %106
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
%111 = load double, double* %110
%112 = fptrunc double %111 to float
%113 = fpext float %112 to double
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %113)
br label %115
115: ; preds = %102
%116 = load i32, i32* %7
%117 = add nsw i32 %116, 1
store i32 %117, i32* %7
br label %98
118: ; preds = %98
br label %119
119: ; preds = %118
%120 = load i32, i32* %6
%121 = add nsw i32 %120, 1
store i32 %121, i32* %6
br label %92
122: ; preds = %92
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %124
124: ; preds = %151, %122
%125 = load i32, i32* %6
%126 = load i32, i32* %9
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %154
128: ; preds = %124
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %130
130: ; preds = %147, %128
%131 = load i32, i32* %7
%132 = load i32, i32* %10
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %150
134: ; preds = %130
%135 = load double**, double*** %13
%136 = load i32, i32* %6
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double*, double** %135, i64 %137
%139 = load double*, double** %138
%140 = load i32, i32* %7
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = fptrunc double %143 to float
%145 = fpext float %144 to double
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %145)
br label %147
147: ; preds = %134
%148 = load i32, i32* %7
%149 = add nsw i32 %148, 1
store i32 %149, i32* %7
br label %130
150: ; preds = %130
br label %151
151: ; preds = %150
%152 = load i32, i32* %6
%153 = add nsw i32 %152, 1
store i32 %153, i32* %6
br label %124
154: ; preds = %124
%155 = load double, double* %15
%156 = fptrunc double %155 to float
%157 = fpext float %156 to double
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), double %157)
%159 = load i32, i32* %9
%160 = load i32, i32* %10
%161 = load double**, double*** %12
%162 = load double**, double*** %13
%163 = call i32 @copyMatrix(i32 %159, i32 %160, double** %161, double** %162)
%164 = load i32, i32* %9
%165 = load i32, i32* %10
%166 = load double**, double*** %13
%167 = call double @invert(i32 %164, i32 %165, double** %166)
store double %167, double* %15
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %6
br label %169
169: ; preds = %196, %154
%170 = load i32, i32* %6
%171 = load i32, i32* %9
%172 = icmp slt i32 %170, %171
br i1 %172, label %173, label %199
173: ; preds = %169
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %175
175: ; preds = %192, %173
%176 = load i32, i32* %7
%177 = load i32, i32* %10
%178 = icmp slt i32 %176, %177
br i1 %178, label %179, label %195
179: ; preds = %175
%180 = load double**, double*** %13
%181 = load i32, i32* %6
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double*, double** %180, i64 %182
%184 = load double*, double** %183
%185 = load i32, i32* %7
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
%188 = load double, double* %187
%189 = fptrunc double %188 to float
%190 = fpext float %189 to double
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %190)
br label %192
192: ; preds = %179
%193 = load i32, i32* %7
%194 = add nsw i32 %193, 1
store i32 %194, i32* %7
br label %175
195: ; preds = %175
br label %196
196: ; preds = %195
%197 = load i32, i32* %6
%198 = add nsw i32 %197, 1
store i32 %198, i32* %6
br label %169
199: ; preds = %169
%200 = load double, double* %15
%201 = fptrunc double %200 to float
%202 = fpext float %201 to double
%203 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), double %202)
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%205 = load i32, i32* %9
%206 = load i32, i32* %10
%207 = load i32, i32* %10
%208 = load double**, double*** %12
%209 = load double**, double*** %13
%210 = load double**, double*** %14
%211 = call i32 @matrixMultiply(i32 %205, i32 %206, i32 %207, double** %208, double** %209, double** %210)
store i32 0, i32* %6
br label %212
212: ; preds = %239, %199
%213 = load i32, i32* %6
%214 = load i32, i32* %9
%215 = icmp slt i32 %213, %214
br i1 %215, label %216, label %242
216: ; preds = %212
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %218
218: ; preds = %235, %216
%219 = load i32, i32* %7
%220 = load i32, i32* %10
%221 = icmp slt i32 %219, %220
br i1 %221, label %222, label %238
222: ; preds = %218
%223 = load double**, double*** %14
%224 = load i32, i32* %6
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double*, double** %223, i64 %225
%227 = load double*, double** %226
%228 = load i32, i32* %7
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds double, double* %227, i64 %229
%231 = load double, double* %230
%232 = fptrunc double %231 to float
%233 = fpext float %232 to double
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %233)
br label %235
235: ; preds = %222
%236 = load i32, i32* %7
%237 = add nsw i32 %236, 1
store i32 %237, i32* %7
br label %218
238: ; preds = %218
br label %239
239: ; preds = %238
%240 = load i32, i32* %6
%241 = add nsw i32 %240, 1
store i32 %241, i32* %6
br label %212
242: ; preds = %212
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%244 = load i32, i32* %9
%245 = call i32 @freeMat(i32 %244, double*** %12)
%246 = load i32, i32* %9
%247 = call i32 @freeMat(i32 %246, double*** %13)
%248 = load i32, i32* %9
%249 = call i32 @freeMat(i32 %248, double*** %14)
store i32 0, i32* %3
br label %250
250: ; preds = %242, %21
%251 = load i32, i32* %3
ret i32 %251
}

LLVM IR (-O2):
@.str.3 = [9 x i8] c" %+2.4f \00"
@.str.5 = [57 x i8] c"\0A\0AAnd this is its determinant %+2.4f according to ref().\00"
@.str.7 = [58 x i8] c"\0A\0AIts determinant is as calculated by invert() is %+2.4f.\00"
@str = [127 x i8] c"\0AThis main serves a short testing file.\0AAn example of the library is shown here.\0A\0AOur Original Matrix. Here we will call it A:\00"
@str.10 = [48 x i8] c"\0A\0AUsing ref(), this is a Row Echelon Form of A.\00"
@str.11 = [28 x i8] c"\0A\0AThis is the inverse of A:\00"
@str.12 = [44 x i8] c"\0A\0AThis is the Product of A and its inverse:\00"
@str.13 = [22 x i8] c"\0A\0AYou did it, Hooray!\00"
@str.14 = [104 x i8] c"\0AUsage: LinAlg [ROWS] [COLS] [BUFFER]\0ANOTE: 3rd argument is optional floating point percision setting.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca double**
%5 = alloca double**
%6 = alloca double**
%7 = add i32 %0, -5
%8 = icmp ult i32 %7, -2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.14, i64 0, i64 0))
br label %228
11: ; preds = %2
%12 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strtol(i8* %14, i8** %3, i32 0)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @strtol(i8* %17, i8** %3, i32 0)
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = icmp eq i8* %20, null
br i1 %21, label %25, label %22
22: ; preds = %11
%23 = call double @strtod(i8* %20, i8** %3)
%24 = tail call i32 @setDelta(double %23)
br label %25
25: ; preds = %22, %11
%26 = bitcast double*** %4 to i8*
%27 = call i32 @initMat(i32 %15, i32 %18, double*** %4)
%28 = icmp sgt i32 %15, 0
br i1 %28, label %29, label %92
29: ; preds = %25
%30 = icmp sgt i32 %18, 0
%31 = zext i32 %15 to i64
%32 = zext i32 %18 to i64
%33 = add nsw i64 %32, -1
%34 = and i64 %32, 3
%35 = icmp ult i64 %33, 3
%36 = and i64 %32, 4294967292
%37 = icmp eq i64 %34, 0
br label %38
38: ; preds = %29, %89
%39 = phi i64 [ 0, %29 ], [ %90, %89 ]
br i1 %30, label %40, label %89
40: ; preds = %38
%41 = trunc i64 %39 to i32
br i1 %35, label %75, label %42
42: ; preds = %40, %42
%43 = phi i64 [ %72, %42 ], [ 0, %40 ]
%44 = phi i64 [ %73, %42 ], [ 0, %40 ]
%45 = trunc i64 %43 to i32
%46 = call double @pow(i32 %41, i32 %45)
%47 = load double**, double*** %4
%48 = getelementptr inbounds double*, double** %47, i64 %39
%49 = load double*, double** %48
%50 = getelementptr inbounds double, double* %49, i64 %43
store double %46, double* %50
%51 = or i64 %43, 1
%52 = trunc i64 %51 to i32
%53 = call double @pow(i32 %41, i32 %52)
%54 = load double**, double*** %4
%55 = getelementptr inbounds double*, double** %54, i64 %39
%56 = load double*, double** %55
%57 = getelementptr inbounds double, double* %56, i64 %51
store double %53, double* %57
%58 = or i64 %43, 2
%59 = trunc i64 %58 to i32
%60 = call double @pow(i32 %41, i32 %59)
%61 = load double**, double*** %4
%62 = getelementptr inbounds double*, double** %61, i64 %39
%63 = load double*, double** %62
%64 = getelementptr inbounds double, double* %63, i64 %58
store double %60, double* %64
%65 = or i64 %43, 3
%66 = trunc i64 %65 to i32
%67 = call double @pow(i32 %41, i32 %66)
%68 = load double**, double*** %4
%69 = getelementptr inbounds double*, double** %68, i64 %39
%70 = load double*, double** %69
%71 = getelementptr inbounds double, double* %70, i64 %65
store double %67, double* %71
%72 = add nuw nsw i64 %43, 4
%73 = add i64 %44, 4
%74 = icmp eq i64 %73, %36
br i1 %74, label %75, label %42
75: ; preds = %42, %40
%76 = phi i64 [ 0, %40 ], [ %72, %42 ]
br i1 %37, label %89, label %77
77: ; preds = %75, %77
%78 = phi i64 [ %86, %77 ], [ %76, %75 ]
%79 = phi i64 [ %87, %77 ], [ 0, %75 ]
%80 = trunc i64 %78 to i32
%81 = call double @pow(i32 %41, i32 %80)
%82 = load double**, double*** %4
%83 = getelementptr inbounds double*, double** %82, i64 %39
%84 = load double*, double** %83
%85 = getelementptr inbounds double, double* %84, i64 %78
store double %81, double* %85
%86 = add nuw nsw i64 %78, 1
%87 = add i64 %79, 1
%88 = icmp eq i64 %87, %34
br i1 %88, label %89, label %77
89: ; preds = %75, %77, %38
%90 = add nuw nsw i64 %39, 1
%91 = icmp eq i64 %90, %31
br i1 %91, label %92, label %38
92: ; preds = %89, %25
%93 = bitcast double*** %5 to i8*
%94 = call i32 @initMat(i32 %15, i32 %18, double*** %5)
%95 = bitcast double*** %6 to i8*
%96 = call i32 @initMat(i32 %15, i32 %18, double*** %6)
%97 = load double**, double*** %4
%98 = load double**, double*** %5
%99 = call i32 @copyMatrix(i32 %15, i32 %18, double** %97, double** %98)
%100 = load double**, double*** %5
%101 = call double @ref(i32 %15, i32 %18, double** %100)
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([127 x i8], [127 x i8]* @str, i64 0, i64 0))
br i1 %28, label %105, label %103
103: ; preds = %92
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.10, i64 0, i64 0))
br label %151
105: ; preds = %92
%106 = icmp sgt i32 %18, 0
%107 = zext i32 %15 to i64
%108 = zext i32 %18 to i64
br label %109
109: ; preds = %105, %124
%110 = phi i64 [ 0, %105 ], [ %125, %124 ]
%111 = call i32 @putchar(i32 10)
br i1 %106, label %112, label %124
112: ; preds = %109, %112
%113 = phi i64 [ %122, %112 ], [ 0, %109 ]
%114 = load double**, double*** %4
%115 = getelementptr inbounds double*, double** %114, i64 %110
%116 = load double*, double** %115
%117 = getelementptr inbounds double, double* %116, i64 %113
%118 = load double, double* %117
%119 = fptrunc double %118 to float
%120 = fpext float %119 to double
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %120)
%122 = add nuw nsw i64 %113, 1
%123 = icmp eq i64 %122, %108
br i1 %123, label %124, label %112
124: ; preds = %112, %109
%125 = add nuw nsw i64 %110, 1
%126 = icmp eq i64 %125, %107
br i1 %126, label %127, label %109
127: ; preds = %124
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.10, i64 0, i64 0))
br i1 %28, label %129, label %151
129: ; preds = %127
%130 = icmp sgt i32 %18, 0
%131 = zext i32 %15 to i64
%132 = zext i32 %18 to i64
br label %133
133: ; preds = %129, %148
%134 = phi i64 [ 0, %129 ], [ %149, %148 ]
%135 = call i32 @putchar(i32 10)
br i1 %130, label %136, label %148
136: ; preds = %133, %136
%137 = phi i64 [ %146, %136 ], [ 0, %133 ]
%138 = load double**, double*** %5
%139 = getelementptr inbounds double*, double** %138, i64 %134
%140 = load double*, double** %139
%141 = getelementptr inbounds double, double* %140, i64 %137
%142 = load double, double* %141
%143 = fptrunc double %142 to float
%144 = fpext float %143 to double
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %144)
%146 = add nuw nsw i64 %137, 1
%147 = icmp eq i64 %146, %132
br i1 %147, label %148, label %136
148: ; preds = %136, %133
%149 = add nuw nsw i64 %134, 1
%150 = icmp eq i64 %149, %131
br i1 %150, label %151, label %133
151: ; preds = %148, %103, %127
%152 = fptrunc double %101 to float
%153 = fpext float %152 to double
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), double %153)
%155 = load double**, double*** %4
%156 = load double**, double*** %5
%157 = call i32 @copyMatrix(i32 %15, i32 %18, double** %155, double** %156)
%158 = load double**, double*** %5
%159 = call double @invert(i32 %15, i32 %18, double** %158)
%160 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
br i1 %28, label %161, label %214
161: ; preds = %151
%162 = icmp sgt i32 %18, 0
%163 = zext i32 %15 to i64
%164 = zext i32 %18 to i64
br label %165
165: ; preds = %161, %180
%166 = phi i64 [ 0, %161 ], [ %181, %180 ]
%167 = call i32 @putchar(i32 10)
br i1 %162, label %168, label %180
168: ; preds = %165, %168
%169 = phi i64 [ %178, %168 ], [ 0, %165 ]
%170 = load double**, double*** %5
%171 = getelementptr inbounds double*, double** %170, i64 %166
%172 = load double*, double** %171
%173 = getelementptr inbounds double, double* %172, i64 %169
%174 = load double, double* %173
%175 = fptrunc double %174 to float
%176 = fpext float %175 to double
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %176)
%178 = add nuw nsw i64 %169, 1
%179 = icmp eq i64 %178, %164
br i1 %179, label %180, label %168
180: ; preds = %168, %165
%181 = add nuw nsw i64 %166, 1
%182 = icmp eq i64 %181, %163
br i1 %182, label %183, label %165
183: ; preds = %180
%184 = fptrunc double %159 to float
%185 = fpext float %184 to double
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), double %185)
%187 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.12, i64 0, i64 0))
%188 = load double**, double*** %4
%189 = load double**, double*** %5
%190 = load double**, double*** %6
%191 = call i32 @matrixMultiply(i32 %15, i32 %18, i32 %18, double** %188, double** %189, double** %190)
br i1 %28, label %192, label %223
192: ; preds = %183
%193 = icmp sgt i32 %18, 0
%194 = zext i32 %15 to i64
%195 = zext i32 %18 to i64
br label %196
196: ; preds = %192, %211
%197 = phi i64 [ 0, %192 ], [ %212, %211 ]
%198 = call i32 @putchar(i32 10)
br i1 %193, label %199, label %211
199: ; preds = %196, %199
%200 = phi i64 [ %209, %199 ], [ 0, %196 ]
%201 = load double**, double*** %6
%202 = getelementptr inbounds double*, double** %201, i64 %197
%203 = load double*, double** %202
%204 = getelementptr inbounds double, double* %203, i64 %200
%205 = load double, double* %204
%206 = fptrunc double %205 to float
%207 = fpext float %206 to double
%208 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %207)
%209 = add nuw nsw i64 %200, 1
%210 = icmp eq i64 %209, %195
br i1 %210, label %211, label %199
211: ; preds = %199, %196
%212 = add nuw nsw i64 %197, 1
%213 = icmp eq i64 %212, %194
br i1 %213, label %223, label %196
214: ; preds = %151
%215 = fptrunc double %159 to float
%216 = fpext float %215 to double
%217 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), double %216)
%218 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.12, i64 0, i64 0))
%219 = load double**, double*** %4
%220 = load double**, double*** %5
%221 = load double**, double*** %6
%222 = call i32 @matrixMultiply(i32 %15, i32 %18, i32 %18, double** %219, double** %220, double** %221)
br label %223
223: ; preds = %211, %214, %183
%224 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0))
%225 = call i32 @freeMat(i32 %15, double*** %4)
%226 = call i32 @freeMat(i32 %15, double*** %5)
%227 = call i32 @freeMat(i32 %15, double*** %6)
br label %228
228: ; preds = %223, %9
%229 = phi i32 [ 1, %9 ], [ 0, %223 ]
ret i32 %229
}