#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*/ 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;
  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);
  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);
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1245 <main+0x95>
mov    $0x0,%al
call   10d0 <rand@plt>
movsd  0xde2(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1205 <main+0x55>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    12a1 <main+0xf1>
mov    $0x0,%al
call   10d0 <rand@plt>
movsd  0xd86(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1261 <main+0xb1>
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x14(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    $0x8,%edi
call   1070 <calloc@plt>
mov    %rax,-0x70(%rbp)
mov    0x2d01(%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    -0x14(%rbp),%ecx
call   10b0 <dgemm0@plt>
mov    0x2cdb(%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  0xcb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcab(%rip),%rdi
call   1050 <printf@plt>
mov    0x2c77(%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    -0x14(%rbp),%ecx
call   1040 <dgemm1@plt>
mov    0x2c51(%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  0xc2e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc21(%rip),%rdi
call   1050 <printf@plt>
mov    0x2bed(%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    -0x14(%rbp),%ecx
call   10a0 <dgemm2@plt>
mov    0x2bc7(%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  0xba4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb97(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   1090 <verification@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xb68(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x70(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   1090 <verification@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xb3d(%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    $0x38,%rsp
mov    0x8(%rsi),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r13d
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    %r13d,%r12d
imul   %r13d,%r12d
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
test   %r12d,%r12d
je     1260 <main+0xb0>
mov    %r12d,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   10d0 <rand@plt>
divsd  0xdf1(%rip),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1200 <main+0x50>
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
test   %r12d,%r12d
je     1270 <main+0xc0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   10d0 <rand@plt>
divsd  0xdb1(%rip),%xmm0
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1240 <main+0x90>
jmp    1270 <main+0xc0>
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    %rax,0x30(%rsp)
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,0x20(%rsp)
mov    $0x8,%edi
mov    %r12d,%esi
call   1070 <calloc@plt>
mov    %rax,0x28(%rsp)
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
mov    %rax,%rbp
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r13d,%ecx
call   10b0 <dgemm0@plt>
mov    0x0(%rbp),%edi
lea    0x10(%rsp),%r12
mov    %r12,%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    (%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xcfe(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcf7(%rip),%rdi
mov    %r13d,%ebx
mov    %rdi,%r13
call   1050 <printf@plt>
mov    0x0(%rbp),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    0x20(%rsp),%rdx
mov    %ebx,%ecx
call   1040 <dgemm1@plt>
mov    0x0(%rbp),%edi
mov    %r12,%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    (%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xc90(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
call   1050 <printf@plt>
mov    0x0(%rbp),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    0x28(%rsp),%r12
mov    %r12,%rdx
mov    %ebx,%ecx
call   10a0 <dgemm2@plt>
mov    0x0(%rbp),%edi
lea    0x10(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x10(%rsp),%rax
sub    (%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x18(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xc27(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    0x30(%rsp),%rbp
mov    %rbp,%rdx
mov    0x20(%rsp),%rcx
mov    %ebx,%r8d
call   1090 <verification@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %ebx,%r8d
call   1090 <verification@plt>
lea    0xbe5(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x38,%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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %6
%22 = call i32 @time(i32* null)
%23 = call i32 @srand(i32 %22)
%24 = load i32, i32* %6
%25 = load i32, i32* %6
%26 = mul nsw i32 %24, %25
%27 = call i64 @calloc(i32 8, i32 %26)
%28 = inttoptr i64 %27 to double*
store double* %28, double** %11
store i32 0, i32* %17
br label %29
29: ; preds = %42, %2
%30 = load i32, i32* %17
%31 = load i32, i32* %6
%32 = load i32, i32* %6
%33 = mul nsw i32 %31, %32
%34 = icmp slt i32 %30, %33
br i1 %34, label %35, label %45
35: ; preds = %29
%36 = call double (...) @rand()
%37 = fdiv double %36, 1.000000e+06
%38 = load double*, double** %11
%39 = load i32, i32* %17
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double %37, double* %41
br label %42
42: ; preds = %35
%43 = load i32, i32* %17
%44 = add nsw i32 %43, 1
store i32 %44, i32* %17
br label %29
45: ; preds = %29
%46 = load i32, i32* %6
%47 = load i32, i32* %6
%48 = mul nsw i32 %46, %47
%49 = call i64 @calloc(i32 8, i32 %48)
%50 = inttoptr i64 %49 to double*
store double* %50, double** %12
store i32 0, i32* %17
br label %51
51: ; preds = %64, %45
%52 = load i32, i32* %17
%53 = load i32, i32* %6
%54 = load i32, i32* %6
%55 = mul nsw i32 %53, %54
%56 = icmp slt i32 %52, %55
br i1 %56, label %57, label %67
57: ; preds = %51
%58 = call double (...) @rand()
%59 = fdiv double %58, 1.000000e+06
%60 = load double*, double** %12
%61 = load i32, i32* %17
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
store double %59, double* %63
br label %64
64: ; preds = %57
%65 = load i32, i32* %17
%66 = add nsw i32 %65, 1
store i32 %66, i32* %17
br label %51
67: ; preds = %51
%68 = load i32, i32* %6
%69 = load i32, i32* %6
%70 = mul nsw i32 %68, %69
%71 = call i64 @calloc(i32 8, i32 %70)
%72 = inttoptr i64 %71 to double*
store double* %72, double** %13
%73 = load i32, i32* %6
%74 = load i32, i32* %6
%75 = mul nsw i32 %73, %74
%76 = call i64 @calloc(i32 8, i32 %75)
%77 = inttoptr i64 %76 to double*
store double* %77, double** %14
%78 = load i32, i32* %6
%79 = load i32, i32* %6
%80 = mul nsw i32 %78, %79
%81 = call i64 @calloc(i32 8, i32 %80)
%82 = inttoptr i64 %81 to double*
store double* %82, double** %15
%83 = load i32, i32* @CLOCK_MONOTONIC
%84 = call i32 @clock_gettime(i32 %83, %struct.timespec* %9)
%85 = load double*, double** %11
%86 = load double*, double** %12
%87 = load double*, double** %13
%88 = load i32, i32* %6
%89 = call i32 @dgemm0(double* %85, double* %86, double* %87, i32 %88)
%90 = load i32, i32* @CLOCK_MONOTONIC
%91 = call i32 @clock_gettime(i32 %90, %struct.timespec* %10)
%92 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%93 = load i64, i64* %92
%94 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%95 = load i64, i64* %94
%96 = sub nsw i64 %93, %95
%97 = mul nsw i64 1000000000, %96
%98 = sitofp i64 %97 to double
%99 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%100 = load double, double* %99
%101 = fadd double %98, %100
%102 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%103 = load double, double* %102
%104 = fsub double %101, %103
store double %104, double* %7
%105 = load double, double* %7
%106 = fdiv double %105, 1.000000e+09
%107 = fptrunc double %106 to float
store float %107, float* %8
%108 = load float, float* %8
%109 = fpext float %108 to double
%110 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %109)
%111 = load i32, i32* @CLOCK_MONOTONIC
%112 = call i32 @clock_gettime(i32 %111, %struct.timespec* %9)
%113 = load double*, double** %11
%114 = load double*, double** %12
%115 = load double*, double** %14
%116 = load i32, i32* %6
%117 = call i32 @dgemm1(double* %113, double* %114, double* %115, i32 %116)
%118 = load i32, i32* @CLOCK_MONOTONIC
%119 = call i32 @clock_gettime(i32 %118, %struct.timespec* %10)
%120 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%121 = load i64, i64* %120
%122 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%123 = load i64, i64* %122
%124 = sub nsw i64 %121, %123
%125 = mul nsw i64 1000000000, %124
%126 = sitofp i64 %125 to double
%127 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%128 = load double, double* %127
%129 = fadd double %126, %128
%130 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%131 = load double, double* %130
%132 = fsub double %129, %131
store double %132, double* %7
%133 = load double, double* %7
%134 = fdiv double %133, 1.000000e+09
%135 = fptrunc double %134 to float
store float %135, float* %8
%136 = load float, float* %8
%137 = fpext float %136 to double
%138 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %137)
%139 = load i32, i32* @CLOCK_MONOTONIC
%140 = call i32 @clock_gettime(i32 %139, %struct.timespec* %9)
%141 = load double*, double** %11
%142 = load double*, double** %12
%143 = load double*, double** %15
%144 = load i32, i32* %6
%145 = call i32 @dgemm2(double* %141, double* %142, double* %143, i32 %144)
%146 = load i32, i32* @CLOCK_MONOTONIC
%147 = call i32 @clock_gettime(i32 %146, %struct.timespec* %10)
%148 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%149 = load i64, i64* %148
%150 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%151 = load i64, i64* %150
%152 = sub nsw i64 %149, %151
%153 = mul nsw i64 1000000000, %152
%154 = sitofp i64 %153 to double
%155 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%156 = load double, double* %155
%157 = fadd double %154, %156
%158 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%159 = load double, double* %158
%160 = fsub double %157, %159
store double %160, double* %7
%161 = load double, double* %7
%162 = fdiv double %161, 1.000000e+09
%163 = fptrunc double %162 to float
store float %163, float* %8
%164 = load float, float* %8
%165 = fpext float %164 to double
%166 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %165)
%167 = load double*, double** %11
%168 = load double*, double** %12
%169 = load double*, double** %13
%170 = load double*, double** %14
%171 = load i32, i32* %6
%172 = call double @verification(double* %167, double* %168, double* %169, double* %170, i32 %171)
store double %172, double* %16
%173 = load double, double* %16
%174 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %173)
%175 = load double*, double** %11
%176 = load double*, double** %12
%177 = load double*, double** %13
%178 = load double*, double** %15
%179 = load i32, i32* %6
%180 = call double @verification(double* %175, double* %176, double* %177, double* %178, i32 %179)
store double %180, double* %16
%181 = load double, double* %16
%182 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %181)
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 = load i32, i32* @CLOCK_MONOTONIC
%49 = call i32 @clock_gettime(i32 %48, %struct.timespec* %3)
%50 = call i32 @dgemm0(double* %14, double* %41, double* %43, i32 %7)
%51 = load i32, i32* @CLOCK_MONOTONIC
%52 = call i32 @clock_gettime(i32 %51, %struct.timespec* %4)
%53 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%54 = load i64, i64* %53
%55 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%56 = load i64, i64* %55
%57 = sub nsw i64 %54, %56
%58 = mul nsw i64 %57, 1000000000
%59 = sitofp i64 %58 to double
%60 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%61 = load double, double* %60
%62 = fadd double %61, %59
%63 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%64 = load double, double* %63
%65 = fsub double %62, %64
%66 = fdiv double %65, 1.000000e+09
%67 = fptrunc double %66 to float
%68 = fpext float %67 to double
%69 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %68)
%70 = load i32, i32* @CLOCK_MONOTONIC
%71 = call i32 @clock_gettime(i32 %70, %struct.timespec* %3)
%72 = call i32 @dgemm1(double* %14, double* %41, double* %45, i32 %7)
%73 = load i32, i32* @CLOCK_MONOTONIC
%74 = call i32 @clock_gettime(i32 %73, %struct.timespec* %4)
%75 = load i64, i64* %53
%76 = load i64, i64* %55
%77 = sub nsw i64 %75, %76
%78 = mul nsw i64 %77, 1000000000
%79 = sitofp i64 %78 to double
%80 = load double, double* %60
%81 = fadd double %80, %79
%82 = load double, double* %63
%83 = fsub double %81, %82
%84 = fdiv double %83, 1.000000e+09
%85 = fptrunc double %84 to float
%86 = fpext float %85 to double
%87 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %86)
%88 = load i32, i32* @CLOCK_MONOTONIC
%89 = call i32 @clock_gettime(i32 %88, %struct.timespec* %3)
%90 = call i32 @dgemm2(double* %14, double* %41, double* %47, i32 %7)
%91 = load i32, i32* @CLOCK_MONOTONIC
%92 = call i32 @clock_gettime(i32 %91, %struct.timespec* %4)
%93 = load i64, i64* %53
%94 = load i64, i64* %55
%95 = sub nsw i64 %93, %94
%96 = mul nsw i64 %95, 1000000000
%97 = sitofp i64 %96 to double
%98 = load double, double* %60
%99 = fadd double %98, %97
%100 = load double, double* %63
%101 = fsub double %99, %100
%102 = fdiv double %101, 1.000000e+09
%103 = fptrunc double %102 to float
%104 = fpext float %103 to double
%105 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %104)
%106 = call double @verification(double* %14, double* %41, double* %43, double* %45, i32 %7)
%107 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %106)
%108 = call double @verification(double* %14, double* %41, double* %43, double* %47, i32 %7)
%109 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %108)
ret i32 0
}