#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 scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ RAND_MAX;
int atoi(char *);
scalar_t__ clock();
void *malloc(int);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, double);
double rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  double **A, **B, **C;
  int i, j, k;
  int dim;
  clock_t start, finish;
  double maxr;
  dim = atoi(argv[1]);
  A = malloc(sizeof(double *) * dim);
  B = malloc(sizeof(double *) * dim);
  C = malloc(sizeof(double *) * dim);
  for (i = 0; i < dim; i++) {
    A[i] = malloc(sizeof(double) * dim);
    B[i] = malloc(sizeof(double) * dim);
    C[i] = malloc(sizeof(double) * dim);
  }
  srand(time(NULL));
  maxr = (double)RAND_MAX;
  for (i = 0; i < dim; i++) {
    for (j = 0; j < dim; j++) {
      A[i][j] = rand() / maxr;
      B[i][j] = rand() / maxr;
    }
  }
  start = clock();
  for (i = 0; i < dim; i++) {
    for (j = 0; j < dim; j++)
      C[i][j] = 0.;
    for (k = 0; k < dim; k++)
      for (j = 0; j < dim; j++)
        C[i][j] += A[i][k] * B[k][j];
  }
  finish = clock();
  printf("time for C(%d,%d) = A(%d,%d) B(%d,%d) is %lf s\n", dim, dim, dim, dim,
         dim, dim, (double)(finish - start) / CLOCKS_PER_SEC);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x38(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    124a <main+0xda>
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11d6 <main+0x66>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x2d7f(%rip),%rax
cvtsi2sdq (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12f4 <main+0x184>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12e1 <main+0x171>
mov    $0x0,%al
call   1090 <rand@plt>
divsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    $0x0,%al
call   1090 <rand@plt>
divsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1285 <main+0x115>
jmp    12e6 <main+0x176>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1272 <main+0x102>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13f1 <main+0x281>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    134b <main+0x1db>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1319 <main+0x1a9>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13de <main+0x26e>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13cb <main+0x25b>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1365 <main+0x1f5>
jmp    13d0 <main+0x260>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1352 <main+0x1e2>
jmp    13e3 <main+0x273>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1306 <main+0x196>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x38(%rbp),%r9d
mov    -0x38(%rbp),%eax
mov    -0x48(%rbp),%rdi
sub    -0x40(%rbp),%rdi
cvtsi2sd %rdi,%xmm0
mov    0x2bc4(%rip),%rdi
divsd  (%rdi),%xmm0
lea    0xbd1(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%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    0x8(%rsi),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
lea    0x0(,%rbp,8),%r14d
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%r12d
mov    %rbp,0x8(%rsp)
test   %ebp,%ebp
jle    11fe <main+0x7e>
xor    %ebp,%ebp
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%r13,%rbp,8)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,(%r15,%rbp,8)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11d0 <main+0x50>
mov    %rbx,0x18(%rsp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
cmpl   $0x0,0x8(%rsp)
jle    1471 <main+0x2f1>
mov    0x2dbd(%rip),%rax
cvtsi2sdq (%rax),%xmm1
xor    %ebp,%ebp
movsd  %xmm1,0x10(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   10a0 <rand@plt>
divsd  0x10(%rsp),%xmm0
mov    0x0(%r13,%rbp,8),%rax
movsd  %xmm0,(%rax,%rbx,8)
xor    %eax,%eax
call   10a0 <rand@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
mov    (%r15,%rbp,8),%rax
movsd  %xmm0,(%rax,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1240 <main+0xc0>
add    $0x1,%rbp
cmp    %r12,%rbp
jne    1230 <main+0xb0>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
cmpl   $0x0,0x8(%rsp)
jle    1482 <main+0x302>
mov    %rbx,0x20(%rsp)
mov    %r13,0x38(%rsp)
lea    0x0(,%r12,8),%rax
mov    %rax,0x30(%rsp)
lea    0x0(,%r12,8),%r14
mov    %r12d,%r11d
and    $0xfffffffc,%r11d
mov    %r12,%rax
neg    %rax
mov    %rax,0x10(%rsp)
mov    %r14,%rax
mov    %r14,0x28(%rsp)
and    $0xffffffffffffffe0,%r14
xor    %ecx,%ecx
mov    0x18(%rsp),%rax
jmp    12f7 <main+0x177>
xchg   %ax,%ax
mov    0x40(%rsp),%rcx
add    $0x1,%rcx
cmp    %r12,%rcx
mov    0x18(%rsp),%rax
je     147d <main+0x2fd>
mov    (%rax,%rcx,8),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    0x30(%rsp),%rdx
mov    %r11,%rbx
mov    %rcx,%rbp
call   1050 <memset@plt>
mov    %rbx,%r11
mov    0x38(%rsp),%rax
mov    %rbp,0x40(%rsp)
mov    (%rax,%rbp,8),%rax
mov    0x28(%rsp),%rcx
lea    (%rcx,%r13,1),%r8
xor    %edx,%edx
mov    0x8(%rsp),%r10
jmp    1349 <main+0x1c9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rdx
cmp    %r12,%rdx
je     12e0 <main+0x160>
mov    (%r15,%rdx,8),%rsi
cmp    $0x4,%r10d
jae    13d0 <main+0x250>
xor    %ebp,%ebp
mov    %rbp,%rdi
test   $0x1,%r12b
je     137d <main+0x1fd>
movsd  (%rax,%rdx,8),%xmm0
mulsd  (%rsi,%rbp,8),%xmm0
addsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x0(%r13,%rbp,8)
mov    %rbp,%rdi
or     $0x1,%rdi
not    %rbp
cmp    0x10(%rsp),%rbp
je     1340 <main+0x1c0>
nopw   0x0(%rax,%rax,1)
movsd  (%rax,%rdx,8),%xmm0
mulsd  (%rsi,%rdi,8),%xmm0
addsd  0x0(%r13,%rdi,8),%xmm0
movsd  %xmm0,0x0(%r13,%rdi,8)
movsd  (%rax,%rdx,8),%xmm0
mulsd  0x8(%rsi,%rdi,8),%xmm0
addsd  0x8(%r13,%rdi,8),%xmm0
movsd  %xmm0,0x8(%r13,%rdi,8)
add    $0x2,%rdi
cmp    %rdi,%r12
jne    1390 <main+0x210>
jmp    1340 <main+0x1c0>
nop
lea    (%rax,%rdx,8),%rcx
add    $0x8,%rcx
lea    (%rax,%rdx,8),%rdi
lea    (%rsi,%r12,8),%rbp
cmp    %rcx,%r13
setb   %r9b
cmp    %rdi,%r8
seta   %cl
cmp    %rbp,%r13
setb   %bl
cmp    %rsi,%r8
seta   %dil
test   %cl,%r9b
jne    1353 <main+0x1d3>
mov    $0x0,%ebp
and    %dil,%bl
jne    1355 <main+0x1d5>
movsd  (%rax,%rdx,8),%xmm0
unpcklpd %xmm0,%xmm0
xor    %edi,%edi
nopl   0x0(%rax)
movupd (%rsi,%rdi,1),%xmm1
movupd 0x10(%rsi,%rdi,1),%xmm2
movupd 0x0(%r13,%rdi,1),%xmm3
movupd 0x10(%r13,%rdi,1),%xmm4
mulpd  %xmm0,%xmm1
addpd  %xmm3,%xmm1
mulpd  %xmm0,%xmm2
addpd  %xmm4,%xmm2
movupd %xmm1,0x0(%r13,%rdi,1)
movupd %xmm2,0x10(%r13,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r14
jne    1420 <main+0x2a0>
mov    %r11,%rbp
cmp    %r12,%r11
je     1340 <main+0x1c0>
jmp    1355 <main+0x1d5>
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
jmp    1482 <main+0x302>
mov    0x20(%rsp),%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2b4d(%rip),%rax
divsd  (%rax),%xmm0
mov    0x8(%rsp),%rcx
mov    %ecx,(%rsp)
lea    0xb52(%rip),%rdi
mov    %ecx,%esi
mov    %ecx,%edx
mov    %ecx,%r8d
mov    %ecx,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
@.str = [48 x i8] c"time for C(%d,%d) = A(%d,%d) B(%d,%d) is %lf s\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double**
%7 = alloca double**
%8 = alloca double**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %12
%20 = load i32, i32* %12
%21 = sext i32 %20 to i64
%22 = mul i64 8, %21
%23 = trunc i64 %22 to i32
%24 = call i8* @malloc(i32 %23)
%25 = bitcast i8* %24 to double**
store double** %25, double*** %6
%26 = load i32, i32* %12
%27 = sext i32 %26 to i64
%28 = mul i64 8, %27
%29 = trunc i64 %28 to i32
%30 = call i8* @malloc(i32 %29)
%31 = bitcast i8* %30 to double**
store double** %31, double*** %7
%32 = load i32, i32* %12
%33 = sext i32 %32 to i64
%34 = mul i64 8, %33
%35 = trunc i64 %34 to i32
%36 = call i8* @malloc(i32 %35)
%37 = bitcast i8* %36 to double**
store double** %37, double*** %8
store i32 0, i32* %9
br label %38
38: ; preds = %73, %2
%39 = load i32, i32* %9
%40 = load i32, i32* %12
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %76
42: ; preds = %38
%43 = load i32, i32* %12
%44 = sext i32 %43 to i64
%45 = mul i64 8, %44
%46 = trunc i64 %45 to i32
%47 = call i8* @malloc(i32 %46)
%48 = bitcast i8* %47 to double*
%49 = load double**, double*** %6
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double*, double** %49, i64 %51
store double* %48, double** %52
%53 = load i32, i32* %12
%54 = sext i32 %53 to i64
%55 = mul i64 8, %54
%56 = trunc i64 %55 to i32
%57 = call i8* @malloc(i32 %56)
%58 = bitcast i8* %57 to double*
%59 = load double**, double*** %7
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double*, double** %59, i64 %61
store double* %58, double** %62
%63 = load i32, i32* %12
%64 = sext i32 %63 to i64
%65 = mul i64 8, %64
%66 = trunc i64 %65 to i32
%67 = call i8* @malloc(i32 %66)
%68 = bitcast i8* %67 to double*
%69 = load double**, double*** %8
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double*, double** %69, i64 %71
store double* %68, double** %72
br label %73
73: ; preds = %42
%74 = load i32, i32* %9
%75 = add nsw i32 %74, 1
store i32 %75, i32* %9
br label %38
76: ; preds = %38
%77 = call i32 @time(i32* null)
%78 = call i32 @srand(i32 %77)
%79 = load i64, i64* @RAND_MAX
%80 = sitofp i64 %79 to double
store double %80, double* %15
store i32 0, i32* %9
br label %81
81: ; preds = %117, %76
%82 = load i32, i32* %9
%83 = load i32, i32* %12
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %120
85: ; preds = %81
store i32 0, i32* %10
br label %86
86: ; preds = %113, %85
%87 = load i32, i32* %10
%88 = load i32, i32* %12
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %116
90: ; preds = %86
%91 = call double (...) @rand()
%92 = load double, double* %15
%93 = fdiv double %91, %92
%94 = load double**, double*** %6
%95 = load i32, i32* %9
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double*, double** %94, i64 %96
%98 = load double*, double** %97
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
store double %93, double* %101
%102 = call double (...) @rand()
%103 = load double, double* %15
%104 = fdiv double %102, %103
%105 = load double**, double*** %7
%106 = load i32, i32* %9
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double*, double** %105, i64 %107
%109 = load double*, double** %108
%110 = load i32, i32* %10
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
store double %104, double* %112
br label %113
113: ; preds = %90
%114 = load i32, i32* %10
%115 = add nsw i32 %114, 1
store i32 %115, i32* %10
br label %86
116: ; preds = %86
br label %117
117: ; preds = %116
%118 = load i32, i32* %9
%119 = add nsw i32 %118, 1
store i32 %119, i32* %9
br label %81
120: ; preds = %81
%121 = call i64 (...) @clock()
store i64 %121, i64* %13
store i32 0, i32* %9
br label %122
122: ; preds = %190, %120
%123 = load i32, i32* %9
%124 = load i32, i32* %12
%125 = icmp slt i32 %123, %124
br i1 %125, label %126, label %193
126: ; preds = %122
store i32 0, i32* %10
br label %127
127: ; preds = %140, %126
%128 = load i32, i32* %10
%129 = load i32, i32* %12
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %143
131: ; preds = %127
%132 = load double**, double*** %8
%133 = load i32, i32* %9
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double*, double** %132, i64 %134
%136 = load double*, double** %135
%137 = load i32, i32* %10
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
store double 0.000000e+00, double* %139
br label %140
140: ; preds = %131
%141 = load i32, i32* %10
%142 = add nsw i32 %141, 1
store i32 %142, i32* %10
br label %127
143: ; preds = %127
store i32 0, i32* %11
br label %144
144: ; preds = %186, %143
%145 = load i32, i32* %11
%146 = load i32, i32* %12
%147 = icmp slt i32 %145, %146
br i1 %147, label %148, label %189
148: ; preds = %144
store i32 0, i32* %10
br label %149
149: ; preds = %182, %148
%150 = load i32, i32* %10
%151 = load i32, i32* %12
%152 = icmp slt i32 %150, %151
br i1 %152, label %153, label %185
153: ; preds = %149
%154 = load double**, double*** %6
%155 = load i32, i32* %9
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double*, double** %154, i64 %156
%158 = load double*, double** %157
%159 = load i32, i32* %11
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double, double* %158, i64 %160
%162 = load double, double* %161
%163 = load double**, double*** %7
%164 = load i32, i32* %11
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double*, double** %163, i64 %165
%167 = load double*, double** %166
%168 = load i32, i32* %10
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = load double**, double*** %8
%173 = load i32, i32* %9
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double*, double** %172, i64 %174
%176 = load double*, double** %175
%177 = load i32, i32* %10
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %176, i64 %178
%180 = load double, double* %179
%181 = call double @llvm.fmuladd.f64(double %162, double %171, double %180)
store double %181, double* %179
br label %182
182: ; preds = %153
%183 = load i32, i32* %10
%184 = add nsw i32 %183, 1
store i32 %184, i32* %10
br label %149
185: ; preds = %149
br label %186
186: ; preds = %185
%187 = load i32, i32* %11
%188 = add nsw i32 %187, 1
store i32 %188, i32* %11
br label %144
189: ; preds = %144
br label %190
190: ; preds = %189
%191 = load i32, i32* %9
%192 = add nsw i32 %191, 1
store i32 %192, i32* %9
br label %122
193: ; preds = %122
%194 = call i64 (...) @clock()
store i64 %194, i64* %14
%195 = load i32, i32* %12
%196 = load i32, i32* %12
%197 = load i32, i32* %12
%198 = load i32, i32* %12
%199 = load i32, i32* %12
%200 = load i32, i32* %12
%201 = load i64, i64* %14
%202 = load i64, i64* %13
%203 = sub nsw i64 %201, %202
%204 = sitofp i64 %203 to double
%205 = load double, double* @CLOCKS_PER_SEC
%206 = fdiv double %204, %205
%207 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %195, i32 %196, i32 %197, i32 %198, i32 %199, i32 %200, double %206)
ret i32 0
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
@.str = [48 x i8] c"time for C(%d,%d) = A(%d,%d) B(%d,%d) is %lf s\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = shl i32 %5, 3
%7 = tail call i8* @malloc(i32 %6)
%8 = bitcast i8* %7 to double**
%9 = tail call i8* @malloc(i32 %6)
%10 = bitcast i8* %9 to double**
%11 = tail call i8* @malloc(i32 %6)
%12 = bitcast i8* %11 to double**
%13 = icmp sgt i32 %5, 0
br i1 %13, label %14, label %29
14: ; preds = %2
%15 = zext i32 %5 to i64
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 0, %14 ], [ %27, %16 ]
%18 = tail call i8* @malloc(i32 %6)
%19 = getelementptr inbounds double*, double** %8, i64 %17
%20 = bitcast double** %19 to i8**
store i8* %18, i8** %20
%21 = tail call i8* @malloc(i32 %6)
%22 = getelementptr inbounds double*, double** %10, i64 %17
%23 = bitcast double** %22 to i8**
store i8* %21, i8** %23
%24 = tail call i8* @malloc(i32 %6)
%25 = getelementptr inbounds double*, double** %12, i64 %17
%26 = bitcast double** %25 to i8**
store i8* %24, i8** %26
%27 = add nuw nsw i64 %17, 1
%28 = icmp eq i64 %27, %15
br i1 %28, label %29, label %16
29: ; preds = %16, %2
%30 = tail call i32 @time(i32* null)
%31 = tail call i32 @srand(i32 %30)
%32 = load i64, i64* @RAND_MAX
%33 = sitofp i64 %32 to double
br i1 %13, label %36, label %34
34: ; preds = %29
%35 = tail call i64 (...) @clock()
br label %163
36: ; preds = %29
%37 = zext i32 %5 to i64
br label %38
38: ; preds = %54, %36
%39 = phi i64 [ 0, %36 ], [ %55, %54 ]
%40 = getelementptr inbounds double*, double** %8, i64 %39
%41 = getelementptr inbounds double*, double** %10, i64 %39
br label %42
42: ; preds = %38, %42
%43 = phi i64 [ 0, %38 ], [ %52, %42 ]
%44 = tail call double (...) @rand()
%45 = fdiv double %44, %33
%46 = load double*, double** %40
%47 = getelementptr inbounds double, double* %46, i64 %43
store double %45, double* %47
%48 = tail call double (...) @rand()
%49 = fdiv double %48, %33
%50 = load double*, double** %41
%51 = getelementptr inbounds double, double* %50, i64 %43
store double %49, double* %51
%52 = add nuw nsw i64 %43, 1
%53 = icmp eq i64 %52, %37
br i1 %53, label %54, label %42
54: ; preds = %42
%55 = add nuw nsw i64 %39, 1
%56 = icmp eq i64 %55, %37
br i1 %56, label %57, label %38
57: ; preds = %54
%58 = tail call i64 (...) @clock()
br i1 %13, label %59, label %163
59: ; preds = %57
%60 = zext i32 %5 to i64
%61 = shl nuw nsw i64 %60, 3
%62 = shl nuw nsw i64 %37, 3
%63 = icmp ult i32 %5, 4
%64 = and i64 %37, 4294967292
%65 = icmp eq i64 %64, %37
%66 = and i64 %60, 1
%67 = icmp eq i64 %66, 0
%68 = sub nsw i64 0, %60
br label %69
69: ; preds = %160, %59
%70 = phi i64 [ 0, %59 ], [ %161, %160 ]
%71 = getelementptr inbounds double*, double** %12, i64 %70
%72 = bitcast double** %71 to i8**
%73 = load i8*, i8** %72
%74 = getelementptr inbounds double*, double** %8, i64 %70
%75 = load double*, double** %74
%76 = bitcast i8* %73 to double*
%77 = getelementptr i8, i8* %73, i64 %62
br label %78
78: ; preds = %157, %69
%79 = phi i64 [ 0, %69 ], [ %158, %157 ]
%80 = getelementptr inbounds double, double* %75, i64 %79
%81 = getelementptr inbounds double*, double** %10, i64 %79
%82 = load double*, double** %81
br i1 %63, label %126, label %83
83: ; preds = %78
%84 = bitcast double* %82 to i8*
%85 = add nuw i64 %79, 1
%86 = getelementptr double, double* %75, i64 %85
%87 = bitcast double* %86 to i8*
%88 = getelementptr double, double* %75, i64 %79
%89 = bitcast double* %88 to i8*
%90 = getelementptr double, double* %82, i64 %37
%91 = bitcast double* %90 to i8*
%92 = icmp ult i8* %73, %87
%93 = icmp ugt i8* %77, %89
%94 = and i1 %92, %93
%95 = icmp ult i8* %73, %91
%96 = icmp ugt i8* %77, %84
%97 = and i1 %95, %96
%98 = or i1 %94, %97
br i1 %98, label %126, label %99
99: ; preds = %83
%100 = load double, double* %80
%101 = insertelement <2 x double> poison, double %100, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = insertelement <2 x double> poison, double %100, i64 0
%104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> zeroinitializer
br label %105
105: ; preds = %105, %99
%106 = phi i64 [ 0, %99 ], [ %123, %105 ]
%107 = getelementptr inbounds double, double* %82, i64 %106
%108 = bitcast double* %107 to <2 x double>*
%109 = load <2 x double>, <2 x double>* %108
%110 = getelementptr inbounds double, double* %107, i64 2
%111 = bitcast double* %110 to <2 x double>*
%112 = load <2 x double>, <2 x double>* %111
%113 = getelementptr inbounds double, double* %76, i64 %106
%114 = bitcast double* %113 to <2 x double>*
%115 = load <2 x double>, <2 x double>* %114
%116 = getelementptr inbounds double, double* %113, i64 2
%117 = bitcast double* %116 to <2 x double>*
%118 = load <2 x double>, <2 x double>* %117
%119 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %102, <2 x double> %109, <2 x double> %115)
%120 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %104, <2 x double> %112, <2 x double> %118)
%121 = bitcast double* %113 to <2 x double>*
store <2 x double> %119, <2 x double>* %121
%122 = bitcast double* %116 to <2 x double>*
store <2 x double> %120, <2 x double>* %122
%123 = add nuw i64 %106, 4
%124 = icmp eq i64 %123, %64
br i1 %124, label %125, label %105
125: ; preds = %105
br i1 %65, label %157, label %126
126: ; preds = %83, %78, %125
%127 = phi i64 [ 0, %83 ], [ 0, %78 ], [ %64, %125 ]
%128 = xor i64 %127, -1
br i1 %67, label %137, label %129
129: ; preds = %126
%130 = load double, double* %80
%131 = getelementptr inbounds double, double* %82, i64 %127
%132 = load double, double* %131
%133 = getelementptr inbounds double, double* %76, i64 %127
%134 = load double, double* %133
%135 = tail call double @llvm.fmuladd.f64(double %130, double %132, double %134)
store double %135, double* %133
%136 = or i64 %127, 1
br label %137
137: ; preds = %129, %126
%138 = phi i64 [ %127, %126 ], [ %136, %129 ]
%139 = icmp eq i64 %128, %68
br i1 %139, label %157, label %140
140: ; preds = %137, %140
%141 = phi i64 [ %155, %140 ], [ %138, %137 ]
%142 = load double, double* %80
%143 = getelementptr inbounds double, double* %82, i64 %141
%144 = load double, double* %143
%145 = getelementptr inbounds double, double* %76, i64 %141
%146 = load double, double* %145
%147 = tail call double @llvm.fmuladd.f64(double %142, double %144, double %146)
store double %147, double* %145
%148 = add nuw nsw i64 %141, 1
%149 = load double, double* %80
%150 = getelementptr inbounds double, double* %82, i64 %148
%151 = load double, double* %150
%152 = getelementptr inbounds double, double* %76, i64 %148
%153 = load double, double* %152
%154 = tail call double @llvm.fmuladd.f64(double %149, double %151, double %153)
store double %154, double* %152
%155 = add nuw nsw i64 %141, 2
%156 = icmp eq i64 %155, %60
br i1 %156, label %157, label %140
157: ; preds = %137, %140, %125
%158 = add nuw nsw i64 %79, 1
%159 = icmp eq i64 %158, %60
br i1 %159, label %160, label %78
160: ; preds = %157
%161 = add nuw nsw i64 %70, 1
%162 = icmp eq i64 %161, %60
br i1 %162, label %163, label %69
163: ; preds = %160, %34, %57
%164 = phi i64 [ %35, %34 ], [ %58, %57 ], [ %58, %160 ]
%165 = tail call i64 (...) @clock()
%166 = sub nsw i64 %165, %164
%167 = sitofp i64 %166 to double
%168 = load double, double* @CLOCKS_PER_SEC
%169 = fdiv double %167, %168
%170 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5, i32 %5, i32 %5, i32 %5, i32 %5, double %169)
ret i32 0
}