#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 */

/* Variables and functions */
scalar_t__ assert(double *, double *, unsigned int);
double dvp(double *, double *, unsigned int);
scalar_t__ equal(double, double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double *mmp(double *, double *, unsigned int);
scalar_t__ mvp(double *, double *, unsigned int, unsigned int);
double odvp(double *, double *, unsigned int);
double *ommp(double *, double *, unsigned int);
double *omvp(double *, double *, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *);
void test() {
  unsigned int s = 3;
  double *a = (double *)malloc(sizeof(double) * s);
  double *b = (double *)malloc(sizeof(double) * s);
  register unsigned int i, j;
  for (i = 0; i < s; i++) {
    a[i] = i;
    b[i] = i * i;
  }
  double dc = dvp(a, b, s);
  if (equal(9, dc))
    printf("Vector - Vector dot product ok\n");
  double oc = odvp(a, b, s);
  if (equal(oc, dc))
    printf("OpenMp: Vector - Vector dot product ok\n");
  free(a);
  free(b);
  a = (double *)malloc(sizeof(double) * s);
  b = (double *)malloc(sizeof(double) * s * s);
  for (i = 0; i < s; i++) {
    a[i] = 1.0;
    for (j = 0; j < s; j++) {
      b[i + j * s] = 1.0;
    }
  }
  double *c = (double *)malloc(sizeof(double) * s);
  c = (double *)mvp(b, a, s, s);
  double *d = (double *)malloc(sizeof(double) * s);
  d[0] = 3.0;
  d[1] = 3.0;
  d[2] = 3.0;
  if (assert((void *)c, (void *)d, s))
    printf("Matrix - Vector product ok\n");
  double *cc = (double *)malloc(sizeof(double) * s);
  cc = omvp(b, a, s, s);
  if (assert(cc, d, s))
    printf("OpenMp: Matrix - Vector product ok\n");
  free(a);
  free(b);
  free(c);
  free(cc);
  free(d);
  a = (double *)malloc(sizeof(double) * s * s);
  b = (double *)malloc(sizeof(double) * s * s);
  d = (double *)malloc(sizeof(double) * s * s);
  d[0] = 30.0;
  d[3] = 66.0;
  d[6] = 102.0;
  d[1] = 36.0;
  d[4] = 81.0;
  d[7] = 126.0;
  d[2] = 42.0;
  d[5] = 96.0;
  d[8] = 150.0;
  for (i = 1; i < (s * s) + 1; i++) {
    a[i - 1] = i;
    b[i - 1] = i;
  }
  c = mmp(a, b, s);
  if (assert(c, d, s * s))
    printf("Matrix - Matrix product ok\n");
  cc = ommp(a, b, s);
  if (assert(cc, d, s * s))
    printf("OpenMp: Matrix - Matrix product ok\n");
  free(a);
  free(b);
  free(c);
  free(cc);
  free(d);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    122e <test+0x7e>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
cvtsi2sd %rcx,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
imul   %eax,%eax
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ea <test+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1060 <dvp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xdb0(%rip),%xmm0
call   10c0 <equal@plt>
cmp    $0x0,%rax
je     126b <test+0xbb>
lea    0xe02(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <odvp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   10c0 <equal@plt>
cmp    $0x0,%rax
je     12a5 <test+0xf5>
lea    0xdc0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    -0x4(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    135c <test+0x1ac>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsd  0xd54(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1349 <test+0x199>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%edx
imul   -0x4(%rbp),%edx
add    %edx,%ecx
mov    %ecx,%ecx
movsd  0xd22(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1310 <test+0x160>
jmp    134e <test+0x19e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12e9 <test+0x139>
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
call   10a0 <mvp@plt>
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsd  0xc65(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  0xc55(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x40(%rbp),%rax
movsd  0xc44(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1080 <assert@plt>
cmp    $0x0,%rax
je     13ef <test+0x23f>
lea    0xca6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
call   1070 <omvp@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1080 <assert@plt>
cmp    $0x0,%rax
je     143e <test+0x28e>
lea    0xc4f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    -0x4(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    -0x4(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    -0x4(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsd  0xb8e(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  0xb76(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x40(%rbp),%rax
movsd  0xb5d(%rip),%xmm0
movsd  %xmm0,0x30(%rax)
mov    -0x40(%rbp),%rax
movsd  0xb44(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x40(%rbp),%rax
movsd  0xb2b(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x40(%rbp),%rax
movsd  0xb12(%rip),%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x40(%rbp),%rax
movsd  0xaf9(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x40(%rbp),%rax
movsd  0xae0(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x40(%rbp),%rax
movsd  0xac7(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jae    15a7 <test+0x3f7>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rax
add    $0xffffffff,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1555 <test+0x3a5>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   10b0 <mmp@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
call   1080 <assert@plt>
cmp    $0x0,%rax
je     15e5 <test+0x435>
lea    0xad4(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   10d0 <ommp@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1623 <test+0x473>
lea    0xa8e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
movq   $0x0,(%r14)
movq   $0x0,(%rax)
movabs $0x3ff0000000000000,%rbp
mov    %rbp,0x8(%r14)
mov    %rbp,0x8(%rax)
movabs $0x4000000000000000,%rax
mov    %rax,0x10(%r14)
movabs $0x4010000000000000,%rax
mov    %rax,0x10(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1060 <dvp@plt>
movaps %xmm0,%xmm1
movsd  0xdd4(%rip),%xmm0
movsd  %xmm1,(%rsp)
call   10c0 <equal@plt>
test   %rax,%rax
je     1247 <test+0x97>
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1050 <odvp@plt>
movsd  (%rsp),%xmm1
call   10c0 <equal@plt>
test   %rax,%rax
je     1272 <test+0xc2>
lea    0xe39(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    $0x48,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,(%r14)
mov    %rbp,(%rax)
mov    %rbp,0x18(%rax)
mov    %rbp,0x30(%rax)
mov    %rbp,0x8(%r14)
mov    %rbp,0x8(%rax)
mov    %rbp,0x20(%rax)
mov    %rbp,0x38(%rax)
mov    %rbp,0x10(%r14)
mov    %rbp,0x10(%rax)
mov    %rbp,0x28(%rax)
mov    %rbp,0x40(%rax)
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x3,%ecx
call   10a0 <mvp@plt>
mov    %rax,%r12
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
movaps 0xd10(%rip),%xmm0
movups %xmm0,(%rax)
movabs $0x4008000000000000,%rax
mov    %rax,0x10(%r15)
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1080 <assert@plt>
test   %rax,%rax
je     1332 <test+0x182>
lea    0xd5e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x18,%edi
call   1090 <malloc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x3,%ecx
call   1070 <omvp@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1080 <assert@plt>
test   %rax,%rax
je     1375 <test+0x1c5>
lea    0xd13(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x48,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    $0x48,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    $0x48,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
movaps 0xc55(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xc5b(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xc60(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xc65(%rip),%xmm0
movups %xmm0,0x20(%rax)
movabs $0x4062c00000000000,%rax
c0 62 40
mov    %rax,0x40(%r14)
mov    %rbp,(%r15)
mov    %rbp,(%rbx)
movabs $0x4000000000000000,%rax
mov    %rax,0x8(%r15)
mov    %rax,0x8(%rbx)
movabs $0x4008000000000000,%rax
mov    %rax,0x10(%r15)
mov    %rax,0x10(%rbx)
movabs $0x4010000000000000,%rax
mov    %rax,0x18(%r15)
mov    %rax,0x18(%rbx)
movabs $0x4014000000000000,%rax
mov    %rax,0x20(%r15)
mov    %rax,0x20(%rbx)
movabs $0x4018000000000000,%rax
mov    %rax,0x28(%r15)
mov    %rax,0x28(%rbx)
movabs $0x401c000000000000,%rax
mov    %rax,0x30(%r15)
mov    %rax,0x30(%rbx)
movabs $0x4020000000000000,%rax
mov    %rax,0x38(%r15)
mov    %rax,0x38(%rbx)
movabs $0x4022000000000000,%rax
mov    %rax,0x40(%r15)
mov    %rax,0x40(%rbx)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   10b0 <mmp@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1080 <assert@plt>
test   %rax,%rax
je     14c7 <test+0x317>
lea    0xba6(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   10d0 <ommp@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1080 <assert@plt>
test   %rax,%rax
je     14fb <test+0x34b>
lea    0xb6a(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Vector - Vector dot product ok\0A\00"
@.str.1 = [40 x i8] c"OpenMp: Vector - Vector dot product ok\0A\00"
@.str.2 = [28 x i8] c"Matrix - Vector product ok\0A\00"
@.str.3 = [36 x i8] c"OpenMp: Matrix - Vector product ok\0A\00"
@.str.4 = [28 x i8] c"Matrix - Matrix product ok\0A\00"
@.str.5 = [36 x i8] c"OpenMp: Matrix - Matrix product ok\0A\00"
define void @test() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store i32 3, i32* %1
%11 = load i32, i32* %1
%12 = zext i32 %11 to i64
%13 = mul i64 8, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to double*
store double* %16, double** %2
%17 = load i32, i32* %1
%18 = zext i32 %17 to i64
%19 = mul i64 8, %18
%20 = trunc i64 %19 to i32
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to double*
store double* %22, double** %3
store i32 0, i32* %4
br label %23
23: ; preds = %42, %0
%24 = load i32, i32* %4
%25 = load i32, i32* %1
%26 = icmp ult i32 %24, %25
br i1 %26, label %27, label %45
27: ; preds = %23
%28 = load i32, i32* %4
%29 = uitofp i32 %28 to double
%30 = load double*, double** %2
%31 = load i32, i32* %4
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
store double %29, double* %33
%34 = load i32, i32* %4
%35 = load i32, i32* %4
%36 = mul i32 %34, %35
%37 = uitofp i32 %36 to double
%38 = load double*, double** %3
%39 = load i32, i32* %4
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double %37, double* %41
br label %42
42: ; preds = %27
%43 = load i32, i32* %4
%44 = add i32 %43, 1
store i32 %44, i32* %4
br label %23
45: ; preds = %23
%46 = load double*, double** %2
%47 = load double*, double** %3
%48 = load i32, i32* %1
%49 = call double @dvp(double* %46, double* %47, i32 %48)
store double %49, double* %6
%50 = load double, double* %6
%51 = call i64 @equal(double 9.000000e+00, double %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %45
%54 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %55
55: ; preds = %53, %45
%56 = load double*, double** %2
%57 = load double*, double** %3
%58 = load i32, i32* %1
%59 = call double @odvp(double* %56, double* %57, i32 %58)
store double %59, double* %7
%60 = load double, double* %7
%61 = load double, double* %6
%62 = call i64 @equal(double %60, double %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %55
%65 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %66
66: ; preds = %64, %55
%67 = load double*, double** %2
%68 = call i32 @free(double* %67)
%69 = load double*, double** %3
%70 = call i32 @free(double* %69)
%71 = load i32, i32* %1
%72 = zext i32 %71 to i64
%73 = mul i64 8, %72
%74 = trunc i64 %73 to i32
%75 = call i64 @malloc(i32 %74)
%76 = inttoptr i64 %75 to double*
store double* %76, double** %2
%77 = load i32, i32* %1
%78 = zext i32 %77 to i64
%79 = mul i64 8, %78
%80 = load i32, i32* %1
%81 = zext i32 %80 to i64
%82 = mul i64 %79, %81
%83 = trunc i64 %82 to i32
%84 = call i64 @malloc(i32 %83)
%85 = inttoptr i64 %84 to double*
store double* %85, double** %3
store i32 0, i32* %4
br label %86
86: ; preds = %112, %66
%87 = load i32, i32* %4
%88 = load i32, i32* %1
%89 = icmp ult i32 %87, %88
br i1 %89, label %90, label %115
90: ; preds = %86
%91 = load double*, double** %2
%92 = load i32, i32* %4
%93 = zext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
store double 1.000000e+00, double* %94
store i32 0, i32* %5
br label %95
95: ; preds = %108, %90
%96 = load i32, i32* %5
%97 = load i32, i32* %1
%98 = icmp ult i32 %96, %97
br i1 %98, label %99, label %111
99: ; preds = %95
%100 = load double*, double** %3
%101 = load i32, i32* %4
%102 = load i32, i32* %5
%103 = load i32, i32* %1
%104 = mul i32 %102, %103
%105 = add i32 %101, %104
%106 = zext i32 %105 to i64
%107 = getelementptr inbounds double, double* %100, i64 %106
store double 1.000000e+00, double* %107
br label %108
108: ; preds = %99
%109 = load i32, i32* %5
%110 = add i32 %109, 1
store i32 %110, i32* %5
br label %95
111: ; preds = %95
br label %112
112: ; preds = %111
%113 = load i32, i32* %4
%114 = add i32 %113, 1
store i32 %114, i32* %4
br label %86
115: ; preds = %86
%116 = load i32, i32* %1
%117 = zext i32 %116 to i64
%118 = mul i64 8, %117
%119 = trunc i64 %118 to i32
%120 = call i64 @malloc(i32 %119)
%121 = inttoptr i64 %120 to double*
store double* %121, double** %8
%122 = load double*, double** %3
%123 = load double*, double** %2
%124 = load i32, i32* %1
%125 = load i32, i32* %1
%126 = call i64 @mvp(double* %122, double* %123, i32 %124, i32 %125)
%127 = inttoptr i64 %126 to double*
store double* %127, double** %8
%128 = load i32, i32* %1
%129 = zext i32 %128 to i64
%130 = mul i64 8, %129
%131 = trunc i64 %130 to i32
%132 = call i64 @malloc(i32 %131)
%133 = inttoptr i64 %132 to double*
store double* %133, double** %9
%134 = load double*, double** %9
%135 = getelementptr inbounds double, double* %134, i64 0
store double 3.000000e+00, double* %135
%136 = load double*, double** %9
%137 = getelementptr inbounds double, double* %136, i64 1
store double 3.000000e+00, double* %137
%138 = load double*, double** %9
%139 = getelementptr inbounds double, double* %138, i64 2
store double 3.000000e+00, double* %139
%140 = load double*, double** %8
%141 = bitcast double* %140 to i8*
%142 = bitcast i8* %141 to double*
%143 = load double*, double** %9
%144 = bitcast double* %143 to i8*
%145 = bitcast i8* %144 to double*
%146 = load i32, i32* %1
%147 = call i64 @assert(double* %142, double* %145, i32 %146)
%148 = icmp ne i64 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %115
%150 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %151
151: ; preds = %149, %115
%152 = load i32, i32* %1
%153 = zext i32 %152 to i64
%154 = mul i64 8, %153
%155 = trunc i64 %154 to i32
%156 = call i64 @malloc(i32 %155)
%157 = inttoptr i64 %156 to double*
store double* %157, double** %10
%158 = load double*, double** %3
%159 = load double*, double** %2
%160 = load i32, i32* %1
%161 = load i32, i32* %1
%162 = call double* @omvp(double* %158, double* %159, i32 %160, i32 %161)
store double* %162, double** %10
%163 = load double*, double** %10
%164 = load double*, double** %9
%165 = load i32, i32* %1
%166 = call i64 @assert(double* %163, double* %164, i32 %165)
%167 = icmp ne i64 %166, 0
br i1 %167, label %168, label %170
168: ; preds = %151
%169 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %170
170: ; preds = %168, %151
%171 = load double*, double** %2
%172 = call i32 @free(double* %171)
%173 = load double*, double** %3
%174 = call i32 @free(double* %173)
%175 = load double*, double** %8
%176 = call i32 @free(double* %175)
%177 = load double*, double** %10
%178 = call i32 @free(double* %177)
%179 = load double*, double** %9
%180 = call i32 @free(double* %179)
%181 = load i32, i32* %1
%182 = zext i32 %181 to i64
%183 = mul i64 8, %182
%184 = load i32, i32* %1
%185 = zext i32 %184 to i64
%186 = mul i64 %183, %185
%187 = trunc i64 %186 to i32
%188 = call i64 @malloc(i32 %187)
%189 = inttoptr i64 %188 to double*
store double* %189, double** %2
%190 = load i32, i32* %1
%191 = zext i32 %190 to i64
%192 = mul i64 8, %191
%193 = load i32, i32* %1
%194 = zext i32 %193 to i64
%195 = mul i64 %192, %194
%196 = trunc i64 %195 to i32
%197 = call i64 @malloc(i32 %196)
%198 = inttoptr i64 %197 to double*
store double* %198, double** %3
%199 = load i32, i32* %1
%200 = zext i32 %199 to i64
%201 = mul i64 8, %200
%202 = load i32, i32* %1
%203 = zext i32 %202 to i64
%204 = mul i64 %201, %203
%205 = trunc i64 %204 to i32
%206 = call i64 @malloc(i32 %205)
%207 = inttoptr i64 %206 to double*
store double* %207, double** %9
%208 = load double*, double** %9
%209 = getelementptr inbounds double, double* %208, i64 0
store double 3.000000e+01, double* %209
%210 = load double*, double** %9
%211 = getelementptr inbounds double, double* %210, i64 3
store double 6.600000e+01, double* %211
%212 = load double*, double** %9
%213 = getelementptr inbounds double, double* %212, i64 6
store double 1.020000e+02, double* %213
%214 = load double*, double** %9
%215 = getelementptr inbounds double, double* %214, i64 1
store double 3.600000e+01, double* %215
%216 = load double*, double** %9
%217 = getelementptr inbounds double, double* %216, i64 4
store double 8.100000e+01, double* %217
%218 = load double*, double** %9
%219 = getelementptr inbounds double, double* %218, i64 7
store double 1.260000e+02, double* %219
%220 = load double*, double** %9
%221 = getelementptr inbounds double, double* %220, i64 2
store double 4.200000e+01, double* %221
%222 = load double*, double** %9
%223 = getelementptr inbounds double, double* %222, i64 5
store double 9.600000e+01, double* %223
%224 = load double*, double** %9
%225 = getelementptr inbounds double, double* %224, i64 8
store double 1.500000e+02, double* %225
store i32 1, i32* %4
br label %226
226: ; preds = %248, %170
%227 = load i32, i32* %4
%228 = load i32, i32* %1
%229 = load i32, i32* %1
%230 = mul i32 %228, %229
%231 = add i32 %230, 1
%232 = icmp ult i32 %227, %231
br i1 %232, label %233, label %251
233: ; preds = %226
%234 = load i32, i32* %4
%235 = uitofp i32 %234 to double
%236 = load double*, double** %2
%237 = load i32, i32* %4
%238 = sub i32 %237, 1
%239 = zext i32 %238 to i64
%240 = getelementptr inbounds double, double* %236, i64 %239
store double %235, double* %240
%241 = load i32, i32* %4
%242 = uitofp i32 %241 to double
%243 = load double*, double** %3
%244 = load i32, i32* %4
%245 = sub i32 %244, 1
%246 = zext i32 %245 to i64
%247 = getelementptr inbounds double, double* %243, i64 %246
store double %242, double* %247
br label %248
248: ; preds = %233
%249 = load i32, i32* %4
%250 = add i32 %249, 1
store i32 %250, i32* %4
br label %226
251: ; preds = %226
%252 = load double*, double** %2
%253 = load double*, double** %3
%254 = load i32, i32* %1
%255 = call double* @mmp(double* %252, double* %253, i32 %254)
store double* %255, double** %8
%256 = load double*, double** %8
%257 = load double*, double** %9
%258 = load i32, i32* %1
%259 = load i32, i32* %1
%260 = mul i32 %258, %259
%261 = call i64 @assert(double* %256, double* %257, i32 %260)
%262 = icmp ne i64 %261, 0
br i1 %262, label %263, label %265
263: ; preds = %251
%264 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %265
265: ; preds = %263, %251
%266 = load double*, double** %2
%267 = load double*, double** %3
%268 = load i32, i32* %1
%269 = call double* @ommp(double* %266, double* %267, i32 %268)
store double* %269, double** %10
%270 = load double*, double** %10
%271 = load double*, double** %9
%272 = load i32, i32* %1
%273 = load i32, i32* %1
%274 = mul i32 %272, %273
%275 = call i64 @assert(double* %270, double* %271, i32 %274)
%276 = icmp ne i64 %275, 0
br i1 %276, label %277, label %279
277: ; preds = %265
%278 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %279
279: ; preds = %277, %265
%280 = load double*, double** %2
%281 = call i32 @free(double* %280)
%282 = load double*, double** %3
%283 = call i32 @free(double* %282)
%284 = load double*, double** %8
%285 = call i32 @free(double* %284)
%286 = load double*, double** %10
%287 = call i32 @free(double* %286)
%288 = load double*, double** %9
%289 = call i32 @free(double* %288)
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"OpenMp: Matrix - Matrix product ok\00"
@str.6 = [27 x i8] c"Matrix - Matrix product ok\00"
@str.7 = [35 x i8] c"OpenMp: Matrix - Vector product ok\00"
@str.8 = [27 x i8] c"Matrix - Vector product ok\00"
@str.9 = [39 x i8] c"OpenMp: Vector - Vector dot product ok\00"
@str.10 = [31 x i8] c"Vector - Vector dot product ok\00"
define void @test() {
%1 = tail call i64 @malloc(i32 24)
%2 = inttoptr i64 %1 to double*
%3 = tail call i64 @malloc(i32 24)
%4 = inttoptr i64 %3 to double*
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %4
%5 = getelementptr inbounds double, double* %2, i64 1
store double 1.000000e+00, double* %5
%6 = getelementptr inbounds double, double* %4, i64 1
store double 1.000000e+00, double* %6
%7 = getelementptr inbounds double, double* %2, i64 2
store double 2.000000e+00, double* %7
%8 = getelementptr inbounds double, double* %4, i64 2
store double 4.000000e+00, double* %8
%9 = tail call double @dvp(double* %2, double* %4, i32 3)
%10 = tail call i64 @equal(double 9.000000e+00, double %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
br label %14
14: ; preds = %12, %0
%15 = tail call double @odvp(double* %2, double* %4, i32 3)
%16 = tail call i64 @equal(double %15, double %9)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.9, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = tail call i32 @free(double* %2)
%22 = tail call i32 @free(double* %4)
%23 = tail call i64 @malloc(i32 24)
%24 = inttoptr i64 %23 to double*
%25 = tail call i64 @malloc(i32 72)
%26 = inttoptr i64 %25 to double*
store double 1.000000e+00, double* %24
store double 1.000000e+00, double* %26
%27 = getelementptr inbounds double, double* %26, i64 3
store double 1.000000e+00, double* %27
%28 = getelementptr inbounds double, double* %26, i64 6
store double 1.000000e+00, double* %28
%29 = getelementptr inbounds double, double* %24, i64 1
store double 1.000000e+00, double* %29
%30 = getelementptr inbounds double, double* %26, i64 1
store double 1.000000e+00, double* %30
%31 = getelementptr inbounds double, double* %26, i64 4
store double 1.000000e+00, double* %31
%32 = getelementptr inbounds double, double* %26, i64 7
store double 1.000000e+00, double* %32
%33 = getelementptr inbounds double, double* %24, i64 2
store double 1.000000e+00, double* %33
%34 = getelementptr inbounds double, double* %26, i64 2
store double 1.000000e+00, double* %34
%35 = getelementptr inbounds double, double* %26, i64 5
store double 1.000000e+00, double* %35
%36 = getelementptr inbounds double, double* %26, i64 8
store double 1.000000e+00, double* %36
%37 = tail call i64 @malloc(i32 24)
%38 = tail call i64 @mvp(double* %26, double* %24, i32 3, i32 3)
%39 = inttoptr i64 %38 to double*
%40 = tail call i64 @malloc(i32 24)
%41 = inttoptr i64 %40 to double*
%42 = inttoptr i64 %40 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
store double 3.000000e+00, double* %43
%44 = tail call i64 @assert(double* %39, double* %41, i32 3)
%45 = icmp eq i64 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %20
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.8, i64 0, i64 0))
br label %48
48: ; preds = %46, %20
%49 = tail call i64 @malloc(i32 24)
%50 = tail call double* @omvp(double* %26, double* %24, i32 3, i32 3)
%51 = tail call i64 @assert(double* %50, double* %41, i32 3)
%52 = icmp eq i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %48
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.7, i64 0, i64 0))
br label %55
55: ; preds = %53, %48
%56 = tail call i32 @free(double* %24)
%57 = tail call i32 @free(double* %26)
%58 = tail call i32 @free(double* %39)
%59 = tail call i32 @free(double* %50)
%60 = tail call i32 @free(double* %41)
%61 = tail call i64 @malloc(i32 72)
%62 = inttoptr i64 %61 to double*
%63 = tail call i64 @malloc(i32 72)
%64 = inttoptr i64 %63 to double*
%65 = tail call i64 @malloc(i32 72)
%66 = inttoptr i64 %65 to double*
%67 = getelementptr inbounds double, double* %66, i64 6
%68 = inttoptr i64 %65 to <2 x double>*
store <2 x double> <double 3.000000e+01, double 3.600000e+01>, <2 x double>* %68
%69 = getelementptr inbounds double, double* %66, i64 4
%70 = bitcast double* %67 to <2 x double>*
store <2 x double> <double 1.020000e+02, double 1.260000e+02>, <2 x double>* %70
%71 = getelementptr inbounds double, double* %66, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> <double 4.200000e+01, double 6.600000e+01>, <2 x double>* %72
%73 = bitcast double* %69 to <2 x double>*
store <2 x double> <double 8.100000e+01, double 9.600000e+01>, <2 x double>* %73
%74 = getelementptr inbounds double, double* %66, i64 8
store double 1.500000e+02, double* %74
store double 1.000000e+00, double* %62
store double 1.000000e+00, double* %64
%75 = getelementptr inbounds double, double* %62, i64 1
store double 2.000000e+00, double* %75
%76 = getelementptr inbounds double, double* %64, i64 1
store double 2.000000e+00, double* %76
%77 = getelementptr inbounds double, double* %62, i64 2
store double 3.000000e+00, double* %77
%78 = getelementptr inbounds double, double* %64, i64 2
store double 3.000000e+00, double* %78
%79 = getelementptr inbounds double, double* %62, i64 3
store double 4.000000e+00, double* %79
%80 = getelementptr inbounds double, double* %64, i64 3
store double 4.000000e+00, double* %80
%81 = getelementptr inbounds double, double* %62, i64 4
store double 5.000000e+00, double* %81
%82 = getelementptr inbounds double, double* %64, i64 4
store double 5.000000e+00, double* %82
%83 = getelementptr inbounds double, double* %62, i64 5
store double 6.000000e+00, double* %83
%84 = getelementptr inbounds double, double* %64, i64 5
store double 6.000000e+00, double* %84
%85 = getelementptr inbounds double, double* %62, i64 6
store double 7.000000e+00, double* %85
%86 = getelementptr inbounds double, double* %64, i64 6
store double 7.000000e+00, double* %86
%87 = getelementptr inbounds double, double* %62, i64 7
store double 8.000000e+00, double* %87
%88 = getelementptr inbounds double, double* %64, i64 7
store double 8.000000e+00, double* %88
%89 = getelementptr inbounds double, double* %62, i64 8
store double 9.000000e+00, double* %89
%90 = getelementptr inbounds double, double* %64, i64 8
store double 9.000000e+00, double* %90
%91 = tail call double* @mmp(double* %62, double* %64, i32 3)
%92 = tail call i64 @assert(double* %91, double* %66, i32 9)
%93 = icmp eq i64 %92, 0
br i1 %93, label %96, label %94
94: ; preds = %55
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %96
96: ; preds = %94, %55
%97 = tail call double* @ommp(double* %62, double* %64, i32 3)
%98 = tail call i64 @assert(double* %97, double* %66, i32 9)
%99 = icmp eq i64 %98, 0
br i1 %99, label %102, label %100
100: ; preds = %96
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %102
102: ; preds = %100, %96
%103 = tail call i32 @free(double* %62)
%104 = tail call i32 @free(double* %64)
%105 = tail call i32 @free(double* %91)
%106 = tail call i32 @free(double* %97)
%107 = tail call i32 @free(double* %66)
ret void
}