#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 */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(double **);
scalar_t__ malloc(int);
int omp_get_num_threads();
scalar_t__ omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, ...);
main(int argc, char **argv) {
  double **InputMatrix, **CheckMatrix;
  int j, i, N, Noofthreads, total_threads;
  printf("\n\t\t---------------------------------------------------------------"
         "------------");
  printf("\n\t\t Email : RarchK");
  printf("\n\t\t---------------------------------------------------------------"
         "------------");
  printf("\n\t\t Objective : Parallization of a loop nest contating a "
         "recurrence relation.\n ");
  printf("\n\t\t Demonstrates the use of OpenMP Parallel for directive  ");
  printf("\n\t\t..............................................................."
         "...........\n");
  if (argc != 3) {
    printf("\t\t Very Few Arguments\n ");
    printf("\t\t Syntax : exec <Threads> <matrix-size>\n");
    exit(-1);
  }
  Noofthreads = atoi(argv[1]);
  N = atoi(argv[2]);
  if ((Noofthreads != 1) && (Noofthreads != 2) && (Noofthreads != 4) &&
      (Noofthreads != 8) && (Noofthreads != 16)) {
    printf("\n Number of threads should be 1,2,4,8 or 16 for the execution of "
           "program. \n\n");
    exit(-1);
  }
  if (N <= 0) {
    printf("\n\t\t Array Size Should Be Of Positive Sign \n");
    exit(1);
  }
  InputMatrix = (double **)malloc(sizeof(double *) * N);
  CheckMatrix = (double **)malloc(sizeof(double *) * N);
  for (i = 0; i < N; i++) {
    InputMatrix[i] = (double *)malloc(sizeof(double) * N);
    for (j = 0; j < N; j++)
      InputMatrix[i][j] = i + j;
  }
  for (i = 0; i < N; i++) {
    CheckMatrix[i] = (double *)malloc(sizeof(double) * N);
    for (j = 0; j < N; j++)
      CheckMatrix[i][j] = InputMatrix[i][j];
  }
  omp_set_num_threads(Noofthreads);
  for (j = 1; j < N; j++)
#pragma omp parallel for
    for (i = 1; i < N; i++) {
      if ((omp_get_thread_num()) == 0) {
        total_threads = omp_get_num_threads();
      }
      InputMatrix[i][j] = InputMatrix[i][j] + InputMatrix[i][j - 1];
    }
  for (j = 1; j < N; j++)
    for (i = 1; i < N; i++)
      CheckMatrix[i][j] = CheckMatrix[i][j] + CheckMatrix[i][j - 1];
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      if (CheckMatrix[i][j] == InputMatrix[i][j]) {
        continue;
      } else {
        printf("\n\t\t The result of the serial and parallel calculation are "
               "not Equal \n");
        exit(1);
      }
  printf("\n\n\t\t Threads     : %d", total_threads);
  printf("\n\t\t Matrix Size : %d ", N);
  printf("\n\n\t\t Serial And Parallel Calculation Are Same. \n");
  printf("\n\t\t..............................................................."
         "...........\n");
  printf("\n");
  free(InputMatrix);
  free(CheckMatrix);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
je     121a <main+0x9a>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x1,-0x30(%rbp)
je     1284 <main+0x104>
cmpl   $0x2,-0x30(%rbp)
je     1284 <main+0x104>
cmpl   $0x4,-0x30(%rbp)
je     1284 <main+0x104>
cmpl   $0x8,-0x30(%rbp)
je     1284 <main+0x104>
cmpl   $0x10,-0x30(%rbp)
je     1284 <main+0x104>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jg     12a6 <main+0x126>
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1350 <main+0x1d0>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    133d <main+0x1bd>
mov    -0x28(%rbp),%eax
add    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1304 <main+0x184>
jmp    1342 <main+0x1c2>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12d3 <main+0x153>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13df <main+0x25f>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13cc <main+0x24c>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1388 <main+0x208>
jmp    13d1 <main+0x251>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1357 <main+0x1d7>
mov    -0x30(%rbp),%edi
call   1080 <omp_set_num_threads@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    148d <main+0x30d>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    147a <main+0x2fa>
mov    $0x0,%al
call   1040 <omp_get_thread_num@plt>
cmp    $0x0,%rax
jne    1428 <main+0x2a8>
mov    $0x0,%al
call   1060 <omp_get_num_threads@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1401 <main+0x281>
jmp    147f <main+0x2ff>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13ee <main+0x26e>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1518 <main+0x398>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1505 <main+0x385>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    14a7 <main+0x327>
jmp    150a <main+0x38a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1494 <main+0x314>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15b2 <main+0x432>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    159f <main+0x41f>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    1579 <main+0x3f9>
jp     1579 <main+0x3f9>
jmp    1591 <main+0x411>
lea    0xc78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1532 <main+0x3b2>
jmp    15a4 <main+0x424>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    151f <main+0x39f>
mov    -0x34(%rbp),%esi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbd3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%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    %rsi,%rbx
mov    %edi,%r14d
lea    0xe65(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf82(%rip),%rdi
call   1050 <puts@plt>
cmp    $0x3,%r14d
jne    171b <main+0x57b>
mov    0x8(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
cmp    $0x10,%ebp
ja     1748 <main+0x5a8>
mov    %eax,%r13d
mov    $0x10116,%eax
bt     %ebp,%eax
jae    1748 <main+0x5a8>
mov    %ebp,(%rsp)
test   %r13d,%r13d
jle    173f <main+0x59f>
lea    0x0(,%r13,8),%ebx
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    %ebx,0x4(%rsp)
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r13d,%r14d
mov    %r14d,%ebp
and    $0xfffffffc,%ebp
lea    0x0(,%r14,8),%r12
and    $0xffffffffffffffe0,%r12
xor    %ebx,%ebx
jmp    129d <main+0xfd>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %r14,%rbx
je     135d <main+0x1bd>
mov    0x4(%rsp),%edi
call   1090 <malloc@plt>
mov    %rax,(%r15,%rbx,8)
cmp    $0x4,%r13d
jae    12c0 <main+0x120>
xor    %ecx,%ecx
jmp    1340 <main+0x1a0>
nopw   0x0(%rax,%rax,1)
movq   %rbx,%xmm0
pshufd $0x44,%xmm0,%xmm0
lea    0x2(%rbx),%rcx
movq   %rcx,%xmm1
pshufd $0x44,%xmm1,%xmm1
xor    %ecx,%ecx
movdqa 0xd1e(%rip),%xmm2
movdqa 0xd26(%rip),%xmm5
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,1)
movups %xmm4,0x10(%rax,%rcx,1)
paddq  %xmm5,%xmm2
add    $0x20,%rcx
cmp    %rcx,%r12
jne    12f0 <main+0x150>
mov    %rbp,%rcx
cmp    %r14,%rbp
je     1290 <main+0xf0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rbx,%rcx,1),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r14
jne    1340 <main+0x1a0>
jmp    1290 <main+0xf0>
test   %r13d,%r13d
jle    1751 <main+0x5b1>
mov    %r13,%rbp
mov    %r14d,%eax
and    $0xfffffffc,%eax
mov    %rax,0x30(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0x28(%rsp)
mov    %rax,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
lea    -0x1(%r14),%rax
mov    %rax,0x10(%rsp)
mov    %ecx,%ebx
and    $0x3,%ebx
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x18(%rsp)
mov    %r14d,%r12d
and    $0x3,%r12d
mov    %rbx,0x20(%rsp)
shl    $0x5,%rbx
xor    %r13d,%r13d
jmp    13cd <main+0x22d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13
cmp    %r14,%r13
je     1545 <main+0x3a5>
mov    0x4(%rsp),%edi
call   1090 <malloc@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%r13,8)
mov    (%r15,%r13,8),%rcx
cmp    $0x4,%ebp
jb     13fe <main+0x25e>
lea    (%rcx,%r14,8),%rdx
cmp    %rdx,%rax
jae    1470 <main+0x2d0>
lea    (%rax,%r14,8),%rdx
cmp    %rdx,%rcx
jae    1470 <main+0x2d0>
xor    %edx,%edx
mov    0x10(%rsp),%rsi
sub    %rdx,%rsi
test   %r12,%r12
je     1424 <main+0x284>
mov    %r12,%rdi
movq   (%rcx,%rdx,8),%xmm0
movq   %xmm0,(%rax,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rdi
jne    1410 <main+0x270>
cmp    $0x3,%rsi
jb     13c0 <main+0x220>
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
movsd  0x8(%rcx,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rax,%rdx,8)
movsd  0x10(%rcx,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rax,%rdx,8)
movq   0x18(%rcx,%rdx,8),%xmm0
movq   %xmm0,0x18(%rax,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%r14
jne    1430 <main+0x290>
jmp    13c0 <main+0x220>
nopl   0x0(%rax)
cmpq   $0xc,0x28(%rsp)
jae    147c <main+0x2dc>
xor    %edx,%edx
jmp    14ec <main+0x34c>
mov    0x18(%rsp),%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups (%rcx,%rdx,8),%xmm0
movups 0x10(%rcx,%rdx,8),%xmm1
movups %xmm0,(%rax,%rdx,8)
movups %xmm1,0x10(%rax,%rdx,8)
movups 0x20(%rcx,%rdx,8),%xmm0
movups 0x30(%rcx,%rdx,8),%xmm1
movups %xmm0,0x20(%rax,%rdx,8)
movups %xmm1,0x30(%rax,%rdx,8)
movups 0x40(%rcx,%rdx,8),%xmm0
movups 0x50(%rcx,%rdx,8),%xmm1
movups %xmm0,0x40(%rax,%rdx,8)
movups %xmm1,0x50(%rax,%rdx,8)
movdqu 0x60(%rcx,%rdx,8),%xmm0
movdqu 0x70(%rcx,%rdx,8),%xmm1
movdqu %xmm0,0x60(%rax,%rdx,8)
movdqu %xmm1,0x70(%rax,%rdx,8)
add    $0x10,%rdx
add    $0xfffffffffffffffc,%rsi
jne    1490 <main+0x2f0>
cmpq   $0x0,0x20(%rsp)
je     152f <main+0x38f>
lea    (%rax,%rdx,8),%rsi
add    $0x10,%rsi
lea    (%rcx,%rdx,8),%rdx
add    $0x10,%rdx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
movdqu -0x10(%rdx,%rdi,1),%xmm0
movdqu (%rdx,%rdi,1),%xmm1
movdqu %xmm0,-0x10(%rsi,%rdi,1)
movdqu %xmm1,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rbx
jne    1510 <main+0x370>
mov    0x30(%rsp),%rsi
mov    %rsi,%rdx
cmp    %r14,%rsi
je     13c0 <main+0x220>
jmp    1400 <main+0x260>
mov    (%rsp),%edi
call   10a0 <omp_set_num_threads@plt>
mov    %rbp,%r13
cmp    $0x2,%r13d
jl     1658 <main+0x4b8>
mov    $0x1,%ebx
jmp    1579 <main+0x3d9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %r14,%rbx
je     15b5 <main+0x415>
mov    $0x1,%ebp
jmp    159d <main+0x3fd>
mov    (%r15,%rbp,8),%rax
movsd  (%rax,%rbx,8),%xmm0
addsd  -0x8(%rax,%rbx,8),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
add    $0x1,%rbp
cmp    %rbp,%r14
je     1570 <main+0x3d0>
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
test   %rax,%rax
jne    1580 <main+0x3e0>
xor    %eax,%eax
call   1080 <omp_get_num_threads@plt>
mov    %eax,%r12d
jmp    1580 <main+0x3e0>
cmp    $0x2,%r13d
jl     1658 <main+0x4b8>
mov    0x10(%rsp),%rax
and    $0xfffffffffffffffe,%rax
neg    %rax
mov    $0x1,%ecx
mov    0x8(%rsp),%rdi
jmp    15e9 <main+0x449>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    %r14,%rcx
je     1658 <main+0x4b8>
mov    $0x1,%edx
cmp    $0x2,%r13d
je     163b <main+0x49b>
mov    $0x1,%edx
nopl   0x0(%rax)
mov    (%rdi,%rdx,8),%rsi
movsd  (%rsi,%rcx,8),%xmm0
addsd  -0x8(%rsi,%rcx,8),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
mov    0x8(%rdi,%rdx,8),%rsi
movsd  (%rsi,%rcx,8),%xmm0
addsd  -0x8(%rsi,%rcx,8),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
lea    (%rax,%rdx,1),%rsi
add    $0x2,%rsi
add    $0x2,%rdx
cmp    $0x1,%rsi
jne    1600 <main+0x460>
testb  $0x1,0x10(%rsp)
je     15e0 <main+0x440>
mov    (%rdi,%rdx,8),%rdx
movsd  (%rdx,%rcx,8),%xmm0
addsd  -0x8(%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
jmp    15e0 <main+0x440>
test   %r13d,%r13d
mov    0x8(%rsp),%rbx
jle    16a0 <main+0x500>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%rax,8),%rcx
mov    (%r15,%rax,8),%rdx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm0
ucomisd (%rdx,%rsi,8),%xmm0
jne    1705 <main+0x565>
jp     1705 <main+0x565>
add    $0x1,%rsi
cmp    %rsi,%r14
jne    1680 <main+0x4e0>
add    $0x1,%rax
cmp    %r14,%rax
jne    1670 <main+0x4d0>
lea    0xa7f(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa84(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa89(%rip),%rdi
call   1050 <puts@plt>
lea    0xaad(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xac4(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0x9ec(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb5c(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    0xacf(%rip),%rdi
jmp    170c <main+0x56c>
lea    0xaf1(%rip),%rdi
jmp    1730 <main+0x590>
mov    (%rsp),%edi
call   10a0 <omp_set_num_threads@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 = [80 x i8] c"\0A\09\09 Objective : Parallization of a loop nest contating a recurrence relation.\0A \00"
@.str.3 = [60 x i8] c"\0A\09\09 Demonstrates the use of OpenMP Parallel for directive \00"
@.str.4 = [79 x i8] c"\0A\09\09..........................................................................\0A\00"
@.str.5 = [24 x i8] c"\09\09 Very Few Arguments\0A \00"
@.str.6 = [42 x i8] c"\09\09 Syntax : exec <Threads> <matrix-size>\0A\00"
@.str.7 = [77 x i8] c"\0A Number of threads should be 1,2,4,8 or 16 for the execution of program. \0A\0A\00"
@.str.8 = [44 x i8] c"\0A\09\09 Array Size Should Be Of Positive Sign \0A\00"
@.str.9 = [70 x i8] c"\0A\09\09 The result of the serial and parallel calculation are not Equal \0A\00"
@.str.10 = [22 x i8] c"\0A\0A\09\09 Threads : %d\00"
@.str.11 = [22 x i8] c"\0A\09\09 Matrix Size : %d \00"
@.str.12 = [49 x i8] c"\0A\0A\09\09 Serial And Parallel Calculation Are Same. \0A\00"
@.str.13 = [2 x i8] c"\0A\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 3
br i1 %20, label %21, label %25
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %11
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %10
%34 = load i32, i32* %11
%35 = icmp ne i32 %34, 1
br i1 %35, label %36, label %51
36: ; preds = %25
%37 = load i32, i32* %11
%38 = icmp ne i32 %37, 2
br i1 %38, label %39, label %51
39: ; preds = %36
%40 = load i32, i32* %11
%41 = icmp ne i32 %40, 4
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = load i32, i32* %11
%44 = icmp ne i32 %43, 8
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = load i32, i32* %11
%47 = icmp ne i32 %46, 16
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.7, i64 0, i64 0))
%50 = call i32 @exit(i32 -1)
unreachable
51: ; preds = %45, %42, %39, %36, %25
%52 = load i32, i32* %10
%53 = icmp sle i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %51
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = mul i64 8, %59
%61 = trunc i64 %60 to i32
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to double**
store double** %63, double*** %6
%64 = load i32, i32* %10
%65 = sext i32 %64 to i64
%66 = mul i64 8, %65
%67 = trunc i64 %66 to i32
%68 = call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to double**
store double** %69, double*** %7
store i32 0, i32* %9
br label %70
70: ; preds = %106, %57
%71 = load i32, i32* %9
%72 = load i32, i32* %10
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %109
74: ; preds = %70
%75 = load i32, i32* %10
%76 = sext i32 %75 to i64
%77 = mul i64 8, %76
%78 = trunc i64 %77 to i32
%79 = call i64 @malloc(i32 %78)
%80 = inttoptr i64 %79 to double*
%81 = load double**, double*** %6
%82 = load i32, i32* %9
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double*, double** %81, i64 %83
store double* %80, double** %84
store i32 0, i32* %8
br label %85
85: ; preds = %102, %74
%86 = load i32, i32* %8
%87 = load i32, i32* %10
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %105
89: ; preds = %85
%90 = load i32, i32* %9
%91 = load i32, i32* %8
%92 = add nsw i32 %90, %91
%93 = sitofp i32 %92 to double
%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* %8
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
store double %93, double* %101
br label %102
102: ; preds = %89
%103 = load i32, i32* %8
%104 = add nsw i32 %103, 1
store i32 %104, i32* %8
br label %85
105: ; preds = %85
br label %106
106: ; preds = %105
%107 = load i32, i32* %9
%108 = add nsw i32 %107, 1
store i32 %108, i32* %9
br label %70
109: ; preds = %70
store i32 0, i32* %9
br label %110
110: ; preds = %151, %109
%111 = load i32, i32* %9
%112 = load i32, i32* %10
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %154
114: ; preds = %110
%115 = load i32, i32* %10
%116 = sext i32 %115 to i64
%117 = mul i64 8, %116
%118 = trunc i64 %117 to i32
%119 = call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to double*
%121 = load double**, double*** %7
%122 = load i32, i32* %9
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double*, double** %121, i64 %123
store double* %120, double** %124
store i32 0, i32* %8
br label %125
125: ; preds = %147, %114
%126 = load i32, i32* %8
%127 = load i32, i32* %10
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %150
129: ; preds = %125
%130 = load double**, double*** %6
%131 = load i32, i32* %9
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double*, double** %130, i64 %132
%134 = load double*, double** %133
%135 = load i32, i32* %8
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %134, i64 %136
%138 = load double, double* %137
%139 = load double**, double*** %7
%140 = load i32, i32* %9
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double*, double** %139, i64 %141
%143 = load double*, double** %142
%144 = load i32, i32* %8
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %143, i64 %145
store double %138, double* %146
br label %147
147: ; preds = %129
%148 = load i32, i32* %8
%149 = add nsw i32 %148, 1
store i32 %149, i32* %8
br label %125
150: ; preds = %125
br label %151
151: ; preds = %150
%152 = load i32, i32* %9
%153 = add nsw i32 %152, 1
store i32 %153, i32* %9
br label %110
154: ; preds = %110
%155 = load i32, i32* %11
%156 = call i32 @omp_set_num_threads(i32 %155)
store i32 1, i32* %8
br label %157
157: ; preds = %204, %154
%158 = load i32, i32* %8
%159 = load i32, i32* %10
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %207
161: ; preds = %157
store i32 1, i32* %9
br label %162
162: ; preds = %200, %161
%163 = load i32, i32* %9
%164 = load i32, i32* %10
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %203
166: ; preds = %162
%167 = call i64 (...) @omp_get_thread_num()
%168 = icmp eq i64 %167, 0
br i1 %168, label %169, label %171
169: ; preds = %166
%170 = call i32 (...) @omp_get_num_threads()
store i32 %170, i32* %12
br label %171
171: ; preds = %169, %166
%172 = load double**, double*** %6
%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* %8
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %176, i64 %178
%180 = load double, double* %179
%181 = load double**, double*** %6
%182 = load i32, i32* %9
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double*, double** %181, i64 %183
%185 = load double*, double** %184
%186 = load i32, i32* %8
%187 = sub nsw i32 %186, 1
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %185, i64 %188
%190 = load double, double* %189
%191 = fadd double %180, %190
%192 = load double**, double*** %6
%193 = load i32, i32* %9
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double*, double** %192, i64 %194
%196 = load double*, double** %195
%197 = load i32, i32* %8
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
store double %191, double* %199
br label %200
200: ; preds = %171
%201 = load i32, i32* %9
%202 = add nsw i32 %201, 1
store i32 %202, i32* %9
br label %162
203: ; preds = %162
br label %204
204: ; preds = %203
%205 = load i32, i32* %8
%206 = add nsw i32 %205, 1
store i32 %206, i32* %8
br label %157
207: ; preds = %157
store i32 1, i32* %8
br label %208
208: ; preds = %250, %207
%209 = load i32, i32* %8
%210 = load i32, i32* %10
%211 = icmp slt i32 %209, %210
br i1 %211, label %212, label %253
212: ; preds = %208
store i32 1, i32* %9
br label %213
213: ; preds = %246, %212
%214 = load i32, i32* %9
%215 = load i32, i32* %10
%216 = icmp slt i32 %214, %215
br i1 %216, label %217, label %249
217: ; preds = %213
%218 = load double**, double*** %7
%219 = load i32, i32* %9
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double*, double** %218, i64 %220
%222 = load double*, double** %221
%223 = load i32, i32* %8
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = load double**, double*** %7
%228 = load i32, i32* %9
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds double*, double** %227, i64 %229
%231 = load double*, double** %230
%232 = load i32, i32* %8
%233 = sub nsw i32 %232, 1
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %231, i64 %234
%236 = load double, double* %235
%237 = fadd double %226, %236
%238 = load double**, double*** %7
%239 = load i32, i32* %9
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double*, double** %238, i64 %240
%242 = load double*, double** %241
%243 = load i32, i32* %8
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %242, i64 %244
store double %237, double* %245
br label %246
246: ; preds = %217
%247 = load i32, i32* %9
%248 = add nsw i32 %247, 1
store i32 %248, i32* %9
br label %213
249: ; preds = %213
br label %250
250: ; preds = %249
%251 = load i32, i32* %8
%252 = add nsw i32 %251, 1
store i32 %252, i32* %8
br label %208
253: ; preds = %208
store i32 0, i32* %9
br label %254
254: ; preds = %291, %253
%255 = load i32, i32* %9
%256 = load i32, i32* %10
%257 = icmp slt i32 %255, %256
br i1 %257, label %258, label %294
258: ; preds = %254
store i32 0, i32* %8
br label %259
259: ; preds = %287, %258
%260 = load i32, i32* %8
%261 = load i32, i32* %10
%262 = icmp slt i32 %260, %261
br i1 %262, label %263, label %290
263: ; preds = %259
%264 = load double**, double*** %7
%265 = load i32, i32* %9
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double*, double** %264, i64 %266
%268 = load double*, double** %267
%269 = load i32, i32* %8
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds double, double* %268, i64 %270
%272 = load double, double* %271
%273 = load double**, double*** %6
%274 = load i32, i32* %9
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds double*, double** %273, i64 %275
%277 = load double*, double** %276
%278 = load i32, i32* %8
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %277, i64 %279
%281 = load double, double* %280
%282 = fcmp oeq double %272, %281
br i1 %282, label %283, label %284
283: ; preds = %263
br label %287
284: ; preds = %263
%285 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.9, i64 0, i64 0))
%286 = call i32 @exit(i32 1)
unreachable
287: ; preds = %283
%288 = load i32, i32* %8
%289 = add nsw i32 %288, 1
store i32 %289, i32* %8
br label %259
290: ; preds = %259
br label %291
291: ; preds = %290
%292 = load i32, i32* %9
%293 = add nsw i32 %292, 1
store i32 %293, i32* %9
br label %254
294: ; preds = %254
%295 = load i32, i32* %12
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 %295)
%297 = load i32, i32* %10
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %297)
%299 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.4, i64 0, i64 0))
%301 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%302 = load double**, double*** %6
%303 = call i32 @free(double** %302)
%304 = load double**, double*** %7
%305 = call i32 @free(double** %304)
%306 = load i32, i32* %3
ret i32 %306
}

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 = [80 x i8] c"\0A\09\09 Objective : Parallization of a loop nest contating a recurrence relation.\0A \00"
@.str.3 = [60 x i8] c"\0A\09\09 Demonstrates the use of OpenMP Parallel for directive \00"
@.str.5 = [24 x i8] c"\09\09 Very Few Arguments\0A \00"
@.str.10 = [22 x i8] c"\0A\0A\09\09 Threads : %d\00"
@.str.11 = [22 x i8] c"\0A\09\09 Matrix Size : %d \00"
@str.14 = [48 x i8] c"\0A\0A\09\09 Serial And Parallel Calculation Are Same. \00"
@str.15 = [78 x i8] c"\0A\09\09..........................................................................\00"
@str.16 = [69 x i8] c"\0A\09\09 The result of the serial and parallel calculation are not Equal \00"
@str.17 = [43 x i8] c"\0A\09\09 Array Size Should Be Of Positive Sign \00"
@str.18 = [76 x i8] c"\0A Number of threads should be 1,2,4,8 or 16 for the execution of program. \0A\00"
@str.19 = [41 x i8] c"\09\09 Syntax : exec <Threads> <matrix-size>\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 ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.15, i64 0, i64 0))
%9 = icmp eq i32 %0, 3
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.19, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
switch i32 %17, label %21 [
i32 16, label %24
i32 8, label %24
i32 4, label %24
i32 2, label %24
i32 1, label %24
]
21: ; preds = %14
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.18, i64 0, i64 0))
%23 = tail call i32 @exit(i32 -1)
unreachable
24: ; preds = %14, %14, %14, %14, %14
%25 = icmp slt i32 %20, 1
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.17, i64 0, i64 0))
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %24
%30 = shl i32 %20, 3
%31 = tail call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to double**
%33 = tail call i64 @malloc(i32 %30)
%34 = inttoptr i64 %33 to double**
%35 = zext i32 %20 to i64
%36 = icmp ult i32 %20, 4
%37 = and i64 %35, 4294967292
%38 = icmp eq i64 %37, %35
br label %59
39: ; preds = %97
%40 = icmp sgt i32 %20, 0
br i1 %40, label %43, label %41
41: ; preds = %39
%42 = tail call i32 @omp_set_num_threads(i32 %17)
unreachable
43: ; preds = %39
%44 = zext i32 %20 to i64
%45 = and i64 %35, 4294967292
%46 = add nsw i64 %45, -4
%47 = lshr exact i64 %46, 2
%48 = add nuw nsw i64 %47, 1
%49 = add nsw i64 %35, -1
%50 = icmp ult i32 %20, 4
%51 = and i64 %35, 4294967292
%52 = and i64 %48, 3
%53 = icmp ult i64 %46, 12
%54 = and i64 %48, 9223372036854775804
%55 = icmp eq i64 %52, 0
%56 = icmp eq i64 %51, %35
%57 = and i64 %35, 3
%58 = icmp eq i64 %57, 0
br label %100
59: ; preds = %29, %97
%60 = phi i64 [ 0, %29 ], [ %98, %97 ]
%61 = tail call i64 @malloc(i32 %30)
%62 = inttoptr i64 %61 to double*
%63 = getelementptr inbounds double*, double** %32, i64 %60
store double* %62, double** %63
br i1 %36, label %87, label %64
64: ; preds = %59
%65 = insertelement <2 x i64> poison, i64 %60, i64 0
%66 = shufflevector <2 x i64> %65, <2 x i64> poison, <2 x i32> zeroinitializer
%67 = add nuw i64 %60, 2
%68 = insertelement <2 x i64> poison, i64 %67, i64 0
%69 = shufflevector <2 x i64> %68, <2 x i64> poison, <2 x i32> zeroinitializer
br label %70
70: ; preds = %70, %64
%71 = phi i64 [ 0, %64 ], [ %83, %70 ]
%72 = phi <2 x i64> [ <i64 0, i64 1>, %64 ], [ %84, %70 ]
%73 = add nuw nsw <2 x i64> %72, %66
%74 = add <2 x i64> %69, %72
%75 = trunc <2 x i64> %73 to <2 x i32>
%76 = trunc <2 x i64> %74 to <2 x i32>
%77 = sitofp <2 x i32> %75 to <2 x double>
%78 = sitofp <2 x i32> %76 to <2 x double>
%79 = getelementptr inbounds double, double* %62, i64 %71
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> %77, <2 x double>* %80
%81 = getelementptr inbounds double, double* %79, i64 2
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %78, <2 x double>* %82
%83 = add nuw i64 %71, 4
%84 = add <2 x i64> %72, <i64 4, i64 4>
%85 = icmp eq i64 %83, %37
br i1 %85, label %86, label %70
86: ; preds = %70
br i1 %38, label %97, label %87
87: ; preds = %59, %86
%88 = phi i64 [ 0, %59 ], [ %37, %86 ]
br label %89
89: ; preds = %87, %89
%90 = phi i64 [ %95, %89 ], [ %88, %87 ]
%91 = add nuw nsw i64 %90, %60
%92 = trunc i64 %91 to i32
%93 = sitofp i32 %92 to double
%94 = getelementptr inbounds double, double* %62, i64 %90
store double %93, double* %94
%95 = add nuw nsw i64 %90, 1
%96 = icmp eq i64 %95, %35
br i1 %96, label %97, label %89
97: ; preds = %89, %86
%98 = add nuw nsw i64 %60, 1
%99 = icmp eq i64 %98, %35
br i1 %99, label %39, label %59
100: ; preds = %218, %43
%101 = phi i64 [ 0, %43 ], [ %219, %218 ]
%102 = tail call i64 @malloc(i32 %30)
%103 = inttoptr i64 %102 to double*
%104 = getelementptr inbounds double*, double** %34, i64 %101
store double* %103, double** %104
%105 = getelementptr inbounds double*, double** %32, i64 %101
%106 = load double*, double** %105
br i1 %50, label %184, label %107
107: ; preds = %100
%108 = inttoptr i64 %102 to i8*
%109 = getelementptr double, double* %103, i64 %35
%110 = getelementptr double, double* %106, i64 %35
%111 = bitcast double* %110 to i8*
%112 = icmp ult i8* %108, %111
%113 = icmp ult double* %106, %109
%114 = and i1 %112, %113
br i1 %114, label %184, label %115
115: ; preds = %107
br i1 %53, label %165, label %116
116: ; preds = %115, %116
%117 = phi i64 [ %162, %116 ], [ 0, %115 ]
%118 = phi i64 [ %163, %116 ], [ 0, %115 ]
%119 = getelementptr inbounds double, double* %106, i64 %117
%120 = bitcast double* %119 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = getelementptr inbounds double, double* %119, i64 2
%123 = bitcast double* %122 to <2 x double>*
%124 = load <2 x double>, <2 x double>* %123
%125 = getelementptr inbounds double, double* %103, i64 %117
%126 = bitcast double* %125 to <2 x double>*
store <2 x double> %121, <2 x double>* %126
%127 = getelementptr inbounds double, double* %125, i64 2
%128 = bitcast double* %127 to <2 x double>*
store <2 x double> %124, <2 x double>* %128
%129 = or i64 %117, 4
%130 = getelementptr inbounds double, double* %106, i64 %129
%131 = bitcast double* %130 to <2 x double>*
%132 = load <2 x double>, <2 x double>* %131
%133 = getelementptr inbounds double, double* %130, i64 2
%134 = bitcast double* %133 to <2 x double>*
%135 = load <2 x double>, <2 x double>* %134
%136 = getelementptr inbounds double, double* %103, i64 %129
%137 = bitcast double* %136 to <2 x double>*
store <2 x double> %132, <2 x double>* %137
%138 = getelementptr inbounds double, double* %136, i64 2
%139 = bitcast double* %138 to <2 x double>*
store <2 x double> %135, <2 x double>* %139
%140 = or i64 %117, 8
%141 = getelementptr inbounds double, double* %106, i64 %140
%142 = bitcast double* %141 to <2 x double>*
%143 = load <2 x double>, <2 x double>* %142
%144 = getelementptr inbounds double, double* %141, i64 2
%145 = bitcast double* %144 to <2 x double>*
%146 = load <2 x double>, <2 x double>* %145
%147 = getelementptr inbounds double, double* %103, i64 %140
%148 = bitcast double* %147 to <2 x double>*
store <2 x double> %143, <2 x double>* %148
%149 = getelementptr inbounds double, double* %147, i64 2
%150 = bitcast double* %149 to <2 x double>*
store <2 x double> %146, <2 x double>* %150
%151 = or i64 %117, 12
%152 = getelementptr inbounds double, double* %106, i64 %151
%153 = bitcast double* %152 to <2 x double>*
%154 = load <2 x double>, <2 x double>* %153
%155 = getelementptr inbounds double, double* %152, i64 2
%156 = bitcast double* %155 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = getelementptr inbounds double, double* %103, i64 %151
%159 = bitcast double* %158 to <2 x double>*
store <2 x double> %154, <2 x double>* %159
%160 = getelementptr inbounds double, double* %158, i64 2
%161 = bitcast double* %160 to <2 x double>*
store <2 x double> %157, <2 x double>* %161
%162 = add nuw i64 %117, 16
%163 = add nuw i64 %118, 4
%164 = icmp eq i64 %163, %54
br i1 %164, label %165, label %116
165: ; preds = %116, %115
%166 = phi i64 [ 0, %115 ], [ %162, %116 ]
br i1 %55, label %183, label %167
167: ; preds = %165, %167
%168 = phi i64 [ %180, %167 ], [ %166, %165 ]
%169 = phi i64 [ %181, %167 ], [ 0, %165 ]
%170 = getelementptr inbounds double, double* %106, i64 %168
%171 = bitcast double* %170 to <2 x double>*
%172 = load <2 x double>, <2 x double>* %171
%173 = getelementptr inbounds double, double* %170, i64 2
%174 = bitcast double* %173 to <2 x double>*
%175 = load <2 x double>, <2 x double>* %174
%176 = getelementptr inbounds double, double* %103, i64 %168
%177 = bitcast double* %176 to <2 x double>*
store <2 x double> %172, <2 x double>* %177
%178 = getelementptr inbounds double, double* %176, i64 2
%179 = bitcast double* %178 to <2 x double>*
store <2 x double> %175, <2 x double>* %179
%180 = add nuw i64 %168, 4
%181 = add i64 %169, 1
%182 = icmp eq i64 %181, %52
br i1 %182, label %183, label %167
183: ; preds = %167, %165
br i1 %56, label %218, label %184
184: ; preds = %107, %100, %183
%185 = phi i64 [ 0, %107 ], [ 0, %100 ], [ %51, %183 ]
%186 = sub nsw i64 %49, %185
br i1 %58, label %196, label %187
187: ; preds = %184, %187
%188 = phi i64 [ %193, %187 ], [ %185, %184 ]
%189 = phi i64 [ %194, %187 ], [ 0, %184 ]
%190 = getelementptr inbounds double, double* %106, i64 %188
%191 = load double, double* %190
%192 = getelementptr inbounds double, double* %103, i64 %188
store double %191, double* %192
%193 = add nuw nsw i64 %188, 1
%194 = add i64 %189, 1
%195 = icmp eq i64 %194, %57
br i1 %195, label %196, label %187
196: ; preds = %187, %184
%197 = phi i64 [ %185, %184 ], [ %193, %187 ]
%198 = icmp ult i64 %186, 3
br i1 %198, label %218, label %199
199: ; preds = %196, %199
%200 = phi i64 [ %216, %199 ], [ %197, %196 ]
%201 = getelementptr inbounds double, double* %106, i64 %200
%202 = load double, double* %201
%203 = getelementptr inbounds double, double* %103, i64 %200
store double %202, double* %203
%204 = add nuw nsw i64 %200, 1
%205 = getelementptr inbounds double, double* %106, i64 %204
%206 = load double, double* %205
%207 = getelementptr inbounds double, double* %103, i64 %204
store double %206, double* %207
%208 = add nuw nsw i64 %200, 2
%209 = getelementptr inbounds double, double* %106, i64 %208
%210 = load double, double* %209
%211 = getelementptr inbounds double, double* %103, i64 %208
store double %210, double* %211
%212 = add nuw nsw i64 %200, 3
%213 = getelementptr inbounds double, double* %106, i64 %212
%214 = load double, double* %213
%215 = getelementptr inbounds double, double* %103, i64 %212
store double %214, double* %215
%216 = add nuw nsw i64 %200, 4
%217 = icmp eq i64 %216, %44
br i1 %217, label %218, label %199
218: ; preds = %196, %199, %183
%219 = add nuw nsw i64 %101, 1
%220 = icmp eq i64 %219, %44
br i1 %220, label %221, label %100
221: ; preds = %218
%222 = tail call i32 @omp_set_num_threads(i32 %17)
%223 = icmp sgt i32 %20, 1
br i1 %223, label %224, label %261
224: ; preds = %221
%225 = zext i32 %20 to i64
br label %226
226: ; preds = %255, %224
%227 = phi i64 [ 1, %224 ], [ %256, %255 ]
%228 = phi i32 [ undef, %224 ], [ %245, %255 ]
%229 = add nsw i64 %227, -1
br label %237
230: ; preds = %255
br i1 %223, label %231, label %261
231: ; preds = %230
%232 = zext i32 %20 to i64
%233 = and i64 %49, 1
%234 = icmp eq i32 %20, 2
%235 = and i64 %49, -2
%236 = icmp eq i64 %233, 0
br label %258
237: ; preds = %226, %244
%238 = phi i64 [ 1, %226 ], [ %253, %244 ]
%239 = phi i32 [ %228, %226 ], [ %245, %244 ]
%240 = tail call i64 (...) @omp_get_thread_num()
%241 = icmp eq i64 %240, 0
br i1 %241, label %242, label %244
242: ; preds = %237
%243 = tail call i32 (...) @omp_get_num_threads()
br label %244
244: ; preds = %242, %237
%245 = phi i32 [ %243, %242 ], [ %239, %237 ]
%246 = getelementptr inbounds double*, double** %32, i64 %238
%247 = load double*, double** %246
%248 = getelementptr inbounds double, double* %247, i64 %227
%249 = load double, double* %248
%250 = getelementptr inbounds double, double* %247, i64 %229
%251 = load double, double* %250
%252 = fadd double %249, %251
store double %252, double* %248
%253 = add nuw nsw i64 %238, 1
%254 = icmp eq i64 %253, %225
br i1 %254, label %255, label %237
255: ; preds = %244
%256 = add nuw nsw i64 %227, 1
%257 = icmp eq i64 %256, %225
br i1 %257, label %230, label %226
258: ; preds = %296, %231
%259 = phi i64 [ 1, %231 ], [ %297, %296 ]
%260 = add nsw i64 %259, -1
br i1 %234, label %286, label %265
261: ; preds = %296, %221, %230
%262 = phi i32 [ %245, %230 ], [ undef, %221 ], [ %245, %296 ]
br i1 %40, label %263, label %321
263: ; preds = %261
%264 = zext i32 %20 to i64
br label %299
265: ; preds = %258, %265
%266 = phi i64 [ %283, %265 ], [ 1, %258 ]
%267 = phi i64 [ %284, %265 ], [ 0, %258 ]
%268 = getelementptr inbounds double*, double** %34, i64 %266
%269 = load double*, double** %268
%270 = getelementptr inbounds double, double* %269, i64 %259
%271 = load double, double* %270
%272 = getelementptr inbounds double, double* %269, i64 %260
%273 = load double, double* %272
%274 = fadd double %271, %273
store double %274, double* %270
%275 = add nuw nsw i64 %266, 1
%276 = getelementptr inbounds double*, double** %34, i64 %275
%277 = load double*, double** %276
%278 = getelementptr inbounds double, double* %277, i64 %259
%279 = load double, double* %278
%280 = getelementptr inbounds double, double* %277, i64 %260
%281 = load double, double* %280
%282 = fadd double %279, %281
store double %282, double* %278
%283 = add nuw nsw i64 %266, 2
%284 = add i64 %267, 2
%285 = icmp eq i64 %284, %235
br i1 %285, label %286, label %265
286: ; preds = %265, %258
%287 = phi i64 [ 1, %258 ], [ %283, %265 ]
br i1 %236, label %296, label %288
288: ; preds = %286
%289 = getelementptr inbounds double*, double** %34, i64 %287
%290 = load double*, double** %289
%291 = getelementptr inbounds double, double* %290, i64 %259
%292 = load double, double* %291
%293 = getelementptr inbounds double, double* %290, i64 %260
%294 = load double, double* %293
%295 = fadd double %292, %294
store double %295, double* %291
br label %296
296: ; preds = %286, %288
%297 = add nuw nsw i64 %259, 1
%298 = icmp eq i64 %297, %232
br i1 %298, label %261, label %258
299: ; preds = %318, %263
%300 = phi i64 [ 0, %263 ], [ %319, %318 ]
%301 = getelementptr inbounds double*, double** %34, i64 %300
%302 = load double*, double** %301
%303 = getelementptr inbounds double*, double** %32, i64 %300
%304 = load double*, double** %303
br label %307
305: ; preds = %307
%306 = icmp eq i64 %314, %264
br i1 %306, label %318, label %307
307: ; preds = %299, %305
%308 = phi i64 [ 0, %299 ], [ %314, %305 ]
%309 = getelementptr inbounds double, double* %302, i64 %308
%310 = load double, double* %309
%311 = getelementptr inbounds double, double* %304, i64 %308
%312 = load double, double* %311
%313 = fcmp oeq double %310, %312
%314 = add nuw nsw i64 %308, 1
br i1 %313, label %305, label %315
315: ; preds = %307
%316 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.16, i64 0, i64 0))
%317 = tail call i32 @exit(i32 1)
unreachable
318: ; preds = %305
%319 = add nuw nsw i64 %300, 1
%320 = icmp eq i64 %319, %264
br i1 %320, label %321, label %299
321: ; preds = %318, %261
%322 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 %262)
%323 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %20)
%324 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.14, i64 0, i64 0))
%325 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.15, i64 0, i64 0))
%326 = tail call i32 @putchar(i32 10)
%327 = tail call i32 @free(double** %32)
%328 = tail call i32 @free(double** %34)
ret i32 0
}