#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
double Matrix_Multiplication_One(double **, double **, double **, int, int);
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(double **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
main(int argc, char *argv[]) {
  int CLASS_SIZE, N_size, i, j, k, Total_threads, THREADS;
  double Total_overhead = 0.0;
  double **Matrix_A, **Matrix_B, **Result;
  double memoryused = 0.0;
  int iteration;
  FILE *fp;
  char *CLASS;
  printf("\n\t\t---------------------------------------------------------------"
         "------------");
  printf("\n\t\t Email : RarchK");
  printf("\n\t\t---------------------------------------------------------------"
         "------------");
  printf("\n\t\t Objective : Dense Matrix Computations (Floating Point "
         "Operations)\n ");
  printf("\n\t\t Matrix into Matrix Multiplication using ");
  printf("\n\t\t OpenMP one PARALLEL for directive and Private Clause;");
  printf("\n\t\t..............................................................."
         "...........\n");
  if (argc != 3) {
    printf("\t\t Very Few Arguments\n ");
    printf("\t\t Syntax : exec <Class-Size> <Threads>\n");
    printf("\t\t Where : Class-Size = A or B or C\n");
    exit(-1);
  } else {
    CLASS = argv[1];
    THREADS = atoi(argv[2]);
  }
  if (strcmp(CLASS, "A") == 0) {
    CLASS_SIZE = 1024;
  }
  if (strcmp(CLASS, "B") == 0) {
    CLASS_SIZE = 2048;
  }
  if (strcmp(CLASS, "C") == 0) {
    CLASS_SIZE = 4096;
  }
  N_size = CLASS_SIZE;
  Total_threads = THREADS;
  printf("\n\t\t Matrix Size :  %d", N_size);
  printf("\n\t\t Threads     :  %d", Total_threads);
  printf("\n");
  Matrix_A = (double **)malloc(sizeof(double *) * N_size);
  for (i = 0; i < N_size; i++) {
    Matrix_A[i] = (double *)malloc(sizeof(double) * N_size);
    for (j = 0; j < N_size; j++) {
      Matrix_A[i][j] = i + j;
    }
  }
  Matrix_B = (double **)malloc(sizeof(double *) * N_size);
  for (i = 0; i < N_size; i++) {
    Matrix_B[i] = (double *)malloc(sizeof(double) * N_size);
    for (j = 0; j < N_size; j++) {
      Matrix_B[i][j] = i + j;
    }
  }
  Result = (double **)malloc(sizeof(double *) * N_size);
  for (i = 0; i < N_size; i++)
    Result[i] = (double *)malloc(sizeof(double) * N_size);
  memoryused = (3 * (N_size * N_size)) * sizeof(double);
  Total_overhead = Matrix_Multiplication_One(Matrix_A, Matrix_B, Result, N_size,
                                             Total_threads);
  printf("\n\t\t Memory Utilized            : %lf MB \n",
         (memoryused / (1024 * 1024)));
  printf("\n\t\t Time in Seconds (T)        : %lf Seconds \n", Total_overhead);
  printf("\n\t\t   ( T represents the Time taken for the computation )");
  printf("\n\t\t..............................................................."
         "...........\n");
  free(Matrix_A);
  free(Matrix_B);
  free(Result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
je     1236 <main+0xc6>
lea    0xf87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x70(%rbp),%rdi
lea    0xf99(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1273 <main+0x103>
movl   $0x400,-0x14(%rbp)
mov    -0x70(%rbp),%rdi
lea    0xf7a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1294 <main+0x124>
movl   $0x800,-0x14(%rbp)
mov    -0x70(%rbp),%rdi
lea    0xf5b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12b5 <main+0x145>
movl   $0x1000,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%esi
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1388 <main+0x218>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1375 <main+0x205>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    133c <main+0x1cc>
jmp    137a <main+0x20a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    130b <main+0x19b>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    141f <main+0x2af>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    140c <main+0x29c>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13d3 <main+0x263>
jmp    1411 <main+0x2a1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13a2 <main+0x232>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1471 <main+0x301>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1439 <main+0x2c9>
mov    -0x18(%rbp),%ecx
imul   %ecx,%ecx
mov    %ecx,%eax
lea    (%rax,%rax,2),%eax
cltq
shl    $0x3,%rax
movq   %rax,%xmm0
movaps 0xb82(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xb86(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%r8d
call   1070 <Matrix_Multiplication_One@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xb28(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xd45(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xd5c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xe7d(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf0f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x1016(%rip),%rdi
call   1050 <puts@plt>
cmp    $0x3,%r14d
jne    14ac <main+0x31c>
mov    0x8(%rbx),%rbp
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
lea    0xf2d(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
lea    0xf20(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
shl    $0xa,%ebx
add    $0x400,%ebx
lea    0x1059(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    $0x1000,%ebp
cmovne %ebx,%ebp
lea    0xee8(%rip),%rdi
xor    %ebx,%ebx
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %r14d,0x8(%rsp)
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x0(,%rbp,8),%r14d
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,(%r15,%rbx,8)
movq   %rbx,%xmm0
pshufd $0x44,%xmm0,%xmm0
lea    0x2(%rbx),%rcx
movq   %rcx,%xmm1
pshufd $0x44,%xmm1,%xmm1
xor    %ecx,%ecx
movdqa 0xd22(%rip),%xmm2
movdqa 0xd2a(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm2,%xmm3
paddq  %xmm0,%xmm3
movdqa %xmm1,%xmm4
paddq  %xmm2,%xmm4
pshufd $0xe8,%xmm3,%xmm3
cvtdq2pd %xmm3,%xmm3
pshufd $0xe8,%xmm4,%xmm4
cvtdq2pd %xmm4,%xmm4
movups %xmm3,(%rax,%rcx,8)
movups %xmm4,0x10(%rax,%rcx,8)
add    $0x4,%rcx
paddq  %xmm5,%xmm2
cmp    %rcx,%rbp
jne    12f0 <main+0x160>
add    $0x1,%rbx
cmp    %rbp,%rbx
jne    12b0 <main+0x120>
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,(%r12,%rbx,8)
movq   %rbx,%xmm0
pshufd $0x44,%xmm0,%xmm0
lea    0x2(%rbx),%rcx
movq   %rcx,%xmm1
pshufd $0x44,%xmm1,%xmm1
xor    %ecx,%ecx
movdqa 0xc82(%rip),%xmm2
movdqa 0xc8a(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm2,%xmm3
paddq  %xmm0,%xmm3
movdqa %xmm1,%xmm4
paddq  %xmm2,%xmm4
pshufd $0xe8,%xmm3,%xmm3
cvtdq2pd %xmm3,%xmm3
pshufd $0xe8,%xmm4,%xmm4
cvtdq2pd %xmm4,%xmm4
movups %xmm3,(%rax,%rcx,8)
movups %xmm4,0x10(%rax,%rcx,8)
add    $0x4,%rcx
paddq  %xmm5,%xmm2
cmp    %rcx,%rbp
jne    1390 <main+0x200>
add    $0x1,%rbx
cmp    %rbp,%rbx
jne    1350 <main+0x1c0>
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    13f0 <main+0x260>
mov    %ebp,%eax
imul   %eax,%eax
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %ebp,%ecx
mov    0x8(%rsp),%r8d
call   1090 <Matrix_Multiplication_One@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xbd9(%rip),%xmm0
lea    0xd33(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xd4f(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xd6a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd96(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc86(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xda1(%rip),%rdi
call   1050 <puts@plt>
lea    0xdbd(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [79 x i8] c"\0A\09\09---------------------------------------------------------------------------\00"
@.str.1 = [19 x i8] c"\0A\09\09 Email : RarchK\00"
@.str.2 = [72 x i8] c"\0A\09\09 Objective : Dense Matrix Computations (Floating Point Operations)\0A \00"
@.str.3 = [45 x i8] c"\0A\09\09 Matrix into Matrix Multiplication using \00"
@.str.4 = [58 x i8] c"\0A\09\09 OpenMP one PARALLEL for directive and Private Clause;\00"
@.str.5 = [79 x i8] c"\0A\09\09..........................................................................\0A\00"
@.str.6 = [24 x i8] c"\09\09 Very Few Arguments\0A \00"
@.str.7 = [41 x i8] c"\09\09 Syntax : exec <Class-Size> <Threads>\0A\00"
@.str.8 = [37 x i8] c"\09\09 Where : Class-Size = A or B or C\0A\00"
@.str.9 = [2 x i8] c"A\00"
@.str.10 = [2 x i8] c"B\00"
@.str.11 = [2 x i8] c"C\00"
@.str.12 = [22 x i8] c"\0A\09\09 Matrix Size : %d\00"
@.str.13 = [22 x i8] c"\0A\09\09 Threads : %d\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [42 x i8] c"\0A\09\09 Memory Utilized : %lf MB \0A\00"
@.str.16 = [47 x i8] c"\0A\09\09 Time in Seconds (T) : %lf Seconds \0A\00"
@.str.17 = [58 x i8] c"\0A\09\09 ( T represents the Time taken for the computation )\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double**
%15 = alloca double**
%16 = alloca double**
%17 = alloca double
%18 = alloca i32
%19 = alloca i32*
%20 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.5, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 3
br i1 %29, label %30, label %35
30: ; preds = %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 @exit(i32 -1)
unreachable
35: ; preds = %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
store i8* %38, i8** %20
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
store i32 %42, i32* %12
br label %43
43: ; preds = %35
%44 = load i8*, i8** %20
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %43
store i32 1024, i32* %6
br label %48
48: ; preds = %47, %43
%49 = load i8*, i8** %20
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 2048, i32* %6
br label %53
53: ; preds = %52, %48
%54 = load i8*, i8** %20
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53
store i32 4096, i32* %6
br label %58
58: ; preds = %57, %53
%59 = load i32, i32* %6
store i32 %59, i32* %7
%60 = load i32, i32* %12
store i32 %60, i32* %11
%61 = load i32, i32* %7
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %11
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i32 %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%66 = load i32, i32* %7
%67 = sext i32 %66 to i64
%68 = mul i64 8, %67
%69 = trunc i64 %68 to i32
%70 = call i64 @malloc(i32 %69)
%71 = inttoptr i64 %70 to double**
store double** %71, double*** %14
store i32 0, i32* %8
br label %72
72: ; preds = %108, %58
%73 = load i32, i32* %8
%74 = load i32, i32* %7
%75 = icmp slt i32 %73, %74
br i1 %75, label %76, label %111
76: ; preds = %72
%77 = load i32, i32* %7
%78 = sext i32 %77 to i64
%79 = mul i64 8, %78
%80 = trunc i64 %79 to i32
%81 = call i64 @malloc(i32 %80)
%82 = inttoptr i64 %81 to double*
%83 = load double**, double*** %14
%84 = load i32, i32* %8
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double*, double** %83, i64 %85
store double* %82, double** %86
store i32 0, i32* %9
br label %87
87: ; preds = %104, %76
%88 = load i32, i32* %9
%89 = load i32, i32* %7
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %107
91: ; preds = %87
%92 = load i32, i32* %8
%93 = load i32, i32* %9
%94 = add nsw i32 %92, %93
%95 = sitofp i32 %94 to double
%96 = load double**, double*** %14
%97 = load i32, i32* %8
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double*, double** %96, i64 %98
%100 = load double*, double** %99
%101 = load i32, i32* %9
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %100, i64 %102
store double %95, double* %103
br label %104
104: ; preds = %91
%105 = load i32, i32* %9
%106 = add nsw i32 %105, 1
store i32 %106, i32* %9
br label %87
107: ; preds = %87
br label %108
108: ; preds = %107
%109 = load i32, i32* %8
%110 = add nsw i32 %109, 1
store i32 %110, i32* %8
br label %72
111: ; preds = %72
%112 = load i32, i32* %7
%113 = sext i32 %112 to i64
%114 = mul i64 8, %113
%115 = trunc i64 %114 to i32
%116 = call i64 @malloc(i32 %115)
%117 = inttoptr i64 %116 to double**
store double** %117, double*** %15
store i32 0, i32* %8
br label %118
118: ; preds = %154, %111
%119 = load i32, i32* %8
%120 = load i32, i32* %7
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %157
122: ; preds = %118
%123 = load i32, i32* %7
%124 = sext i32 %123 to i64
%125 = mul i64 8, %124
%126 = trunc i64 %125 to i32
%127 = call i64 @malloc(i32 %126)
%128 = inttoptr i64 %127 to double*
%129 = load double**, double*** %15
%130 = load i32, i32* %8
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double*, double** %129, i64 %131
store double* %128, double** %132
store i32 0, i32* %9
br label %133
133: ; preds = %150, %122
%134 = load i32, i32* %9
%135 = load i32, i32* %7
%136 = icmp slt i32 %134, %135
br i1 %136, label %137, label %153
137: ; preds = %133
%138 = load i32, i32* %8
%139 = load i32, i32* %9
%140 = add nsw i32 %138, %139
%141 = sitofp i32 %140 to double
%142 = load double**, double*** %15
%143 = load i32, i32* %8
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double*, double** %142, i64 %144
%146 = load double*, double** %145
%147 = load i32, i32* %9
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
store double %141, double* %149
br label %150
150: ; preds = %137
%151 = load i32, i32* %9
%152 = add nsw i32 %151, 1
store i32 %152, i32* %9
br label %133
153: ; preds = %133
br label %154
154: ; preds = %153
%155 = load i32, i32* %8
%156 = add nsw i32 %155, 1
store i32 %156, i32* %8
br label %118
157: ; preds = %118
%158 = load i32, i32* %7
%159 = sext i32 %158 to i64
%160 = mul i64 8, %159
%161 = trunc i64 %160 to i32
%162 = call i64 @malloc(i32 %161)
%163 = inttoptr i64 %162 to double**
store double** %163, double*** %16
store i32 0, i32* %8
br label %164
164: ; preds = %179, %157
%165 = load i32, i32* %8
%166 = load i32, i32* %7
%167 = icmp slt i32 %165, %166
br i1 %167, label %168, label %182
168: ; preds = %164
%169 = load i32, i32* %7
%170 = sext i32 %169 to i64
%171 = mul i64 8, %170
%172 = trunc i64 %171 to i32
%173 = call i64 @malloc(i32 %172)
%174 = inttoptr i64 %173 to double*
%175 = load double**, double*** %16
%176 = load i32, i32* %8
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double*, double** %175, i64 %177
store double* %174, double** %178
br label %179
179: ; preds = %168
%180 = load i32, i32* %8
%181 = add nsw i32 %180, 1
store i32 %181, i32* %8
br label %164
182: ; preds = %164
%183 = load i32, i32* %7
%184 = load i32, i32* %7
%185 = mul nsw i32 %183, %184
%186 = mul nsw i32 3, %185
%187 = sext i32 %186 to i64
%188 = mul i64 %187, 8
%189 = uitofp i64 %188 to double
store double %189, double* %17
%190 = load double**, double*** %14
%191 = load double**, double*** %15
%192 = load double**, double*** %16
%193 = load i32, i32* %7
%194 = load i32, i32* %11
%195 = call double @Matrix_Multiplication_One(double** %190, double** %191, double** %192, i32 %193, i32 %194)
store double %195, double* %13
%196 = load double, double* %17
%197 = fdiv double %196, 0x4130000000000000
%198 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0), double %197)
%199 = load double, double* %13
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0), double %199)
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.17, i64 0, i64 0))
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.5, i64 0, i64 0))
%203 = load double**, double*** %14
%204 = call i32 @free(double** %203)
%205 = load double**, double*** %15
%206 = call i32 @free(double** %205)
%207 = load double**, double*** %16
%208 = call i32 @free(double** %207)
%209 = load i32, i32* %3
ret i32 %209
}

LLVM IR (-O2):
@.str = [79 x i8] c"\0A\09\09---------------------------------------------------------------------------\00"
@.str.1 = [19 x i8] c"\0A\09\09 Email : RarchK\00"
@.str.2 = [72 x i8] c"\0A\09\09 Objective : Dense Matrix Computations (Floating Point Operations)\0A \00"
@.str.3 = [45 x i8] c"\0A\09\09 Matrix into Matrix Multiplication using \00"
@.str.4 = [58 x i8] c"\0A\09\09 OpenMP one PARALLEL for directive and Private Clause;\00"
@.str.6 = [24 x i8] c"\09\09 Very Few Arguments\0A \00"
@.str.9 = [2 x i8] c"A\00"
@.str.10 = [2 x i8] c"B\00"
@.str.11 = [2 x i8] c"C\00"
@.str.12 = [22 x i8] c"\0A\09\09 Matrix Size : %d\00"
@.str.13 = [22 x i8] c"\0A\09\09 Threads : %d\00"
@.str.15 = [42 x i8] c"\0A\09\09 Memory Utilized : %lf MB \0A\00"
@.str.16 = [47 x i8] c"\0A\09\09 Time in Seconds (T) : %lf Seconds \0A\00"
@.str.17 = [58 x i8] c"\0A\09\09 ( T represents the Time taken for the computation )\00"
@str.18 = [78 x i8] c"\0A\09\09..........................................................................\00"
@str.19 = [40 x i8] c"\09\09 Syntax : exec <Class-Size> <Threads>\00"
@str.20 = [36 x i8] c"\09\09 Where : Class-Size = A or B or C\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.18, i64 0, i64 0))
%10 = icmp eq i32 %0, 3
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.19, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.20, i64 0, i64 0))
%15 = tail call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%23 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i32 2048, i32 1024
%26 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
%28 = select i1 %27, i32 4096, i32 %25
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %28)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i32 %21)
%31 = tail call i32 @putchar(i32 10)
%32 = shl nuw nsw i32 %28, 3
%33 = tail call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to double**
%35 = zext i32 %28 to i64
br label %36
36: ; preds = %16, %62
%37 = phi i64 [ 0, %16 ], [ %63, %62 ]
%38 = tail call i64 @malloc(i32 %32)
%39 = inttoptr i64 %38 to double*
%40 = getelementptr inbounds double*, double** %34, i64 %37
store double* %39, double** %40
%41 = insertelement <2 x i64> poison, i64 %37, i64 0
%42 = shufflevector <2 x i64> %41, <2 x i64> poison, <2 x i32> zeroinitializer
%43 = add nuw i64 %37, 2
%44 = insertelement <2 x i64> poison, i64 %43, i64 0
%45 = shufflevector <2 x i64> %44, <2 x i64> poison, <2 x i32> zeroinitializer
br label %46
46: ; preds = %46, %36
%47 = phi i64 [ 0, %36 ], [ %59, %46 ]
%48 = phi <2 x i64> [ <i64 0, i64 1>, %36 ], [ %60, %46 ]
%49 = add nuw nsw <2 x i64> %48, %42
%50 = add <2 x i64> %45, %48
%51 = trunc <2 x i64> %49 to <2 x i32>
%52 = trunc <2 x i64> %50 to <2 x i32>
%53 = sitofp <2 x i32> %51 to <2 x double>
%54 = sitofp <2 x i32> %52 to <2 x double>
%55 = getelementptr inbounds double, double* %39, i64 %47
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %53, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = add nuw i64 %47, 4
%60 = add <2 x i64> %48, <i64 4, i64 4>
%61 = icmp eq i64 %59, %35
br i1 %61, label %62, label %46
62: ; preds = %46
%63 = add nuw nsw i64 %37, 1
%64 = icmp eq i64 %63, %35
br i1 %64, label %65, label %36
65: ; preds = %62
%66 = tail call i64 @malloc(i32 %32)
%67 = inttoptr i64 %66 to double**
br label %68
68: ; preds = %65, %94
%69 = phi i64 [ 0, %65 ], [ %95, %94 ]
%70 = tail call i64 @malloc(i32 %32)
%71 = inttoptr i64 %70 to double*
%72 = getelementptr inbounds double*, double** %67, i64 %69
store double* %71, double** %72
%73 = insertelement <2 x i64> poison, i64 %69, i64 0
%74 = shufflevector <2 x i64> %73, <2 x i64> poison, <2 x i32> zeroinitializer
%75 = add nuw i64 %69, 2
%76 = insertelement <2 x i64> poison, i64 %75, i64 0
%77 = shufflevector <2 x i64> %76, <2 x i64> poison, <2 x i32> zeroinitializer
br label %78
78: ; preds = %78, %68
%79 = phi i64 [ 0, %68 ], [ %91, %78 ]
%80 = phi <2 x i64> [ <i64 0, i64 1>, %68 ], [ %92, %78 ]
%81 = add nuw nsw <2 x i64> %80, %74
%82 = add <2 x i64> %77, %80
%83 = trunc <2 x i64> %81 to <2 x i32>
%84 = trunc <2 x i64> %82 to <2 x i32>
%85 = sitofp <2 x i32> %83 to <2 x double>
%86 = sitofp <2 x i32> %84 to <2 x double>
%87 = getelementptr inbounds double, double* %71, i64 %79
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %85, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
%91 = add nuw i64 %79, 4
%92 = add <2 x i64> %80, <i64 4, i64 4>
%93 = icmp eq i64 %91, %35
br i1 %93, label %94, label %78
94: ; preds = %78
%95 = add nuw nsw i64 %69, 1
%96 = icmp eq i64 %95, %35
br i1 %96, label %97, label %68
97: ; preds = %94
%98 = tail call i64 @malloc(i32 %32)
%99 = inttoptr i64 %98 to double**
br label %100
100: ; preds = %97, %100
%101 = phi i64 [ 0, %97 ], [ %105, %100 ]
%102 = tail call i64 @malloc(i32 %32)
%103 = inttoptr i64 %102 to double*
%104 = getelementptr inbounds double*, double** %99, i64 %101
store double* %103, double** %104
%105 = add nuw nsw i64 %101, 1
%106 = icmp eq i64 %105, %35
br i1 %106, label %107, label %100
107: ; preds = %100
%108 = mul nuw nsw i32 %28, 24
%109 = mul nuw i32 %108, %28
%110 = uitofp i32 %109 to double
%111 = tail call double @Matrix_Multiplication_One(double** %34, double** %67, double** %99, i32 %28, i32 %21)
%112 = fmul double %110, 0x3EB0000000000000
%113 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0), double %112)
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0), double %111)
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.17, i64 0, i64 0))
%116 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.18, i64 0, i64 0))
%117 = tail call i32 @free(double** %34)
%118 = tail call i32 @free(double** %67)
%119 = tail call i32 @free(double** %99)
ret i32 0
}