#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double **CreateMat(int, int);
int /*<<< orphan*/ DestroyMat(double **, int);
int /*<<< orphan*/ GenPerm(int, double **);
int /*<<< orphan*/ MatGen(int, double **, double);
int /*<<< orphan*/ MatMul(int, double **, double **, double **);
int /*<<< orphan*/ PrintMat(double **, int, int);
int /*<<< orphan*/ PrintVec(double *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
int getopt(int, char **, char *);
double *malloc(int);
char *optarg;
int /*<<< orphan*/ printf(char *, ...);
int random();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int strtol(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int i, j, option;
  int size = 100;
  int b_print = 0;
  int range = 100;
  double **A, **T, **S;
  double *b;
  double temp;
  char *OUTPATH = "data_input";
  FILE *fp;
  srand(time(NULL));
  while ((option = getopt(argc, argv, "s:b:po:")) != -1)
    switch (option) {
    case 's':
      size = strtol(optarg, NULL, 10);
      break;
    case 'b':
      range = strtol(optarg, NULL, 10);
      break;
    case 'p':
      b_print = 1;
      break;
    case 'o':
      OUTPATH = optarg;
      break;
    case '?':
      printf("Unexpected Options. \n");
      return -1;
    }
  A = CreateMat(size, size);
  T = CreateMat(size, size);
  S = CreateMat(size, size);
  b = malloc(size * sizeof(double));
  for (i = 0; i < size; ++i)
    for (j = 0; j < size; ++j) {
      A[i][j] = 0;
      T[i][j] = 0;
    }
  MatGen(size, T, (double)range);
  GenPerm(size, A);
  MatMul(size, T, A, S);
  for (i = 0; i < size; ++i) {
    temp = (double)(random() % (int)(range * 100.0)) / 100.0;
    if (random() % 2)
      temp *= -1;
    b[i] = temp;
  }
  if ((fp = fopen(OUTPATH, "w")) == NULL) {
    printf("Fail to open a file to save the data. \n");
    return -2;
  }
  fprintf(fp, "%d\n\n", size);
  for (i = 0; i < size; ++i) {
    for (j = 0; j < size; ++j)
      fprintf(fp, "%lf\t", S[i][j]);
    fprintf(fp, "\n");
  }
  fprintf(fp, "\n");
  for (i = 0; i < size; ++i)
    fprintf(fp, "%lf\n", b[i]);
  fclose(fp);
  if (b_print) {
    printf("The problem size is %d.\n", size);
    printf("============\n The A is \n============\n");
    PrintMat(S, size, size);
    printf("============\n The b is \n============\n");
    PrintVec(b, size);
  }
  DestroyMat(A, size);
  DestroyMat(T, size);
  DestroyMat(S, size);
  free(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x64,-0x28(%rbp)
lea    0xdbe(%rip),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
mov    %eax,%edi
call   10a0 <srand@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xda7(%rip),%rdx
call   1130 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     135b <main+0x13b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x64(%rbp)
sub    $0x3f,%eax
je     133c <main+0x11c>
jmp    1299 <main+0x79>
mov    -0x64(%rbp),%eax
sub    $0x62,%eax
je     12fd <main+0xdd>
jmp    12aa <main+0x8a>
mov    -0x64(%rbp),%eax
sub    $0x6f,%eax
je     1329 <main+0x109>
jmp    12bb <main+0x9b>
mov    -0x64(%rbp),%eax
sub    $0x70,%eax
je     131d <main+0xfd>
jmp    12cc <main+0xac>
mov    -0x64(%rbp),%eax
sub    $0x73,%eax
jne    1356 <main+0x136>
jmp    12dd <main+0xbd>
mov    0x2d14(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10c0 <strtol@plt>
mov    %eax,-0x20(%rbp)
jmp    1356 <main+0x136>
mov    0x2cf4(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10c0 <strtol@plt>
mov    %eax,-0x28(%rbp)
jmp    1356 <main+0x136>
movl   $0x1,-0x24(%rbp)
jmp    1356 <main+0x136>
mov    0x2cc8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    1356 <main+0x136>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    167d <main+0x45d>
jmp    1266 <main+0x46>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1140 <CreateMat@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1140 <CreateMat@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1140 <CreateMat@plt>
mov    %rax,-0x40(%rbp)
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1412 <main+0x1f2>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13ff <main+0x1df>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13b5 <main+0x195>
jmp    1404 <main+0x1e4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13a2 <main+0x182>
mov    -0x20(%rbp),%edi
mov    -0x38(%rbp),%rsi
cvtsi2sdl -0x28(%rbp),%xmm0
call   1090 <MatGen@plt>
mov    -0x20(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1040 <GenPerm@plt>
mov    -0x20(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x40(%rbp),%rcx
call   1080 <MatMul@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    14d4 <main+0x2b4>
mov    $0x0,%al
call   10e0 <random@plt>
cvtsi2sdl -0x28(%rbp),%xmm0
movsd  0xb96(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xb7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0x0,%al
call   10e0 <random@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     14b4 <main+0x294>
movsd  0xb5e(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    144a <main+0x22a>
mov    -0x58(%rbp),%rdi
lea    0xb5a(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    150c <main+0x2ec>
lea    0xb42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    167d <main+0x45d>
mov    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xb49(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    159c <main+0x37c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    157c <main+0x35c>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xb01(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    153b <main+0x31b>
mov    -0x60(%rbp),%rdi
lea    0xadf(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1528 <main+0x308>
mov    -0x60(%rbp),%rdi
lea    0xabf(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    15ee <main+0x3ce>
mov    -0x60(%rbp),%rdi
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xa94(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15b5 <main+0x395>
mov    -0x60(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x24(%rbp)
je     1649 <main+0x429>
mov    -0x20(%rbp),%esi
lea    0xa67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1110 <PrintMat@plt>
lea    0xa7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1100 <PrintVec@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1070 <DestroyMat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1070 <DestroyMat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1070 <DestroyMat@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r12d,%r12d
xor    %edi,%edi
call   10f0 <time@plt>
mov    %eax,%edi
call   10c0 <srand@plt>
lea    0xdfd(%rip),%rax
mov    %rax,0x28(%rsp)
mov    $0x64,%eax
mov    %rax,0x8(%rsp)
movsd  0xd7e(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xde4(%rip),%r14
lea    0xd8a(%rip),%r15
mov    0x2d5b(%rip),%r13
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1150 <getopt@plt>
lea    -0x62(%rax),%ecx
cmp    $0x11,%ecx
ja     12e0 <main+0xa0>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    0x0(%r13),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10e0 <strtol@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
jmp    12a0 <main+0x60>
nopl   (%rax)
cmp    $0xffffffff,%eax
je     1319 <main+0xd9>
cmp    $0x3f,%eax
jne    12a0 <main+0x60>
jmp    154c <main+0x30c>
mov    0x0(%r13),%rax
mov    %rax,0x28(%rsp)
jmp    12a0 <main+0x60>
mov    $0x1,%r12d
jmp    12a0 <main+0x60>
mov    0x0(%r13),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %rax,0x8(%rsp)
jmp    12a0 <main+0x60>
mov    %r12,0x40(%rsp)
mov    0x8(%rsp),%r13
mov    %r13d,%edi
mov    %r13d,%esi
call   1160 <CreateMat@plt>
mov    %rax,%rbp
mov    %r13d,%edi
mov    %r13d,%esi
call   1160 <CreateMat@plt>
mov    %rax,%rbx
mov    %r13d,%edi
mov    %r13d,%esi
call   1160 <CreateMat@plt>
mov    %rax,%r12
lea    0x0(,%r13,8),%edi
call   1110 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %r13d,%r14d
test   %r13d,%r13d
mov    %rbp,0x38(%rsp)
mov    %rbx,0x30(%rsp)
jle    161f <main+0x3df>
mov    %r14d,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r8
mov    %r8,%r9
shr    $0x2,%r9
add    $0x1,%r9
mov    %r9d,%r10d
and    $0x3,%r10d
and    $0xfffffffffffffffc,%r9
mov    %r14d,%r15d
and    $0x3,%r15d
mov    %r10,%rsi
shl    $0x5,%rsi
xor    %ebp,%ebp
xorps  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
jmp    13cd <main+0x18d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %r14,%rbp
je     1562 <main+0x322>
mov    0x38(%rsp),%rax
mov    (%rax,%rbp,8),%rcx
mov    0x30(%rsp),%rax
mov    (%rax,%rbp,8),%rdx
cmp    $0x4,%r13d
jb     13ff <main+0x1bf>
lea    (%rdx,%r14,8),%rax
cmp    %rax,%rcx
jae    14a0 <main+0x260>
lea    (%rcx,%r14,8),%rax
cmp    %rax,%rdx
jae    14a0 <main+0x260>
xor    %eax,%eax
mov    %rax,%rdi
not    %rdi
add    %r14,%rdi
test   %r15,%r15
je     143a <main+0x1fa>
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movq   $0x0,(%rcx,%rax,8)
movq   $0x0,(%rdx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rbx
jne    1420 <main+0x1e0>
cmp    $0x3,%rdi
jb     13c0 <main+0x180>
movq   $0x0,(%rcx,%rax,8)
movq   $0x0,(%rdx,%rax,8)
movq   $0x0,0x8(%rcx,%rax,8)
movq   $0x0,0x8(%rdx,%rax,8)
movq   $0x0,0x10(%rcx,%rax,8)
movq   $0x0,0x10(%rdx,%rax,8)
movq   $0x0,0x18(%rcx,%rax,8)
movq   $0x0,0x18(%rdx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r14
jne    1440 <main+0x200>
jmp    13c0 <main+0x180>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xc,%r8
jae    14aa <main+0x26a>
xor    %eax,%eax
jmp    1508 <main+0x2c8>
mov    %r9,%rdi
xor    %eax,%eax
nop
movups %xmm1,(%rcx,%rax,8)
movups %xmm1,0x10(%rcx,%rax,8)
movups %xmm1,(%rdx,%rax,8)
movups %xmm1,0x10(%rdx,%rax,8)
movups %xmm1,0x20(%rcx,%rax,8)
movups %xmm1,0x30(%rcx,%rax,8)
movups %xmm1,0x20(%rdx,%rax,8)
movups %xmm1,0x30(%rdx,%rax,8)
movups %xmm1,0x40(%rcx,%rax,8)
movups %xmm1,0x50(%rcx,%rax,8)
movups %xmm1,0x40(%rdx,%rax,8)
movups %xmm1,0x50(%rdx,%rax,8)
movups %xmm1,0x60(%rcx,%rax,8)
movups %xmm1,0x70(%rcx,%rax,8)
movups %xmm1,0x60(%rdx,%rax,8)
movups %xmm1,0x70(%rdx,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rdi
jne    14b0 <main+0x270>
test   %r10,%r10
je     153b <main+0x2fb>
lea    (%rdx,%rax,8),%rdi
add    $0x10,%rdi
lea    (%rcx,%rax,8),%rax
add    $0x10,%rax
xor    %ebx,%ebx
nop
movups %xmm1,-0x10(%rax,%rbx,1)
movups %xmm1,(%rax,%rbx,1)
movups %xmm1,-0x10(%rdi,%rbx,1)
movups %xmm1,(%rdi,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rsi
jne    1520 <main+0x2e0>
mov    %r11,%rax
cmp    %r14,%r11
je     13c0 <main+0x180>
jmp    1401 <main+0x1c1>
lea    0xbc3(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
jmp    17d4 <main+0x594>
mov    %r13d,%edi
mov    0x30(%rsp),%rbx
mov    %rbx,%rsi
movsd  %xmm0,0x10(%rsp)
call   10a0 <MatGen@plt>
mov    %r13d,%edi
mov    0x38(%rsp),%rbp
mov    %rbp,%rsi
call   1040 <GenPerm@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
call   1090 <MatMul@plt>
test   %r13d,%r13d
mov    0x20(%rsp),%rbx
mov    0x28(%rsp),%r15
jle    1651 <main+0x411>
movsd  0x10(%rsp),%xmm0
mulsd  0xa46(%rip),%xmm0
cvttsd2si %xmm0,%r13d
xor    %ebp,%ebp
jmp    15ec <main+0x3ac>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd 0x10(%rsp),%xmm0
xorpd  0xa32(%rip),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
je     1651 <main+0x411>
xor    %eax,%eax
call   1100 <random@plt>
cltd
idiv   %r13d
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  0x9fa(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1100 <random@plt>
test   $0x1,%al
jne    15d0 <main+0x390>
movapd 0x10(%rsp),%xmm0
jmp    15de <main+0x39e>
mov    %r13d,%edi
mov    %rbx,%rsi
movsd  0x10(%rsp),%xmm0
call   10a0 <MatGen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
call   1040 <GenPerm@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
call   1090 <MatMul@plt>
mov    0x28(%rsp),%r15
lea    0xa23(%rip),%rsi
mov    %r15,%rdi
call   1140 <fopen@plt>
test   %rax,%rax
je     172e <main+0x4ee>
mov    %rax,%rbp
lea    0xa0a(%rip),%rsi
mov    %rax,%rdi
mov    0x8(%rsp),%rbx
mov    %ebx,%edx
xor    %eax,%eax
call   10d0 <fprintf@plt>
test   %ebx,%ebx
jle    1744 <main+0x504>
xor    %r15d,%r15d
lea    0x9ec(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%r15,8),%rax
movsd  (%rax,%rbx,8),%xmm0
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    16b0 <main+0x470>
mov    $0xa,%edi
mov    %rbp,%rsi
call   10b0 <fputc@plt>
add    $0x1,%r15
cmp    %r14,%r15
jne    16a0 <main+0x460>
mov    $0xa,%edi
mov    %rbp,%rsi
call   10b0 <fputc@plt>
cmpl   $0x0,0x8(%rsp)
mov    0x20(%rsp),%r15
jle    1756 <main+0x516>
xor    %ebx,%ebx
lea    0x980(%rip),%r13
nopw   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x1,%al
call   10d0 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1710 <main+0x4d0>
jmp    1756 <main+0x516>
lea    0x9ba(%rip),%rdi
call   1050 <puts@plt>
mov    $0xfffffffe,%eax
jmp    17d4 <main+0x594>
mov    $0xa,%edi
mov    %rbp,%rsi
call   10b0 <fputc@plt>
mov    0x20(%rsp),%r15
mov    %rbp,%rdi
call   1060 <fclose@plt>
cmpl   $0x0,0x40(%rsp)
mov    0x8(%rsp),%rbx
je     17a8 <main+0x568>
lea    0x91b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x924(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1130 <PrintMat@plt>
lea    0x931(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1120 <PrintVec@plt>
mov    0x38(%rsp),%rdi
mov    %ebx,%esi
call   1080 <DestroyMat@plt>
mov    0x30(%rsp),%rdi
mov    %ebx,%esi
call   1080 <DestroyMat@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1080 <DestroyMat@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"data_input\00"
@.str.1 = [8 x i8] c"s:b:po:\00"
@optarg = global i8* null
@.str.2 = [22 x i8] c"Unexpected Options. \0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [40 x i8] c"Fail to open a file to save the data. \0A\00"
@.str.5 = [5 x i8] c"%d\0A\0A\00"
@.str.6 = [5 x i8] c"%lf\09\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [5 x i8] c"%lf\0A\00"
@.str.9 = [25 x i8] c"The problem size is %d.\0A\00"
@.str.10 = [38 x i8] c"============\0A The A is \0A============\0A\00"
@.str.11 = [38 x i8] c"============\0A The b is \0A============\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double**
%13 = alloca double**
%14 = alloca double**
%15 = alloca double*
%16 = alloca double
%17 = alloca i8*
%18 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %9
store i32 0, i32* %10
store i32 100, i32* %11
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %17
%19 = call i32 @time(i32* null)
%20 = call i32 @srand(i32 %19)
br label %21
21: ; preds = %39, %2
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 %24, i32* %8
%25 = icmp ne i32 %24, -1
br i1 %25, label %26, label %40
26: ; preds = %21
%27 = load i32, i32* %8
switch i32 %27, label %39 [
i32 115, label %28
i32 98, label %31
i32 112, label %34
i32 111, label %35
i32 63, label %37
]
28: ; preds = %26
%29 = load i8*, i8** @optarg
%30 = call i32 @strtol(i8* %29, i32* null, i32 10)
store i32 %30, i32* %9
br label %39
31: ; preds = %26
%32 = load i8*, i8** @optarg
%33 = call i32 @strtol(i8* %32, i32* null, i32 10)
store i32 %33, i32* %11
br label %39
34: ; preds = %26
store i32 1, i32* %10
br label %39
35: ; preds = %26
%36 = load i8*, i8** @optarg
store i8* %36, i8** %17
br label %39
37: ; preds = %26
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %217
39: ; preds = %26, %35, %34, %31, %28
br label %21
40: ; preds = %21
%41 = load i32, i32* %9
%42 = load i32, i32* %9
%43 = call double** @CreateMat(i32 %41, i32 %42)
store double** %43, double*** %12
%44 = load i32, i32* %9
%45 = load i32, i32* %9
%46 = call double** @CreateMat(i32 %44, i32 %45)
store double** %46, double*** %13
%47 = load i32, i32* %9
%48 = load i32, i32* %9
%49 = call double** @CreateMat(i32 %47, i32 %48)
store double** %49, double*** %14
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = mul i64 %51, 8
%53 = trunc i64 %52 to i32
%54 = call double* @malloc(i32 %53)
store double* %54, double** %15
store i32 0, i32* %6
br label %55
55: ; preds = %85, %40
%56 = load i32, i32* %6
%57 = load i32, i32* %9
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %88
59: ; preds = %55
store i32 0, i32* %7
br label %60
60: ; preds = %81, %59
%61 = load i32, i32* %7
%62 = load i32, i32* %9
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %84
64: ; preds = %60
%65 = load double**, double*** %12
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double*, double** %65, i64 %67
%69 = load double*, double** %68
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double 0.000000e+00, double* %72
%73 = load double**, double*** %13
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double*, double** %73, i64 %75
%77 = load double*, double** %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
store double 0.000000e+00, double* %80
br label %81
81: ; preds = %64
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
store i32 %83, i32* %7
br label %60
84: ; preds = %60
br label %85
85: ; preds = %84
%86 = load i32, i32* %6
%87 = add nsw i32 %86, 1
store i32 %87, i32* %6
br label %55
88: ; preds = %55
%89 = load i32, i32* %9
%90 = load double**, double*** %13
%91 = load i32, i32* %11
%92 = sitofp i32 %91 to double
%93 = call i32 @MatGen(i32 %89, double** %90, double %92)
%94 = load i32, i32* %9
%95 = load double**, double*** %12
%96 = call i32 @GenPerm(i32 %94, double** %95)
%97 = load i32, i32* %9
%98 = load double**, double*** %13
%99 = load double**, double*** %12
%100 = load double**, double*** %14
%101 = call i32 @MatMul(i32 %97, double** %98, double** %99, double** %100)
store i32 0, i32* %6
br label %102
102: ; preds = %127, %88
%103 = load i32, i32* %6
%104 = load i32, i32* %9
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %130
106: ; preds = %102
%107 = call i32 (...) @random()
%108 = load i32, i32* %11
%109 = sitofp i32 %108 to double
%110 = fmul double %109, 1.000000e+02
%111 = fptosi double %110 to i32
%112 = srem i32 %107, %111
%113 = sitofp i32 %112 to double
%114 = fdiv double %113, 1.000000e+02
store double %114, double* %16
%115 = call i32 (...) @random()
%116 = srem i32 %115, 2
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %106
%119 = load double, double* %16
%120 = fmul double %119, -1.000000e+00
store double %120, double* %16
br label %121
121: ; preds = %118, %106
%122 = load double, double* %16
%123 = load double*, double** %15
%124 = load i32, i32* %6
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
store double %122, double* %126
br label %127
127: ; preds = %121
%128 = load i32, i32* %6
%129 = add nsw i32 %128, 1
store i32 %129, i32* %6
br label %102
130: ; preds = %102
%131 = load i8*, i8** %17
%132 = call i32* @fopen(i8* %131, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %132, i32** %18
%133 = icmp eq i32* %132, null
br i1 %133, label %134, label %136
134: ; preds = %130
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
store i32 -2, i32* %3
br label %217
136: ; preds = %130
%137 = load i32*, i32** %18
%138 = load i32, i32* %9
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %138)
store i32 0, i32* %6
br label %140
140: ; preds = %167, %136
%141 = load i32, i32* %6
%142 = load i32, i32* %9
%143 = icmp slt i32 %141, %142
br i1 %143, label %144, label %170
144: ; preds = %140
store i32 0, i32* %7
br label %145
145: ; preds = %161, %144
%146 = load i32, i32* %7
%147 = load i32, i32* %9
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %164
149: ; preds = %145
%150 = load i32*, i32** %18
%151 = load double**, double*** %14
%152 = load i32, i32* %6
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double*, double** %151, i64 %153
%155 = load double*, double** %154
%156 = load i32, i32* %7
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = call i32 (i32*, i8*, ...) @fprintf(i32* %150, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double %159)
br label %161
161: ; preds = %149
%162 = load i32, i32* %7
%163 = add nsw i32 %162, 1
store i32 %163, i32* %7
br label %145
164: ; preds = %145
%165 = load i32*, i32** %18
%166 = call i32 (i32*, i8*, ...) @fprintf(i32* %165, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %167
167: ; preds = %164
%168 = load i32, i32* %6
%169 = add nsw i32 %168, 1
store i32 %169, i32* %6
br label %140
170: ; preds = %140
%171 = load i32*, i32** %18
%172 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %173
173: ; preds = %185, %170
%174 = load i32, i32* %6
%175 = load i32, i32* %9
%176 = icmp slt i32 %174, %175
br i1 %176, label %177, label %188
177: ; preds = %173
%178 = load i32*, i32** %18
%179 = load double*, double** %15
%180 = load i32, i32* %6
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %179, i64 %181
%183 = load double, double* %182
%184 = call i32 (i32*, i8*, ...) @fprintf(i32* %178, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double %183)
br label %185
185: ; preds = %177
%186 = load i32, i32* %6
%187 = add nsw i32 %186, 1
store i32 %187, i32* %6
br label %173
188: ; preds = %173
%189 = load i32*, i32** %18
%190 = call i32 @fclose(i32* %189)
%191 = load i32, i32* %10
%192 = icmp ne i32 %191, 0
br i1 %192, label %193, label %205
193: ; preds = %188
%194 = load i32, i32* %9
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %194)
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%197 = load double**, double*** %14
%198 = load i32, i32* %9
%199 = load i32, i32* %9
%200 = call i32 @PrintMat(double** %197, i32 %198, i32 %199)
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
%202 = load double*, double** %15
%203 = load i32, i32* %9
%204 = call i32 @PrintVec(double* %202, i32 %203)
br label %205
205: ; preds = %193, %188
%206 = load double**, double*** %12
%207 = load i32, i32* %9
%208 = call i32 @DestroyMat(double** %206, i32 %207)
%209 = load double**, double*** %13
%210 = load i32, i32* %9
%211 = call i32 @DestroyMat(double** %209, i32 %210)
%212 = load double**, double*** %14
%213 = load i32, i32* %9
%214 = call i32 @DestroyMat(double** %212, i32 %213)
%215 = load double*, double** %15
%216 = call i32 @free(double* %215)
store i32 0, i32* %3
br label %217
217: ; preds = %205, %134, %37
%218 = load i32, i32* %3
ret i32 %218
}

LLVM IR (-O2):
@.str = [11 x i8] c"data_input\00"
@.str.1 = [8 x i8] c"s:b:po:\00"
@optarg = global i8* null
@.str.3 = [2 x i8] c"w\00"
@.str.5 = [5 x i8] c"%d\0A\0A\00"
@.str.6 = [5 x i8] c"%lf\09\00"
@.str.8 = [5 x i8] c"%lf\0A\00"
@.str.9 = [25 x i8] c"The problem size is %d.\0A\00"
@str = [37 x i8] c"============\0A The A is \0A============\00"
@str.12 = [37 x i8] c"============\0A The b is \0A============\00"
@str.13 = [39 x i8] c"Fail to open a file to save the data. \00"
@str.14 = [21 x i8] c"Unexpected Options. \00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %24, %2
%6 = phi double [ %27, %24 ], [ 1.000000e+02, %2 ]
%7 = phi i32 [ %11, %24 ], [ 0, %2 ]
%8 = phi i32 [ %15, %24 ], [ 100, %2 ]
%9 = phi i8* [ %18, %24 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
br label %10
10: ; preds = %19, %5
%11 = phi i32 [ %7, %5 ], [ 1, %19 ]
%12 = phi i32 [ %8, %5 ], [ %15, %19 ]
%13 = phi i8* [ %9, %5 ], [ %18, %19 ]
br label %14
14: ; preds = %10, %21
%15 = phi i32 [ %12, %10 ], [ %23, %21 ]
%16 = phi i8* [ %13, %10 ], [ %18, %21 ]
br label %17
17: ; preds = %14, %28
%18 = phi i8* [ %16, %14 ], [ %29, %28 ]
br label %19
19: ; preds = %17, %19
%20 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
switch i32 %20, label %19 [
i32 -1, label %32
i32 115, label %21
i32 98, label %24
i32 112, label %10
i32 111, label %28
i32 63, label %30
]
21: ; preds = %19
%22 = load i8*, i8** @optarg
%23 = tail call i32 @strtol(i8* nocapture %22, i32* null, i32 10)
br label %14
24: ; preds = %19
%25 = load i8*, i8** @optarg
%26 = tail call i32 @strtol(i8* nocapture %25, i32* null, i32 10)
%27 = sitofp i32 %26 to double
br label %5
28: ; preds = %19
%29 = load i8*, i8** @optarg
br label %17
30: ; preds = %19
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.14, i64 0, i64 0))
br label %235
32: ; preds = %19
%33 = tail call double** @CreateMat(i32 %15, i32 %15)
%34 = tail call double** @CreateMat(i32 %15, i32 %15)
%35 = tail call double** @CreateMat(i32 %15, i32 %15)
%36 = shl i32 %15, 3
%37 = tail call double* @malloc(i32 %36)
%38 = icmp sgt i32 %15, 0
br i1 %38, label %39, label %180
39: ; preds = %32
%40 = zext i32 %15 to i64
%41 = and i64 %40, 4294967292
%42 = add nsw i64 %41, -4
%43 = lshr exact i64 %42, 2
%44 = add nuw nsw i64 %43, 1
%45 = icmp ult i32 %15, 4
%46 = and i64 %40, 4294967292
%47 = and i64 %44, 3
%48 = icmp ult i64 %42, 12
%49 = and i64 %44, 9223372036854775804
%50 = icmp eq i64 %47, 0
%51 = icmp eq i64 %46, %40
%52 = and i64 %40, 3
%53 = icmp eq i64 %52, 0
br label %54
54: ; preds = %155, %39
%55 = phi i64 [ 0, %39 ], [ %156, %155 ]
%56 = getelementptr inbounds double*, double** %33, i64 %55
%57 = load double*, double** %56
%58 = getelementptr inbounds double*, double** %34, i64 %55
%59 = load double*, double** %58
br i1 %45, label %125, label %60
60: ; preds = %54
%61 = getelementptr double, double* %57, i64 %40
%62 = getelementptr double, double* %59, i64 %40
%63 = icmp ult double* %57, %62
%64 = icmp ult double* %59, %61
%65 = and i1 %63, %64
br i1 %65, label %125, label %66
66: ; preds = %60
br i1 %48, label %108, label %67
67: ; preds = %66, %67
%68 = phi i64 [ %105, %67 ], [ 0, %66 ]
%69 = phi i64 [ %106, %67 ], [ 0, %66 ]
%70 = getelementptr inbounds double, double* %57, i64 %68
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %71
%72 = getelementptr inbounds double, double* %70, i64 2
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %73
%74 = getelementptr inbounds double, double* %59, i64 %68
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %75
%76 = getelementptr inbounds double, double* %74, i64 2
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %77
%78 = or i64 %68, 4
%79 = getelementptr inbounds double, double* %57, i64 %78
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %80
%81 = getelementptr inbounds double, double* %79, i64 2
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %82
%83 = getelementptr inbounds double, double* %59, i64 %78
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %84
%85 = getelementptr inbounds double, double* %83, i64 2
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %86
%87 = or i64 %68, 8
%88 = getelementptr inbounds double, double* %57, i64 %87
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %89
%90 = getelementptr inbounds double, double* %88, i64 2
%91 = bitcast double* %90 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %91
%92 = getelementptr inbounds double, double* %59, i64 %87
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %93
%94 = getelementptr inbounds double, double* %92, i64 2
%95 = bitcast double* %94 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %95
%96 = or i64 %68, 12
%97 = getelementptr inbounds double, double* %57, i64 %96
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %98
%99 = getelementptr inbounds double, double* %97, i64 2
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %100
%101 = getelementptr inbounds double, double* %59, i64 %96
%102 = bitcast double* %101 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %102
%103 = getelementptr inbounds double, double* %101, i64 2
%104 = bitcast double* %103 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %104
%105 = add nuw i64 %68, 16
%106 = add nuw i64 %69, 4
%107 = icmp eq i64 %106, %49
br i1 %107, label %108, label %67
108: ; preds = %67, %66
%109 = phi i64 [ 0, %66 ], [ %105, %67 ]
br i1 %50, label %124, label %110
110: ; preds = %108, %110
%111 = phi i64 [ %121, %110 ], [ %109, %108 ]
%112 = phi i64 [ %122, %110 ], [ 0, %108 ]
%113 = getelementptr inbounds double, double* %57, i64 %111
%114 = bitcast double* %113 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %114
%115 = getelementptr inbounds double, double* %113, i64 2
%116 = bitcast double* %115 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %116
%117 = getelementptr inbounds double, double* %59, i64 %111
%118 = bitcast double* %117 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %118
%119 = getelementptr inbounds double, double* %117, i64 2
%120 = bitcast double* %119 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %120
%121 = add nuw i64 %111, 4
%122 = add i64 %112, 1
%123 = icmp eq i64 %122, %47
br i1 %123, label %124, label %110
124: ; preds = %110, %108
br i1 %51, label %155, label %125
125: ; preds = %60, %54, %124
%126 = phi i64 [ 0, %60 ], [ 0, %54 ], [ %46, %124 ]
%127 = xor i64 %126, -1
%128 = add nsw i64 %127, %40
br i1 %53, label %137, label %129
129: ; preds = %125, %129
%130 = phi i64 [ %134, %129 ], [ %126, %125 ]
%131 = phi i64 [ %135, %129 ], [ 0, %125 ]
%132 = getelementptr inbounds double, double* %57, i64 %130
store double 0.000000e+00, double* %132
%133 = getelementptr inbounds double, double* %59, i64 %130
store double 0.000000e+00, double* %133
%134 = add nuw nsw i64 %130, 1
%135 = add i64 %131, 1
%136 = icmp eq i64 %135, %52
br i1 %136, label %137, label %129
137: ; preds = %129, %125
%138 = phi i64 [ %126, %125 ], [ %134, %129 ]
%139 = icmp ult i64 %128, 3
br i1 %139, label %155, label %140
140: ; preds = %137, %140
%141 = phi i64 [ %153, %140 ], [ %138, %137 ]
%142 = getelementptr inbounds double, double* %57, i64 %141
store double 0.000000e+00, double* %142
%143 = getelementptr inbounds double, double* %59, i64 %141
store double 0.000000e+00, double* %143
%144 = add nuw nsw i64 %141, 1
%145 = getelementptr inbounds double, double* %57, i64 %144
store double 0.000000e+00, double* %145
%146 = getelementptr inbounds double, double* %59, i64 %144
store double 0.000000e+00, double* %146
%147 = add nuw nsw i64 %141, 2
%148 = getelementptr inbounds double, double* %57, i64 %147
store double 0.000000e+00, double* %148
%149 = getelementptr inbounds double, double* %59, i64 %147
store double 0.000000e+00, double* %149
%150 = add nuw nsw i64 %141, 3
%151 = getelementptr inbounds double, double* %57, i64 %150
store double 0.000000e+00, double* %151
%152 = getelementptr inbounds double, double* %59, i64 %150
store double 0.000000e+00, double* %152
%153 = add nuw nsw i64 %141, 4
%154 = icmp eq i64 %153, %40
br i1 %154, label %155, label %140
155: ; preds = %137, %140, %124
%156 = add nuw nsw i64 %55, 1
%157 = icmp eq i64 %156, %40
br i1 %157, label %158, label %54
158: ; preds = %155
%159 = tail call i32 @MatGen(i32 %15, double** %34, double %6)
%160 = tail call i32 @GenPerm(i32 %15, double** %33)
%161 = tail call i32 @MatMul(i32 %15, double** %34, double** %33, double** %35)
br i1 %38, label %162, label %184
162: ; preds = %158
%163 = fmul double %6, 1.000000e+02
%164 = fptosi double %163 to i32
%165 = zext i32 %15 to i64
br label %166
166: ; preds = %162, %166
%167 = phi i64 [ 0, %162 ], [ %178, %166 ]
%168 = tail call i32 (...) @random()
%169 = srem i32 %168, %164
%170 = sitofp i32 %169 to double
%171 = fdiv double %170, 1.000000e+02
%172 = tail call i32 (...) @random()
%173 = and i32 %172, 1
%174 = icmp eq i32 %173, 0
%175 = fneg double %171
%176 = select i1 %174, double %171, double %175
%177 = getelementptr inbounds double, double* %37, i64 %167
store double %176, double* %177
%178 = add nuw nsw i64 %167, 1
%179 = icmp eq i64 %178, %165
br i1 %179, label %184, label %166
180: ; preds = %32
%181 = tail call i32 @MatGen(i32 %15, double** %34, double %6)
%182 = tail call i32 @GenPerm(i32 %15, double** %33)
%183 = tail call i32 @MatMul(i32 %15, double** %34, double** %33, double** %35)
br label %184
184: ; preds = %166, %180, %158
%185 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%186 = icmp eq i32* %185, null
br i1 %186, label %187, label %189
187: ; preds = %184
%188 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.13, i64 0, i64 0))
br label %235
189: ; preds = %184
%190 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %15)
br i1 %38, label %193, label %191
191: ; preds = %189
%192 = tail call i32 @fputc(i32 10, i32* %185)
br label %221
193: ; preds = %189
%194 = zext i32 %15 to i64
br label %195
195: ; preds = %206, %193
%196 = phi i64 [ 0, %193 ], [ %208, %206 ]
%197 = getelementptr inbounds double*, double** %35, i64 %196
br label %198
198: ; preds = %195, %198
%199 = phi i64 [ 0, %195 ], [ %204, %198 ]
%200 = load double*, double** %197
%201 = getelementptr inbounds double, double* %200, i64 %199
%202 = load double, double* %201
%203 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double %202)
%204 = add nuw nsw i64 %199, 1
%205 = icmp eq i64 %204, %194
br i1 %205, label %206, label %198
206: ; preds = %198
%207 = tail call i32 @fputc(i32 10, i32* %185)
%208 = add nuw nsw i64 %196, 1
%209 = icmp eq i64 %208, %194
br i1 %209, label %210, label %195
210: ; preds = %206
%211 = tail call i32 @fputc(i32 10, i32* %185)
br i1 %38, label %212, label %221
212: ; preds = %210
%213 = zext i32 %15 to i64
br label %214
214: ; preds = %212, %214
%215 = phi i64 [ 0, %212 ], [ %219, %214 ]
%216 = getelementptr inbounds double, double* %37, i64 %215
%217 = load double, double* %216
%218 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double %217)
%219 = add nuw nsw i64 %215, 1
%220 = icmp eq i64 %219, %213
br i1 %220, label %221, label %214
221: ; preds = %214, %191, %210
%222 = tail call i32 @fclose(i32* %185)
%223 = icmp eq i32 %11, 0
br i1 %223, label %230, label %224
224: ; preds = %221
%225 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %15)
%226 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%227 = tail call i32 @PrintMat(double** %35, i32 %15, i32 %15)
%228 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%229 = tail call i32 @PrintVec(double* %37, i32 %15)
br label %230
230: ; preds = %224, %221
%231 = tail call i32 @DestroyMat(double** %33, i32 %15)
%232 = tail call i32 @DestroyMat(double** %34, i32 %15)
%233 = tail call i32 @DestroyMat(double** %35, i32 %15)
%234 = tail call i32 @free(double* %37)
br label %235
235: ; preds = %230, %187, %30
%236 = phi i32 [ -1, %30 ], [ -2, %187 ], [ 0, %230 ]
ret i32 %236
}