#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);
int /*<<< orphan*/ dgemm2(double *, double *, double *, int, 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 BLOCK_SIZE = atoi(argv[1]);
  int n = atoi(argv[2]);
  uint64_t t0;
  float t;
  struct timespec begin, end;
  double *a, *b;
  double *c0, *c1, *c2;
  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;
    a[i] = 1;
  }
  b = (double *)calloc(sizeof(double), n * n);
  for (i = 0; i < n * n; i++) {
    b[i] = rand() / 1000000.0;
    b[i] = 1;
  }
  c0 = (double *)calloc(sizeof(double), n * n);
  c1 = (double *)calloc(sizeof(double), n * n);
  c2 = (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, BLOCK_SIZE);
  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, BLOCK_SIZE);
  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\n", diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    -0x18(%rbp),%esi
imul   -0x18(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    126a <main+0xba>
mov    $0x0,%al
call   10d0 <rand@plt>
movsd  0xdda(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  0xdb1(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1215 <main+0x65>
mov    -0x18(%rbp),%esi
imul   -0x18(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    12db <main+0x12b>
mov    $0x0,%al
call   10d0 <rand@plt>
movsd  0xd69(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  0xd40(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1286 <main+0xd6>
mov    -0x18(%rbp),%esi
imul   -0x18(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%esi
imul   -0x18(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%esi
imul   -0x18(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x70(%rbp)
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x18(%rbp),%ecx
call   10b0 <dgemm0@plt>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1030 <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  0xc7e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc79(%rip),%rdi
call   1050 <printf@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <dgemm1@plt>
mov    0x2c13(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1030 <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  0xbf0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbeb(%rip),%rdi
call   1050 <printf@plt>
mov    0x2baf(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   10a0 <dgemm2@plt>
mov    0x2b85(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1030 <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  0xb62(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb5d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x18(%rbp),%r8d
call   1090 <verification@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xb2e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x70(%rbp),%rcx
mov    -0x18(%rbp),%r8d
call   1090 <verification@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xb03(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%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    0x8(%rsi),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r14d
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    %r14d,%r13d
imul   %r14d,%r13d
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
test   %r13d,%r13d
mov    %ebp,0x34(%rsp)
je     126b <main+0xbb>
mov    %r14d,0x8(%rsp)
mov    %r13d,%ebp
movabs $0x3ff0000000000000,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10d0 <rand@plt>
mov    %r14,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1220 <main+0x70>
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,%r12
test   %r13d,%r13d
je     1264 <main+0xb4>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10d0 <rand@plt>
mov    %r14,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1250 <main+0xa0>
mov    0x8(%rsp),%r14d
jmp    127b <main+0xcb>
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,%r12
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,%rbp
mov    %rax,0x40(%rsp)
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,0x8(%rsp)
mov    $0x8,%edi
mov    %r13d,%esi
call   1070 <calloc@plt>
mov    %rax,0x38(%rsp)
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
mov    %rax,%rbx
lea    0x20(%rsp),%r13
mov    %r13,%rsi
call   1030 <clock_gettime@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
call   10b0 <dgemm0@plt>
mov    (%rbx),%edi
lea    0x10(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    0x20(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
divsd  0xce9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xce2(%rip),%rbp
mov    %rbp,%rdi
call   1050 <printf@plt>
mov    (%rbx),%edi
mov    %r13,%rsi
call   1030 <clock_gettime@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%rdx
mov    %r14d,%ecx
mov    0x34(%rsp),%r13d
mov    %r13d,%r8d
call   1040 <dgemm1@plt>
mov    (%rbx),%edi
lea    0x10(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    0x20(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
divsd  0xc74(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
call   1050 <printf@plt>
mov    (%rbx),%edi
lea    0x20(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    0x38(%rsp),%rbp
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    %r13d,%r8d
call   10a0 <dgemm2@plt>
mov    (%rbx),%edi
lea    0x10(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    0x20(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
divsd  0xc06(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbff(%rip),%r13
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    0x40(%rsp),%rbx
mov    %rbx,%rdx
mov    0x8(%rsp),%rcx
mov    %r14d,%r8d
call   1090 <verification@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14d,%r8d
call   1090 <verification@plt>
lea    0xbbd(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%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 i32
%8 = alloca double
%9 = alloca float
%10 = alloca %struct.timespec
%11 = alloca %struct.timespec
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %7
%27 = call i32 @time(i32* null)
%28 = call i32 @srand(i32 %27)
%29 = load i32, i32* %7
%30 = load i32, i32* %7
%31 = mul nsw i32 %29, %30
%32 = call i64 @calloc(i32 8, i32 %31)
%33 = inttoptr i64 %32 to double*
store double* %33, double** %12
store i32 0, i32* %18
br label %34
34: ; preds = %51, %2
%35 = load i32, i32* %18
%36 = load i32, i32* %7
%37 = load i32, i32* %7
%38 = mul nsw i32 %36, %37
%39 = icmp slt i32 %35, %38
br i1 %39, label %40, label %54
40: ; preds = %34
%41 = call double (...) @rand()
%42 = fdiv double %41, 1.000000e+06
%43 = load double*, double** %12
%44 = load i32, i32* %18
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
store double %42, double* %46
%47 = load double*, double** %12
%48 = load i32, i32* %18
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
store double 1.000000e+00, double* %50
br label %51
51: ; preds = %40
%52 = load i32, i32* %18
%53 = add nsw i32 %52, 1
store i32 %53, i32* %18
br label %34
54: ; preds = %34
%55 = load i32, i32* %7
%56 = load i32, i32* %7
%57 = mul nsw i32 %55, %56
%58 = call i64 @calloc(i32 8, i32 %57)
%59 = inttoptr i64 %58 to double*
store double* %59, double** %13
store i32 0, i32* %18
br label %60
60: ; preds = %77, %54
%61 = load i32, i32* %18
%62 = load i32, i32* %7
%63 = load i32, i32* %7
%64 = mul nsw i32 %62, %63
%65 = icmp slt i32 %61, %64
br i1 %65, label %66, label %80
66: ; preds = %60
%67 = call double (...) @rand()
%68 = fdiv double %67, 1.000000e+06
%69 = load double*, double** %13
%70 = load i32, i32* %18
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double %68, double* %72
%73 = load double*, double** %13
%74 = load i32, i32* %18
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
store double 1.000000e+00, double* %76
br label %77
77: ; preds = %66
%78 = load i32, i32* %18
%79 = add nsw i32 %78, 1
store i32 %79, i32* %18
br label %60
80: ; preds = %60
%81 = load i32, i32* %7
%82 = load i32, i32* %7
%83 = mul nsw i32 %81, %82
%84 = call i64 @calloc(i32 8, i32 %83)
%85 = inttoptr i64 %84 to double*
store double* %85, double** %14
%86 = load i32, i32* %7
%87 = load i32, i32* %7
%88 = mul nsw i32 %86, %87
%89 = call i64 @calloc(i32 8, i32 %88)
%90 = inttoptr i64 %89 to double*
store double* %90, double** %15
%91 = load i32, i32* %7
%92 = load i32, i32* %7
%93 = mul nsw i32 %91, %92
%94 = call i64 @calloc(i32 8, i32 %93)
%95 = inttoptr i64 %94 to double*
store double* %95, double** %16
%96 = load i32, i32* @CLOCK_MONOTONIC
%97 = call i32 @clock_gettime(i32 %96, %struct.timespec* %10)
%98 = load double*, double** %12
%99 = load double*, double** %13
%100 = load double*, double** %14
%101 = load i32, i32* %7
%102 = call i32 @dgemm0(double* %98, double* %99, double* %100, i32 %101)
%103 = load i32, i32* @CLOCK_MONOTONIC
%104 = call i32 @clock_gettime(i32 %103, %struct.timespec* %11)
%105 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 0
%106 = load i64, i64* %105
%107 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%108 = load i64, i64* %107
%109 = sub nsw i64 %106, %108
%110 = mul nsw i64 1000000000, %109
%111 = sitofp i64 %110 to double
%112 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 1
%113 = load double, double* %112
%114 = fadd double %111, %113
%115 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%116 = load double, double* %115
%117 = fsub double %114, %116
store double %117, double* %8
%118 = load double, double* %8
%119 = fdiv double %118, 1.000000e+09
%120 = fptrunc double %119 to float
store float %120, float* %9
%121 = load float, float* %9
%122 = fpext float %121 to double
%123 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %122)
%124 = load i32, i32* @CLOCK_MONOTONIC
%125 = call i32 @clock_gettime(i32 %124, %struct.timespec* %10)
%126 = load double*, double** %12
%127 = load double*, double** %13
%128 = load double*, double** %15
%129 = load i32, i32* %7
%130 = load i32, i32* %6
%131 = call i32 @dgemm1(double* %126, double* %127, double* %128, i32 %129, i32 %130)
%132 = load i32, i32* @CLOCK_MONOTONIC
%133 = call i32 @clock_gettime(i32 %132, %struct.timespec* %11)
%134 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 0
%135 = load i64, i64* %134
%136 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%137 = load i64, i64* %136
%138 = sub nsw i64 %135, %137
%139 = mul nsw i64 1000000000, %138
%140 = sitofp i64 %139 to double
%141 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 1
%142 = load double, double* %141
%143 = fadd double %140, %142
%144 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%145 = load double, double* %144
%146 = fsub double %143, %145
store double %146, double* %8
%147 = load double, double* %8
%148 = fdiv double %147, 1.000000e+09
%149 = fptrunc double %148 to float
store float %149, float* %9
%150 = load float, float* %9
%151 = fpext float %150 to double
%152 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %151)
%153 = load i32, i32* @CLOCK_MONOTONIC
%154 = call i32 @clock_gettime(i32 %153, %struct.timespec* %10)
%155 = load double*, double** %12
%156 = load double*, double** %13
%157 = load double*, double** %16
%158 = load i32, i32* %7
%159 = load i32, i32* %6
%160 = call i32 @dgemm2(double* %155, double* %156, double* %157, i32 %158, i32 %159)
%161 = load i32, i32* @CLOCK_MONOTONIC
%162 = call i32 @clock_gettime(i32 %161, %struct.timespec* %11)
%163 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 0
%164 = load i64, i64* %163
%165 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%166 = load i64, i64* %165
%167 = sub nsw i64 %164, %166
%168 = mul nsw i64 1000000000, %167
%169 = sitofp i64 %168 to double
%170 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 1
%171 = load double, double* %170
%172 = fadd double %169, %171
%173 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%174 = load double, double* %173
%175 = fsub double %172, %174
store double %175, double* %8
%176 = load double, double* %8
%177 = fdiv double %176, 1.000000e+09
%178 = fptrunc double %177 to float
store float %178, float* %9
%179 = load float, float* %9
%180 = fpext float %179 to double
%181 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %180)
%182 = load double*, double** %12
%183 = load double*, double** %13
%184 = load double*, double** %14
%185 = load double*, double** %15
%186 = load i32, i32* %7
%187 = call double @verification(double* %182, double* %183, double* %184, double* %185, i32 %186)
store double %187, double* %17
%188 = load double, double* %17
%189 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %188)
%190 = load double*, double** %12
%191 = load double*, double** %13
%192 = load double*, double** %14
%193 = load double*, double** %16
%194 = load i32, i32* %7
%195 = call double @verification(double* %190, double* %191, double* %192, double* %193, i32 %194)
store double %195, double* %17
%196 = load double, double* %17
%197 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %196)
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 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = bitcast %struct.timespec* %3 to i8*
%12 = bitcast %struct.timespec* %4 to i8*
%13 = tail call i32 @time(i32* null)
%14 = tail call i32 @srand(i32 %13)
%15 = mul nsw i32 %10, %10
%16 = tail call i64 @calloc(i32 8, i32 %15)
%17 = inttoptr i64 %16 to double*
%18 = icmp eq i32 %15, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = tail call i64 @calloc(i32 8, i32 %15)
%21 = inttoptr i64 %20 to double*
br label %41
22: ; preds = %2
%23 = zext i32 %15 to i64
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %28, %24 ]
%26 = tail call double (...) @rand()
%27 = getelementptr inbounds double, double* %17, i64 %25
store double 1.000000e+00, double* %27
%28 = add nuw nsw i64 %25, 1
%29 = icmp eq i64 %28, %23
br i1 %29, label %30, label %24
30: ; preds = %24
%31 = tail call i64 @calloc(i32 8, i32 %15)
%32 = inttoptr i64 %31 to double*
br i1 %18, label %41, label %33
33: ; preds = %30
%34 = zext i32 %15 to i64
br label %35
35: ; preds = %33, %35
%36 = phi i64 [ 0, %33 ], [ %39, %35 ]
%37 = tail call double (...) @rand()
%38 = getelementptr inbounds double, double* %32, i64 %36
store double 1.000000e+00, double* %38
%39 = add nuw nsw i64 %36, 1
%40 = icmp eq i64 %39, %34
br i1 %40, label %41, label %35
41: ; preds = %35, %19, %30
%42 = phi double* [ %21, %19 ], [ %32, %30 ], [ %32, %35 ]
%43 = tail call i64 @calloc(i32 8, i32 %15)
%44 = inttoptr i64 %43 to double*
%45 = tail call i64 @calloc(i32 8, i32 %15)
%46 = inttoptr i64 %45 to double*
%47 = tail call i64 @calloc(i32 8, i32 %15)
%48 = inttoptr i64 %47 to double*
%49 = load i32, i32* @CLOCK_MONOTONIC
%50 = call i32 @clock_gettime(i32 %49, %struct.timespec* %3)
%51 = call i32 @dgemm0(double* %17, double* %42, double* %44, i32 %10)
%52 = load i32, i32* @CLOCK_MONOTONIC
%53 = call i32 @clock_gettime(i32 %52, %struct.timespec* %4)
%54 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%55 = load i64, i64* %54
%56 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%57 = load i64, i64* %56
%58 = sub nsw i64 %55, %57
%59 = mul nsw i64 %58, 1000000000
%60 = sitofp i64 %59 to double
%61 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%62 = load double, double* %61
%63 = fadd double %62, %60
%64 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%65 = load double, double* %64
%66 = fsub double %63, %65
%67 = fdiv double %66, 1.000000e+09
%68 = fptrunc double %67 to float
%69 = fpext float %68 to double
%70 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %69)
%71 = load i32, i32* @CLOCK_MONOTONIC
%72 = call i32 @clock_gettime(i32 %71, %struct.timespec* %3)
%73 = call i32 @dgemm1(double* %17, double* %42, double* %46, i32 %10, i32 %7)
%74 = load i32, i32* @CLOCK_MONOTONIC
%75 = call i32 @clock_gettime(i32 %74, %struct.timespec* %4)
%76 = load i64, i64* %54
%77 = load i64, i64* %56
%78 = sub nsw i64 %76, %77
%79 = mul nsw i64 %78, 1000000000
%80 = sitofp i64 %79 to double
%81 = load double, double* %61
%82 = fadd double %81, %80
%83 = load double, double* %64
%84 = fsub double %82, %83
%85 = fdiv double %84, 1.000000e+09
%86 = fptrunc double %85 to float
%87 = fpext float %86 to double
%88 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %87)
%89 = load i32, i32* @CLOCK_MONOTONIC
%90 = call i32 @clock_gettime(i32 %89, %struct.timespec* %3)
%91 = call i32 @dgemm2(double* %17, double* %42, double* %48, i32 %10, i32 %7)
%92 = load i32, i32* @CLOCK_MONOTONIC
%93 = call i32 @clock_gettime(i32 %92, %struct.timespec* %4)
%94 = load i64, i64* %54
%95 = load i64, i64* %56
%96 = sub nsw i64 %94, %95
%97 = mul nsw i64 %96, 1000000000
%98 = sitofp i64 %97 to double
%99 = load double, double* %61
%100 = fadd double %99, %98
%101 = load double, double* %64
%102 = fsub double %100, %101
%103 = fdiv double %102, 1.000000e+09
%104 = fptrunc double %103 to float
%105 = fpext float %104 to double
%106 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %105)
%107 = call double @verification(double* %17, double* %42, double* %44, double* %46, i32 %10)
%108 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %107)
%109 = call double @verification(double* %17, double* %42, double* %44, double* %48, i32 %10)
%110 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %109)
ret i32 0
}