#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 omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int tid, nthreads, i, j, k, chunk;
  double a[62][15], b[15][7], c[62][7];
  chunk = 10;
#pragma omp parallel shared(a, b, c, nthreads, chunk) private(tid, i, j, k)
  {
    tid = omp_get_thread_num();
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Starting matrix multiple example with %d threads\n", nthreads);
      printf("Initializing matrices...\n");
    }
#pragma omp for schedule(static, chunk)
    for (i = 0; i < 62; i++)
      for (j = 0; j < 15; j++)
        a[i][j] = i + j;
#pragma omp for schedule(static, chunk)
    for (i = 0; i < 15; i++)
      for (j = 0; j < 7; j++)
        b[i][j] = i * j;
#pragma omp for schedule(static, chunk)
    for (i = 0; i < 62; i++)
      for (j = 0; j < 7; j++)
        c[i][j] = 0;
    printf("Thread %d starting matrix multiply...\n", tid);
#pragma omp for schedule(static, chunk)
    for (i = 0; i < 62; i++) {
      printf("Thread=%d did row=%d\n", tid, i);
      for (j = 0; j < 7; j++)
        for (k = 0; k < 15; k++)
          c[i][j] += a[i][k] * b[k][j];
    }
  }
  printf("******************************************************\n");
  printf("Result Matrix:\n");
  for (i = 0; i < 62; i++) {
    for (j = 0; j < 7; j++)
      printf("%6.2f   ", c[i][j]);
    printf("\n");
  }
  printf("******************************************************\n");
  printf("Done.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2e20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x28(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    118d <main+0x5d>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e,-0x1c(%rbp)
jge    11f5 <main+0xc5>
movl   $0x0,-0x20(%rbp)
cmpl   $0xf,-0x20(%rbp)
jge    11e2 <main+0xb2>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x1d40(%rbp),%rax
imul   $0x78,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a5 <main+0x75>
jmp    11e7 <main+0xb7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1194 <main+0x64>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jge    125e <main+0x12e>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    124b <main+0x11b>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x2090(%rbp),%rax
imul   $0x38,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    120d <main+0xdd>
jmp    1250 <main+0x120>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11fc <main+0xcc>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e,-0x1c(%rbp)
jge    12bf <main+0x18f>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    12ac <main+0x17c>
movslq -0x1c(%rbp),%rcx
lea    -0x2e20(%rbp),%rax
imul   $0x38,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1276 <main+0x146>
jmp    12b1 <main+0x181>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1265 <main+0x135>
mov    -0x14(%rbp),%esi
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e,-0x1c(%rbp)
jge    13a9 <main+0x279>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    1396 <main+0x266>
movl   $0x0,-0x24(%rbp)
cmpl   $0xf,-0x24(%rbp)
jge    1383 <main+0x253>
movslq -0x1c(%rbp),%rcx
lea    -0x1d40(%rbp),%rax
imul   $0x78,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x24(%rbp),%rcx
lea    -0x2090(%rbp),%rax
imul   $0x38,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x1c(%rbp),%rcx
lea    -0x2e20(%rbp),%rax
imul   $0x38,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    130d <main+0x1dd>
jmp    1388 <main+0x258>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12fc <main+0x1cc>
jmp    139b <main+0x26b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12d7 <main+0x1a7>
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e,-0x1c(%rbp)
jge    143a <main+0x30a>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    141e <main+0x2ee>
movslq -0x1c(%rbp),%rcx
lea    -0x2e20(%rbp),%rax
imul   $0x38,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xcc8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13dd <main+0x2ad>
lea    0xc9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13cc <main+0x29c>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2e20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x2e08,%rsp
xor    %eax,%eax
call   1050 <omp_get_thread_num@plt>
mov    %eax,%r15d
test   %eax,%eax
jne    119e <main+0x3e>
xor    %eax,%eax
call   1080 <omp_get_num_threads@plt>
lea    0xed7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf8b(%rip),%rdi
call   1040 <puts@plt>
mov    $0xe,%eax
lea    0x10f0(%rsp),%rcx
xor    %esi,%esi
movdqa 0xe4a(%rip),%xmm8
movdqa 0xe52(%rip),%xmm1
movdqa 0xe5a(%rip),%xmm2
movdqa 0xe62(%rip),%xmm3
movdqa 0xe6a(%rip),%xmm4
movdqa 0xe72(%rip),%xmm5
xchg   %ax,%ax
lea    -0xe(%rax),%edx
xorps  %xmm6,%xmm6
cvtsi2sd %edx,%xmm6
movsd  %xmm6,(%rcx)
movd   %esi,%xmm6
lea    0x1(%rsi),%rdx
xorps  %xmm7,%xmm7
cvtsi2sd %edx,%xmm7
pshufd $0x50,%xmm6,%xmm0
movdqa %xmm0,%xmm6
paddd  %xmm8,%xmm6
cvtdq2pd %xmm6,%xmm6
movsd  %xmm7,0x8(%rcx)
movdqa %xmm0,%xmm7
paddd  %xmm1,%xmm7
cvtdq2pd %xmm7,%xmm7
movups %xmm6,0x10(%rcx)
movdqa %xmm0,%xmm6
paddd  %xmm2,%xmm6
cvtdq2pd %xmm6,%xmm6
movups %xmm7,0x20(%rcx)
movdqa %xmm0,%xmm7
paddd  %xmm3,%xmm7
cvtdq2pd %xmm7,%xmm7
movups %xmm6,0x30(%rcx)
movdqa %xmm0,%xmm6
paddd  %xmm4,%xmm6
cvtdq2pd %xmm6,%xmm6
movupd %xmm7,0x40(%rcx)
paddd  %xmm5,%xmm0
cvtdq2pd %xmm0,%xmm0
movupd %xmm6,0x50(%rcx)
movups %xmm0,0x60(%rcx)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x70(%rcx)
add    $0x1,%eax
add    $0x78,%rcx
mov    %rdx,%rsi
cmp    $0x3e,%rdx
jne    11e0 <main+0x80>
xor    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
xor    %esi,%esi
xor    %edi,%edi
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,0x10(%rsp,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x18(%rsp,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,0x20(%rsp,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  %xmm0,0x28(%rsp,%rax,1)
movsd  %xmm1,0x30(%rsp,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x38(%rsp,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x40(%rsp,%rax,1)
add    $0x6,%ebx
add    $0x5,%ebp
add    $0x4,%edi
add    $0x3,%esi
add    $0x2,%edx
add    $0x1,%ecx
add    $0x38,%rax
cmp    $0x348,%rax
jne    12a0 <main+0x140>
lea    0x360(%rsp),%rbx
mov    $0xd90,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xd5f(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd75(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
imul   $0x78,%rbp,%rax
movsd  0x10f0(%rsp,%rax,1),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10f8(%rsp,%rax,1),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x1100(%rsp,%rax,1),%xmm10
movsd  0x1108(%rsp,%rax,1),%xmm11
movsd  0x1110(%rsp,%rax,1),%xmm12
movsd  0x1118(%rsp,%rax,1),%xmm13
movsd  0x1120(%rsp,%rax,1),%xmm14
movsd  0x1128(%rsp,%rax,1),%xmm15
movsd  0x1130(%rsp,%rax,1),%xmm9
movsd  0x1138(%rsp,%rax,1),%xmm1
movsd  0x1140(%rsp,%rax,1),%xmm2
movsd  0x1148(%rsp,%rax,1),%xmm3
movsd  0x1150(%rsp,%rax,1),%xmm4
movsd  0x1158(%rsp,%rax,1),%xmm5
movsd  0x1160(%rsp,%rax,1),%xmm6
xor    %eax,%eax
xchg   %ax,%ax
movsd  0x10(%rsp,%rax,8),%xmm7
mulsd  0x8(%rsp),%xmm7
addsd  (%rbx,%rax,8),%xmm7
movsd  0x48(%rsp,%rax,8),%xmm8
mulsd  (%rsp),%xmm8
addsd  %xmm7,%xmm8
movsd  0x80(%rsp,%rax,8),%xmm7
mulsd  %xmm10,%xmm7
addsd  %xmm8,%xmm7
movsd  0xb8(%rsp,%rax,8),%xmm0
mulsd  %xmm11,%xmm0
addsd  %xmm7,%xmm0
movsd  0xf0(%rsp,%rax,8),%xmm7
mulsd  %xmm12,%xmm7
addsd  %xmm0,%xmm7
movsd  0x128(%rsp,%rax,8),%xmm0
mulsd  %xmm13,%xmm0
addsd  %xmm7,%xmm0
movsd  0x160(%rsp,%rax,8),%xmm7
mulsd  %xmm14,%xmm7
addsd  %xmm0,%xmm7
movsd  0x198(%rsp,%rax,8),%xmm0
mulsd  %xmm15,%xmm0
addsd  %xmm7,%xmm0
movsd  0x1d0(%rsp,%rax,8),%xmm7
mulsd  %xmm9,%xmm7
addsd  %xmm0,%xmm7
movsd  0x208(%rsp,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm7,%xmm0
movsd  0x240(%rsp,%rax,8),%xmm7
mulsd  %xmm2,%xmm7
addsd  %xmm0,%xmm7
movsd  0x278(%rsp,%rax,8),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm7,%xmm0
movsd  0x2b0(%rsp,%rax,8),%xmm7
mulsd  %xmm4,%xmm7
addsd  %xmm0,%xmm7
movsd  0x2e8(%rsp,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm7,%xmm0
movsd  0x320(%rsp,%rax,8),%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm0,%xmm7
movsd  %xmm7,(%rbx,%rax,8)
add    $0x1,%rax
cmp    $0x7,%rax
jne    1400 <main+0x2a0>
add    $0x1,%rbp
add    $0x38,%rbx
cmp    $0x3e,%rbp
jne    1350 <main+0x1f0>
lea    0xbb3(%rip),%rdi
call   1040 <puts@plt>
lea    0xb98(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30,%ebp
lea    0xb7e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x330(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x338(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x340(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x348(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x350(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x358(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x360(%rsp,%rbp,1),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x38,%rbp
cmp    $0xdc0,%rbp
jne    1560 <main+0x400>
lea    0xae0(%rip),%rdi
call   1040 <puts@plt>
lea    0xb0b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x2e08,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Starting matrix multiple example with %d threads\0A\00"
@.str.1 = [26 x i8] c"Initializing matrices...\0A\00"
@.str.2 = [39 x i8] c"Thread %d starting matrix multiply...\0A\00"
@.str.3 = [22 x i8] c"Thread=%d did row=%d\0A\00"
@.str.4 = [56 x i8] c"******************************************************\0A\00"
@.str.5 = [16 x i8] c"Result Matrix:\0A\00"
@.str.6 = [9 x i8] c"%6.2f \00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [7 x i8] c"Done.\0A\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 [62 x [15 x double]]
%13 = alloca [15 x [7 x double]]
%14 = alloca [62 x [7 x double]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %11
%15 = call i32 (...) @omp_get_thread_num()
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = call i32 (...) @omp_get_num_threads()
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %18, %2
store i32 0, i32* %8
br label %24
24: ; preds = %46, %23
%25 = load i32, i32* %8
%26 = icmp slt i32 %25, 62
br i1 %26, label %27, label %49
27: ; preds = %24
store i32 0, i32* %9
br label %28
28: ; preds = %42, %27
%29 = load i32, i32* %9
%30 = icmp slt i32 %29, 15
br i1 %30, label %31, label %45
31: ; preds = %28
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = add nsw i32 %32, %33
%35 = sitofp i32 %34 to double
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [62 x [15 x double]], [62 x [15 x double]]* %12, i64 0, i64 %37
%39 = load i32, i32* %9
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [15 x double], [15 x double]* %38, i64 0, i64 %40
store double %35, double* %41
br label %42
42: ; preds = %31
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %28
45: ; preds = %28
br label %46
46: ; preds = %45
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %24
49: ; preds = %24
store i32 0, i32* %8
br label %50
50: ; preds = %72, %49
%51 = load i32, i32* %8
%52 = icmp slt i32 %51, 15
br i1 %52, label %53, label %75
53: ; preds = %50
store i32 0, i32* %9
br label %54
54: ; preds = %68, %53
%55 = load i32, i32* %9
%56 = icmp slt i32 %55, 7
br i1 %56, label %57, label %71
57: ; preds = %54
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = mul nsw i32 %58, %59
%61 = sitofp i32 %60 to double
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [15 x [7 x double]], [15 x [7 x double]]* %13, i64 0, i64 %63
%65 = load i32, i32* %9
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [7 x double], [7 x double]* %64, i64 0, i64 %66
store double %61, double* %67
br label %68
68: ; preds = %57
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 1
store i32 %70, i32* %9
br label %54
71: ; preds = %54
br label %72
72: ; preds = %71
%73 = load i32, i32* %8
%74 = add nsw i32 %73, 1
store i32 %74, i32* %8
br label %50
75: ; preds = %50
store i32 0, i32* %8
br label %76
76: ; preds = %94, %75
%77 = load i32, i32* %8
%78 = icmp slt i32 %77, 62
br i1 %78, label %79, label %97
79: ; preds = %76
store i32 0, i32* %9
br label %80
80: ; preds = %90, %79
%81 = load i32, i32* %9
%82 = icmp slt i32 %81, 7
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i32, i32* %8
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [62 x [7 x double]], [62 x [7 x double]]* %14, i64 0, i64 %85
%87 = load i32, i32* %9
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [7 x double], [7 x double]* %86, i64 0, i64 %88
store double 0.000000e+00, double* %89
br label %90
90: ; preds = %83
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %80
93: ; preds = %80
br label %94
94: ; preds = %93
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %76
97: ; preds = %76
%98 = load i32, i32* %6
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %98)
store i32 0, i32* %8
br label %100
100: ; preds = %145, %97
%101 = load i32, i32* %8
%102 = icmp slt i32 %101, 62
br i1 %102, label %103, label %148
103: ; preds = %100
%104 = load i32, i32* %6
%105 = load i32, i32* %8
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %104, i32 %105)
store i32 0, i32* %9
br label %107
107: ; preds = %141, %103
%108 = load i32, i32* %9
%109 = icmp slt i32 %108, 7
br i1 %109, label %110, label %144
110: ; preds = %107
store i32 0, i32* %10
br label %111
111: ; preds = %137, %110
%112 = load i32, i32* %10
%113 = icmp slt i32 %112, 15
br i1 %113, label %114, label %140
114: ; preds = %111
%115 = load i32, i32* %8
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [62 x [15 x double]], [62 x [15 x double]]* %12, i64 0, i64 %116
%118 = load i32, i32* %10
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [15 x double], [15 x double]* %117, i64 0, i64 %119
%121 = load double, double* %120
%122 = load i32, i32* %10
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [15 x [7 x double]], [15 x [7 x double]]* %13, i64 0, i64 %123
%125 = load i32, i32* %9
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [7 x double], [7 x double]* %124, i64 0, i64 %126
%128 = load double, double* %127
%129 = load i32, i32* %8
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [62 x [7 x double]], [62 x [7 x double]]* %14, i64 0, i64 %130
%132 = load i32, i32* %9
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [7 x double], [7 x double]* %131, i64 0, i64 %133
%135 = load double, double* %134
%136 = call double @llvm.fmuladd.f64(double %121, double %128, double %135)
store double %136, double* %134
br label %137
137: ; preds = %114
%138 = load i32, i32* %10
%139 = add nsw i32 %138, 1
store i32 %139, i32* %10
br label %111
140: ; preds = %111
br label %141
141: ; preds = %140
%142 = load i32, i32* %9
%143 = add nsw i32 %142, 1
store i32 %143, i32* %9
br label %107
144: ; preds = %107
br label %145
145: ; preds = %144
%146 = load i32, i32* %8
%147 = add nsw i32 %146, 1
store i32 %147, i32* %8
br label %100
148: ; preds = %100
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %8
br label %151
151: ; preds = %172, %148
%152 = load i32, i32* %8
%153 = icmp slt i32 %152, 62
br i1 %153, label %154, label %175
154: ; preds = %151
store i32 0, i32* %9
br label %155
155: ; preds = %167, %154
%156 = load i32, i32* %9
%157 = icmp slt i32 %156, 7
br i1 %157, label %158, label %170
158: ; preds = %155
%159 = load i32, i32* %8
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [62 x [7 x double]], [62 x [7 x double]]* %14, i64 0, i64 %160
%162 = load i32, i32* %9
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [7 x double], [7 x double]* %161, i64 0, i64 %163
%165 = load double, double* %164
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %165)
br label %167
167: ; preds = %158
%168 = load i32, i32* %9
%169 = add nsw i32 %168, 1
store i32 %169, i32* %9
br label %155
170: ; preds = %155
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %172
172: ; preds = %170
%173 = load i32, i32* %8
%174 = add nsw i32 %173, 1
store i32 %174, i32* %8
br label %151
175: ; preds = %151
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%178 = load i32, i32* %3
ret i32 %178
}

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