#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 double uint64_t;
struct timespec {
  long tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ dgemm0(double *, double *, double *, int);
int /*<<< orphan*/ dgemm1(double *, double *, double *, int);
int /*<<< orphan*/ dgemm2(double *, double *, double *, int);
int /*<<< orphan*/ dgemm3(double *, double *, double *, int);
int /*<<< orphan*/ printf(char *, double);
double rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double verification(double *, double *, double *, double *, int);
int main(int argc, char *argv[]) {
  int n = atoi(argv[1]);
  uint64_t t0;
  float t;
  struct timespec begin, end;
  double *a, *b;
  double *c0, *c1, *c2, *c3, *c4;
  double diff;
  int i;
  srand(time(NULL));
  a = (double *)calloc(sizeof(double), n * n);
  for (i = 0; i < n * n; i++) {
    a[i] = rand() / 1000000.0;
  }
  b = (double *)calloc(sizeof(double), n * n);
  for (i = 0; i < n * n; i++) {
    b[i] = rand() / 1000000.0;
  }
  c0 = (double *)calloc(sizeof(double), n * n);
  c1 = (double *)calloc(sizeof(double), n * n);
  c2 = (double *)calloc(sizeof(double), n * n);
  c3 = (double *)calloc(sizeof(double), n * n);
  c4 = (double *)calloc(sizeof(double), n * n);
  clock_gettime(CLOCK_MONOTONIC, &begin);
  dgemm0(a, b, c0, n);
  clock_gettime(CLOCK_MONOTONIC, &end);
  t0 = 1000000000L * (end.tv_sec - begin.tv_sec) + end.tv_nsec - begin.tv_nsec;
  t = t0 / 1000000000.0;
  printf("%f\t", t);
  clock_gettime(CLOCK_MONOTONIC, &begin);
  dgemm1(a, b, c1, n);
  clock_gettime(CLOCK_MONOTONIC, &end);
  t0 = 1000000000L * (end.tv_sec - begin.tv_sec) + end.tv_nsec - begin.tv_nsec;
  t = t0 / 1000000000.0;
  printf("%f\t", t);
  clock_gettime(CLOCK_MONOTONIC, &begin);
  dgemm2(a, b, c2, n);
  clock_gettime(CLOCK_MONOTONIC, &end);
  t0 = 1000000000L * (end.tv_sec - begin.tv_sec) + end.tv_nsec - begin.tv_nsec;
  t = t0 / 1000000000.0;
  printf("%f\t", t);
  clock_gettime(CLOCK_MONOTONIC, &begin);
  dgemm3(a, b, c3, n);
  clock_gettime(CLOCK_MONOTONIC, &end);
  t0 = 1000000000L * (end.tv_sec - begin.tv_sec) + end.tv_nsec - begin.tv_nsec;
  t = t0 / 1000000000.0;
  printf("%f\t", t);
  clock_gettime(CLOCK_MONOTONIC, &begin);
  dgemm3(a, b, c4, n);
  clock_gettime(CLOCK_MONOTONIC, &end);
  t0 = 1000000000L * (end.tv_sec - begin.tv_sec) + end.tv_nsec - begin.tv_nsec;
  t = t0 / 1000000000.0;
  printf("%f\t", t);
  diff = verification(a, b, c0, c1, n);
  printf("%f\t", diff);
  diff = verification(a, b, c0, c2, n);
  printf("%f\t", diff);
  diff = verification(a, b, c0, c3, n);
  printf("%f\t", diff);
  diff = verification(a, b, c0, c4, n);
  printf("%f\n", diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1264 <main+0xa4>
mov    $0x0,%al
call   10e0 <rand@plt>
movsd  0xdcc(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1218 <main+0x58>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    12cf <main+0x10f>
mov    $0x0,%al
call   10e0 <rand@plt>
movsd  0xd61(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1283 <main+0xc3>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1080 <calloc@plt>
mov    %rax,-0x80(%rbp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   10c0 <dgemm0@plt>
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xc60(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc53(%rip),%rdi
call   1060 <printf@plt>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1050 <dgemm1@plt>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xbd6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbc9(%rip),%rdi
call   1060 <printf@plt>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   10b0 <dgemm2@plt>
mov    0x2b6f(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xb4c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb3f(%rip),%rdi
call   1060 <printf@plt>
mov    0x2b0b(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dgemm3@plt>
mov    0x2ae5(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xac2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xab5(%rip),%rdi
call   1060 <printf@plt>
mov    0x2a81(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dgemm3@plt>
mov    0x2a5b(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x48(%rbp),%rax
sub    -0x38(%rbp),%rax
imul   $0x3b9aca00,%rax,%rax
cvtsi2sd %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xa38(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xa2b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   10a0 <verification@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
lea    0x9f6(%rip),%rdi
call   1060 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x70(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   10a0 <verification@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
lea    0x9c1(%rip),%rdi
call   1060 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x78(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   10a0 <verification@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
lea    0x98c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   10a0 <verification@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
lea    0x95b(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    0x8(%rsi),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    %ebx,%r14d
imul   %ebx,%r14d
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,%r12
test   %r14d,%r14d
mov    %ebx,0x2c(%rsp)
je     1271 <main+0xb1>
mov    %r14d,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   10e0 <rand@plt>
divsd  0xde1(%rip),%xmm0
movsd  %xmm0,(%r12,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1210 <main+0x50>
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,%r13
test   %r14d,%r14d
je     1281 <main+0xc1>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   10e0 <rand@plt>
divsd  0xda1(%rip),%xmm0
movsd  %xmm0,0x0(%r13,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1250 <main+0x90>
jmp    1281 <main+0xc1>
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,%r13
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,%rbx
mov    %rax,0x50(%rsp)
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,%r15
mov    %rax,0x40(%rsp)
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,0x38(%rsp)
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,0x30(%rsp)
mov    $0x8,%edi
mov    %r14d,%esi
call   1080 <calloc@plt>
mov    %rax,0x48(%rsp)
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
mov    %rax,%rbp
lea    0x18(%rsp),%r14
mov    %r14,%rsi
call   1040 <clock_gettime@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    0x2c(%rsp),%ebx
mov    %ebx,%ecx
call   10c0 <dgemm0@plt>
mov    0x0(%rbp),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
divsd  0xcc0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb9(%rip),%rdi
call   1060 <printf@plt>
mov    0x0(%rbp),%edi
mov    %r14,%rsi
call   1040 <clock_gettime@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
call   1050 <dgemm1@plt>
mov    0x0(%rbp),%edi
lea    0x8(%rsp),%r15
mov    %r15,%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
divsd  0xc54(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc4d(%rip),%rdi
call   1060 <printf@plt>
mov    0x0(%rbp),%edi
mov    %r14,%rsi
call   1040 <clock_gettime@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x38(%rsp),%rdx
mov    %ebx,%ecx
call   10b0 <dgemm2@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
divsd  0xbeb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbe4(%rip),%rdi
mov    %rdi,%r14
call   1060 <printf@plt>
mov    0x0(%rbp),%edi
lea    0x18(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x30(%rsp),%rdx
mov    %ebx,%ecx
call   1030 <dgemm3@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
divsd  0xb7d(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    %r14,%r15
call   1060 <printf@plt>
mov    0x0(%rbp),%edi
lea    0x18(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x48(%rsp),%r14
mov    %r14,%rdx
mov    %ebx,%ecx
call   1030 <dgemm3@plt>
mov    0x0(%rbp),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
divsd  0xb0e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x50(%rsp),%rbp
mov    %rbp,%rdx
mov    0x40(%rsp),%rcx
mov    %ebx,%r8d
call   10a0 <verification@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    0x38(%rsp),%rcx
mov    %ebx,%r8d
call   10a0 <verification@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    0x30(%rsp),%rcx
mov    %ebx,%r8d
call   10a0 <verification@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %ebx,%r8d
call   10a0 <verification@plt>
lea    0xa90(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, double }
@CLOCK_MONOTONIC = global i32 0
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca float
%9 = alloca %struct.timespec
%10 = alloca %struct.timespec
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
%24 = call i32 @time(i32* null)
%25 = call i32 @srand(i32 %24)
%26 = load i32, i32* %6
%27 = load i32, i32* %6
%28 = mul nsw i32 %26, %27
%29 = call i64 @calloc(i32 8, i32 %28)
%30 = inttoptr i64 %29 to double*
store double* %30, double** %11
store i32 0, i32* %19
br label %31
31: ; preds = %44, %2
%32 = load i32, i32* %19
%33 = load i32, i32* %6
%34 = load i32, i32* %6
%35 = mul nsw i32 %33, %34
%36 = icmp slt i32 %32, %35
br i1 %36, label %37, label %47
37: ; preds = %31
%38 = call double (...) @rand()
%39 = fdiv double %38, 1.000000e+06
%40 = load double*, double** %11
%41 = load i32, i32* %19
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
store double %39, double* %43
br label %44
44: ; preds = %37
%45 = load i32, i32* %19
%46 = add nsw i32 %45, 1
store i32 %46, i32* %19
br label %31
47: ; preds = %31
%48 = load i32, i32* %6
%49 = load i32, i32* %6
%50 = mul nsw i32 %48, %49
%51 = call i64 @calloc(i32 8, i32 %50)
%52 = inttoptr i64 %51 to double*
store double* %52, double** %12
store i32 0, i32* %19
br label %53
53: ; preds = %66, %47
%54 = load i32, i32* %19
%55 = load i32, i32* %6
%56 = load i32, i32* %6
%57 = mul nsw i32 %55, %56
%58 = icmp slt i32 %54, %57
br i1 %58, label %59, label %69
59: ; preds = %53
%60 = call double (...) @rand()
%61 = fdiv double %60, 1.000000e+06
%62 = load double*, double** %12
%63 = load i32, i32* %19
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
store double %61, double* %65
br label %66
66: ; preds = %59
%67 = load i32, i32* %19
%68 = add nsw i32 %67, 1
store i32 %68, i32* %19
br label %53
69: ; preds = %53
%70 = load i32, i32* %6
%71 = load i32, i32* %6
%72 = mul nsw i32 %70, %71
%73 = call i64 @calloc(i32 8, i32 %72)
%74 = inttoptr i64 %73 to double*
store double* %74, double** %13
%75 = load i32, i32* %6
%76 = load i32, i32* %6
%77 = mul nsw i32 %75, %76
%78 = call i64 @calloc(i32 8, i32 %77)
%79 = inttoptr i64 %78 to double*
store double* %79, double** %14
%80 = load i32, i32* %6
%81 = load i32, i32* %6
%82 = mul nsw i32 %80, %81
%83 = call i64 @calloc(i32 8, i32 %82)
%84 = inttoptr i64 %83 to double*
store double* %84, double** %15
%85 = load i32, i32* %6
%86 = load i32, i32* %6
%87 = mul nsw i32 %85, %86
%88 = call i64 @calloc(i32 8, i32 %87)
%89 = inttoptr i64 %88 to double*
store double* %89, double** %16
%90 = load i32, i32* %6
%91 = load i32, i32* %6
%92 = mul nsw i32 %90, %91
%93 = call i64 @calloc(i32 8, i32 %92)
%94 = inttoptr i64 %93 to double*
store double* %94, double** %17
%95 = load i32, i32* @CLOCK_MONOTONIC
%96 = call i32 @clock_gettime(i32 %95, %struct.timespec* %9)
%97 = load double*, double** %11
%98 = load double*, double** %12
%99 = load double*, double** %13
%100 = load i32, i32* %6
%101 = call i32 @dgemm0(double* %97, double* %98, double* %99, i32 %100)
%102 = load i32, i32* @CLOCK_MONOTONIC
%103 = call i32 @clock_gettime(i32 %102, %struct.timespec* %10)
%104 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%105 = load i64, i64* %104
%106 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%107 = load i64, i64* %106
%108 = sub nsw i64 %105, %107
%109 = mul nsw i64 1000000000, %108
%110 = sitofp i64 %109 to double
%111 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%112 = load double, double* %111
%113 = fadd double %110, %112
%114 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%115 = load double, double* %114
%116 = fsub double %113, %115
store double %116, double* %7
%117 = load double, double* %7
%118 = fdiv double %117, 1.000000e+09
%119 = fptrunc double %118 to float
store float %119, float* %8
%120 = load float, float* %8
%121 = fpext float %120 to double
%122 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %121)
%123 = load i32, i32* @CLOCK_MONOTONIC
%124 = call i32 @clock_gettime(i32 %123, %struct.timespec* %9)
%125 = load double*, double** %11
%126 = load double*, double** %12
%127 = load double*, double** %14
%128 = load i32, i32* %6
%129 = call i32 @dgemm1(double* %125, double* %126, double* %127, i32 %128)
%130 = load i32, i32* @CLOCK_MONOTONIC
%131 = call i32 @clock_gettime(i32 %130, %struct.timespec* %10)
%132 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%133 = load i64, i64* %132
%134 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%135 = load i64, i64* %134
%136 = sub nsw i64 %133, %135
%137 = mul nsw i64 1000000000, %136
%138 = sitofp i64 %137 to double
%139 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%140 = load double, double* %139
%141 = fadd double %138, %140
%142 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%143 = load double, double* %142
%144 = fsub double %141, %143
store double %144, double* %7
%145 = load double, double* %7
%146 = fdiv double %145, 1.000000e+09
%147 = fptrunc double %146 to float
store float %147, float* %8
%148 = load float, float* %8
%149 = fpext float %148 to double
%150 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %149)
%151 = load i32, i32* @CLOCK_MONOTONIC
%152 = call i32 @clock_gettime(i32 %151, %struct.timespec* %9)
%153 = load double*, double** %11
%154 = load double*, double** %12
%155 = load double*, double** %15
%156 = load i32, i32* %6
%157 = call i32 @dgemm2(double* %153, double* %154, double* %155, i32 %156)
%158 = load i32, i32* @CLOCK_MONOTONIC
%159 = call i32 @clock_gettime(i32 %158, %struct.timespec* %10)
%160 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%161 = load i64, i64* %160
%162 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%163 = load i64, i64* %162
%164 = sub nsw i64 %161, %163
%165 = mul nsw i64 1000000000, %164
%166 = sitofp i64 %165 to double
%167 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%168 = load double, double* %167
%169 = fadd double %166, %168
%170 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%171 = load double, double* %170
%172 = fsub double %169, %171
store double %172, double* %7
%173 = load double, double* %7
%174 = fdiv double %173, 1.000000e+09
%175 = fptrunc double %174 to float
store float %175, float* %8
%176 = load float, float* %8
%177 = fpext float %176 to double
%178 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %177)
%179 = load i32, i32* @CLOCK_MONOTONIC
%180 = call i32 @clock_gettime(i32 %179, %struct.timespec* %9)
%181 = load double*, double** %11
%182 = load double*, double** %12
%183 = load double*, double** %16
%184 = load i32, i32* %6
%185 = call i32 @dgemm3(double* %181, double* %182, double* %183, i32 %184)
%186 = load i32, i32* @CLOCK_MONOTONIC
%187 = call i32 @clock_gettime(i32 %186, %struct.timespec* %10)
%188 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%189 = load i64, i64* %188
%190 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%191 = load i64, i64* %190
%192 = sub nsw i64 %189, %191
%193 = mul nsw i64 1000000000, %192
%194 = sitofp i64 %193 to double
%195 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%196 = load double, double* %195
%197 = fadd double %194, %196
%198 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%199 = load double, double* %198
%200 = fsub double %197, %199
store double %200, double* %7
%201 = load double, double* %7
%202 = fdiv double %201, 1.000000e+09
%203 = fptrunc double %202 to float
store float %203, float* %8
%204 = load float, float* %8
%205 = fpext float %204 to double
%206 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %205)
%207 = load i32, i32* @CLOCK_MONOTONIC
%208 = call i32 @clock_gettime(i32 %207, %struct.timespec* %9)
%209 = load double*, double** %11
%210 = load double*, double** %12
%211 = load double*, double** %17
%212 = load i32, i32* %6
%213 = call i32 @dgemm3(double* %209, double* %210, double* %211, i32 %212)
%214 = load i32, i32* @CLOCK_MONOTONIC
%215 = call i32 @clock_gettime(i32 %214, %struct.timespec* %10)
%216 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%217 = load i64, i64* %216
%218 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%219 = load i64, i64* %218
%220 = sub nsw i64 %217, %219
%221 = mul nsw i64 1000000000, %220
%222 = sitofp i64 %221 to double
%223 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%224 = load double, double* %223
%225 = fadd double %222, %224
%226 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%227 = load double, double* %226
%228 = fsub double %225, %227
store double %228, double* %7
%229 = load double, double* %7
%230 = fdiv double %229, 1.000000e+09
%231 = fptrunc double %230 to float
store float %231, float* %8
%232 = load float, float* %8
%233 = fpext float %232 to double
%234 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %233)
%235 = load double*, double** %11
%236 = load double*, double** %12
%237 = load double*, double** %13
%238 = load double*, double** %14
%239 = load i32, i32* %6
%240 = call double @verification(double* %235, double* %236, double* %237, double* %238, i32 %239)
store double %240, double* %18
%241 = load double, double* %18
%242 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %241)
%243 = load double*, double** %11
%244 = load double*, double** %12
%245 = load double*, double** %13
%246 = load double*, double** %15
%247 = load i32, i32* %6
%248 = call double @verification(double* %243, double* %244, double* %245, double* %246, i32 %247)
store double %248, double* %18
%249 = load double, double* %18
%250 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %249)
%251 = load double*, double** %11
%252 = load double*, double** %12
%253 = load double*, double** %13
%254 = load double*, double** %16
%255 = load i32, i32* %6
%256 = call double @verification(double* %251, double* %252, double* %253, double* %254, i32 %255)
store double %256, double* %18
%257 = load double, double* %18
%258 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %257)
%259 = load double*, double** %11
%260 = load double*, double** %12
%261 = load double*, double** %13
%262 = load double*, double** %17
%263 = load i32, i32* %6
%264 = call double @verification(double* %259, double* %260, double* %261, double* %262, i32 %263)
store double %264, double* %18
%265 = load double, double* %18
%266 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %265)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i64, double }
@CLOCK_MONOTONIC = global i32 0
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = bitcast %struct.timespec* %3 to i8*
%9 = bitcast %struct.timespec* %4 to i8*
%10 = tail call i32 @time(i32* null)
%11 = tail call i32 @srand(i32 %10)
%12 = mul nsw i32 %7, %7
%13 = tail call i64 @calloc(i32 8, i32 %12)
%14 = inttoptr i64 %13 to double*
%15 = icmp eq i32 %12, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = tail call i64 @calloc(i32 8, i32 %12)
%18 = inttoptr i64 %17 to double*
br label %40
19: ; preds = %2
%20 = zext i32 %12 to i64
br label %21
21: ; preds = %19, %21
%22 = phi i64 [ 0, %19 ], [ %26, %21 ]
%23 = tail call double (...) @rand()
%24 = fdiv double %23, 1.000000e+06
%25 = getelementptr inbounds double, double* %14, i64 %22
store double %24, double* %25
%26 = add nuw nsw i64 %22, 1
%27 = icmp eq i64 %26, %20
br i1 %27, label %28, label %21
28: ; preds = %21
%29 = tail call i64 @calloc(i32 8, i32 %12)
%30 = inttoptr i64 %29 to double*
br i1 %15, label %40, label %31
31: ; preds = %28
%32 = zext i32 %12 to i64
br label %33
33: ; preds = %31, %33
%34 = phi i64 [ 0, %31 ], [ %38, %33 ]
%35 = tail call double (...) @rand()
%36 = fdiv double %35, 1.000000e+06
%37 = getelementptr inbounds double, double* %30, i64 %34
store double %36, double* %37
%38 = add nuw nsw i64 %34, 1
%39 = icmp eq i64 %38, %32
br i1 %39, label %40, label %33
40: ; preds = %33, %16, %28
%41 = phi double* [ %18, %16 ], [ %30, %28 ], [ %30, %33 ]
%42 = tail call i64 @calloc(i32 8, i32 %12)
%43 = inttoptr i64 %42 to double*
%44 = tail call i64 @calloc(i32 8, i32 %12)
%45 = inttoptr i64 %44 to double*
%46 = tail call i64 @calloc(i32 8, i32 %12)
%47 = inttoptr i64 %46 to double*
%48 = tail call i64 @calloc(i32 8, i32 %12)
%49 = inttoptr i64 %48 to double*
%50 = tail call i64 @calloc(i32 8, i32 %12)
%51 = inttoptr i64 %50 to double*
%52 = load i32, i32* @CLOCK_MONOTONIC
%53 = call i32 @clock_gettime(i32 %52, %struct.timespec* %3)
%54 = call i32 @dgemm0(double* %14, double* %41, double* %43, i32 %7)
%55 = load i32, i32* @CLOCK_MONOTONIC
%56 = call i32 @clock_gettime(i32 %55, %struct.timespec* %4)
%57 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%58 = load i64, i64* %57
%59 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%60 = load i64, i64* %59
%61 = sub nsw i64 %58, %60
%62 = mul nsw i64 %61, 1000000000
%63 = sitofp i64 %62 to double
%64 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%65 = load double, double* %64
%66 = fadd double %65, %63
%67 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%68 = load double, double* %67
%69 = fsub double %66, %68
%70 = fdiv double %69, 1.000000e+09
%71 = fptrunc double %70 to float
%72 = fpext float %71 to double
%73 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %72)
%74 = load i32, i32* @CLOCK_MONOTONIC
%75 = call i32 @clock_gettime(i32 %74, %struct.timespec* %3)
%76 = call i32 @dgemm1(double* %14, double* %41, double* %45, i32 %7)
%77 = load i32, i32* @CLOCK_MONOTONIC
%78 = call i32 @clock_gettime(i32 %77, %struct.timespec* %4)
%79 = load i64, i64* %57
%80 = load i64, i64* %59
%81 = sub nsw i64 %79, %80
%82 = mul nsw i64 %81, 1000000000
%83 = sitofp i64 %82 to double
%84 = load double, double* %64
%85 = fadd double %84, %83
%86 = load double, double* %67
%87 = fsub double %85, %86
%88 = fdiv double %87, 1.000000e+09
%89 = fptrunc double %88 to float
%90 = fpext float %89 to double
%91 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %90)
%92 = load i32, i32* @CLOCK_MONOTONIC
%93 = call i32 @clock_gettime(i32 %92, %struct.timespec* %3)
%94 = call i32 @dgemm2(double* %14, double* %41, double* %47, i32 %7)
%95 = load i32, i32* @CLOCK_MONOTONIC
%96 = call i32 @clock_gettime(i32 %95, %struct.timespec* %4)
%97 = load i64, i64* %57
%98 = load i64, i64* %59
%99 = sub nsw i64 %97, %98
%100 = mul nsw i64 %99, 1000000000
%101 = sitofp i64 %100 to double
%102 = load double, double* %64
%103 = fadd double %102, %101
%104 = load double, double* %67
%105 = fsub double %103, %104
%106 = fdiv double %105, 1.000000e+09
%107 = fptrunc double %106 to float
%108 = fpext float %107 to double
%109 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %108)
%110 = load i32, i32* @CLOCK_MONOTONIC
%111 = call i32 @clock_gettime(i32 %110, %struct.timespec* %3)
%112 = call i32 @dgemm3(double* %14, double* %41, double* %49, i32 %7)
%113 = load i32, i32* @CLOCK_MONOTONIC
%114 = call i32 @clock_gettime(i32 %113, %struct.timespec* %4)
%115 = load i64, i64* %57
%116 = load i64, i64* %59
%117 = sub nsw i64 %115, %116
%118 = mul nsw i64 %117, 1000000000
%119 = sitofp i64 %118 to double
%120 = load double, double* %64
%121 = fadd double %120, %119
%122 = load double, double* %67
%123 = fsub double %121, %122
%124 = fdiv double %123, 1.000000e+09
%125 = fptrunc double %124 to float
%126 = fpext float %125 to double
%127 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %126)
%128 = load i32, i32* @CLOCK_MONOTONIC
%129 = call i32 @clock_gettime(i32 %128, %struct.timespec* %3)
%130 = call i32 @dgemm3(double* %14, double* %41, double* %51, i32 %7)
%131 = load i32, i32* @CLOCK_MONOTONIC
%132 = call i32 @clock_gettime(i32 %131, %struct.timespec* %4)
%133 = load i64, i64* %57
%134 = load i64, i64* %59
%135 = sub nsw i64 %133, %134
%136 = mul nsw i64 %135, 1000000000
%137 = sitofp i64 %136 to double
%138 = load double, double* %64
%139 = fadd double %138, %137
%140 = load double, double* %67
%141 = fsub double %139, %140
%142 = fdiv double %141, 1.000000e+09
%143 = fptrunc double %142 to float
%144 = fpext float %143 to double
%145 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %144)
%146 = call double @verification(double* %14, double* %41, double* %43, double* %45, i32 %7)
%147 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %146)
%148 = call double @verification(double* %14, double* %41, double* %43, double* %47, i32 %7)
%149 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %148)
%150 = call double @verification(double* %14, double* %41, double* %43, double* %49, i32 %7)
%151 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %150)
%152 = call double @verification(double* %14, double* %41, double* %43, double* %51, i32 %7)
%153 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %152)
ret i32 0
}