#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 /*<<< orphan*/ free2D(double **);
scalar_t__ malloc(int);
void populate2Dmatrix(double **m, int size) {
  int i, j;
  double **aux;
  aux = (double **)malloc(size * sizeof(double *));
  for (i = 0; i < size; i++) {
    aux[i] = (double *)malloc(size * sizeof(double));
    for (j = 0; j <= i; j++) {
      m[i][j] = (double)(-j % size) / size + 1;
    }
    for (j = i + 1; j < size; j++) {
      m[i][j] = 0;
    }
    m[i][i] = 1;
  }
  int r, s, t;
  for (r = 0; r < size; ++r)
    for (s = 0; s < size; ++s)
      aux[r][s] = 0;
  for (t = 0; t < size; ++t)
    for (r = 0; r < size; ++r)
      for (s = 0; s < size; ++s)
        aux[r][s] += m[r][t] * m[s][t];
  for (r = 0; r < size; ++r)
    for (s = 0; s < size; ++s) {
      m[r][s] = aux[r][s];
    }
  free2D(aux);
}


x86 assembly (clang, -O0):
<populate2Dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1231 <populate2Dmatrix+0x111>
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11cb <populate2Dmatrix+0xab>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2sd %edx,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe5c(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117a <populate2Dmatrix+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1206 <populate2Dmatrix+0xe6>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d4 <populate2Dmatrix+0xb4>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  0xde2(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <populate2Dmatrix+0x29>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1290 <populate2Dmatrix+0x170>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127d <populate2Dmatrix+0x15d>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    124b <populate2Dmatrix+0x12b>
jmp    1282 <populate2Dmatrix+0x162>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1238 <populate2Dmatrix+0x118>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1349 <populate2Dmatrix+0x229>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1336 <populate2Dmatrix+0x216>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1323 <populate2Dmatrix+0x203>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12bd <populate2Dmatrix+0x19d>
jmp    1328 <populate2Dmatrix+0x208>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12aa <populate2Dmatrix+0x18a>
jmp    133b <populate2Dmatrix+0x21b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1297 <populate2Dmatrix+0x177>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13ba <populate2Dmatrix+0x29a>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13a7 <populate2Dmatrix+0x287>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1363 <populate2Dmatrix+0x243>
jmp    13ac <populate2Dmatrix+0x28c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1350 <populate2Dmatrix+0x230>
mov    -0x20(%rbp),%rdi
call   1040 <free2D@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate2Dmatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,8),%edi
mov    %edi,0x2c(%rsp)
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %ebx,%ebx
jle    15e1 <populate2Dmatrix+0x4b1>
cvtsi2sd %ebx,%xmm1
lea    -0x2(%rbx),%eax
mov    %eax,0x28(%rsp)
mov    %ebx,%r15d
mov    $0x1,%r12d
xor    %eax,%eax
mov    %rbx,0x10(%rsp)
movsd  %xmm1,0x30(%rsp)
jmp    11ac <populate2Dmatrix+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x0(%rbp,%r13,8)
add    $0x1,%r12
cmp    %r15,%rax
je     1259 <populate2Dmatrix+0x129>
mov    %rax,%r13
add    $0x1,%rax
mov    %rax,0x18(%rsp)
mov    0x28(%rsp),%eax
sub    %r13d,%eax
lea    0x8(,%rax,8),%rax
mov    %rax,0x20(%rsp)
mov    0x2c(%rsp),%edi
call   1040 <malloc@plt>
movsd  0xe23(%rip),%xmm2
movsd  0x30(%rsp),%xmm1
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%r13,8)
mov    (%r14,%r13,8),%rbp
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %ebx
neg    %edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r12
jne    1200 <populate2Dmatrix+0xd0>
mov    0x18(%rsp),%rax
cmp    %r15,%rax
jae    1190 <populate2Dmatrix+0x60>
lea    0x0(,%rax,8),%rdi
add    %rbp,%rdi
xor    %esi,%esi
mov    0x20(%rsp),%rdx
call   1030 <memset@plt>
mov    0x18(%rsp),%rax
mov    0x10(%rsp),%rbx
jmp    1190 <populate2Dmatrix+0x60>
test   %ebx,%ebx
jle    15e1 <populate2Dmatrix+0x4b1>
lea    0x0(,%r15,8),%rbp
lea    -0x1(%r15),%r13
mov    %r15d,%eax
and    $0x7,%eax
mov    %rax,0x18(%rsp)
cmp    $0x7,%r13
jae    1286 <populate2Dmatrix+0x156>
xor    %r12d,%r12d
jmp    1326 <populate2Dmatrix+0x1f6>
mov    %r15d,%eax
and    $0xfffffff8,%eax
mov    %rax,0x20(%rsp)
xor    %r12d,%r12d
mov    0x8(%rsp),%rbx
nopl   0x0(%rax)
mov    (%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x8(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x10(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x18(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x20(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x28(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x30(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    0x38(%rbx,%r12,8),%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
add    $0x8,%r12
cmp    %r12,0x20(%rsp)
jne    12a0 <populate2Dmatrix+0x170>
cmpq   $0x0,0x18(%rsp)
je     1359 <populate2Dmatrix+0x229>
mov    %rbp,%rbx
mov    0x8(%rsp),%rax
lea    (%rax,%r12,8),%r12
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r12,%rbp,8),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
add    $0x1,%rbp
cmp    %rbp,0x18(%rsp)
jne    1340 <populate2Dmatrix+0x210>
cmpl   $0x0,0x10(%rsp)
jle    15e1 <populate2Dmatrix+0x4b1>
mov    %r15d,%eax
and    $0xfffffffe,%eax
xor    %ecx,%ecx
mov    0x8(%rsp),%r8
jmp    138d <populate2Dmatrix+0x25d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
cmp    %r15,%rcx
je     141c <populate2Dmatrix+0x2ec>
xor    %edx,%edx
jmp    13a9 <populate2Dmatrix+0x279>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdx
cmp    %r15,%rdx
je     1380 <populate2Dmatrix+0x250>
mov    (%r14,%rdx,8),%rdi
mov    (%r8,%rdx,8),%rsi
xor    %ebp,%ebp
test   %r13,%r13
je     13fc <populate2Dmatrix+0x2cc>
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rcx,8),%xmm0
mov    (%r14,%rbp,8),%rbx
mulsd  (%rbx,%rcx,8),%xmm0
addsd  (%rsi,%rbp,8),%xmm0
movsd  %xmm0,(%rsi,%rbp,8)
movsd  (%rdi,%rcx,8),%xmm0
mov    0x8(%r14,%rbp,8),%rbx
mulsd  (%rbx,%rcx,8),%xmm0
addsd  0x8(%rsi,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsi,%rbp,8)
add    $0x2,%rbp
cmp    %rbp,%rax
jne    13c0 <populate2Dmatrix+0x290>
test   $0x1,%r15b
je     13a0 <populate2Dmatrix+0x270>
movsd  (%rdi,%rcx,8),%xmm0
mov    (%r14,%rbp,8),%rdi
mulsd  (%rdi,%rcx,8),%xmm0
addsd  (%rsi,%rbp,8),%xmm0
movsd  %xmm0,(%rsi,%rbp,8)
jmp    13a0 <populate2Dmatrix+0x270>
mov    0x10(%rsp),%rsi
test   %esi,%esi
jle    15e1 <populate2Dmatrix+0x4b1>
mov    %r15d,%r10d
and    $0xfffffffc,%r10d
add    $0xfffffffffffffffc,%r10
mov    %r10,%r8
shr    $0x2,%r8
add    $0x1,%r8
mov    %r15d,%r11d
and    $0xfffffffc,%r11d
mov    %r8d,%r9d
and    $0x3,%r9d
and    $0xfffffffffffffffc,%r8
mov    %r15d,%r12d
and    $0x3,%r12d
mov    %r9,%r13
shl    $0x5,%r13
xor    %ecx,%ecx
jmp    1482 <populate2Dmatrix+0x352>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
cmp    %r15,%rcx
mov    0x10(%rsp),%rsi
je     15e1 <populate2Dmatrix+0x4b1>
mov    0x8(%rsp),%rax
mov    (%rax,%rcx,8),%rax
mov    (%r14,%rcx,8),%rdx
cmp    $0x4,%esi
jb     14aa <populate2Dmatrix+0x37a>
lea    (%rax,%r15,8),%rsi
cmp    %rsi,%rdx
jae    1520 <populate2Dmatrix+0x3f0>
lea    (%rdx,%r15,8),%rsi
cmp    %rsi,%rax
jae    1520 <populate2Dmatrix+0x3f0>
xor    %edi,%edi
mov    %rdi,%rbp
not    %rbp
add    %r15,%rbp
test   %r12,%r12
je     14d4 <populate2Dmatrix+0x3a4>
mov    %r12,%rsi
nopl   (%rax)
movsd  (%rax,%rdi,8),%xmm0
movsd  %xmm0,(%rdx,%rdi,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rsi
jne    14c0 <populate2Dmatrix+0x390>
cmp    $0x3,%rbp
jb     1470 <populate2Dmatrix+0x340>
nopw   0x0(%rax,%rax,1)
movsd  (%rax,%rdi,8),%xmm0
movsd  %xmm0,(%rdx,%rdi,8)
movsd  0x8(%rax,%rdi,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rdi,8)
movsd  0x10(%rax,%rdi,8),%xmm0
movsd  %xmm0,0x10(%rdx,%rdi,8)
movsd  0x18(%rax,%rdi,8),%xmm0
movsd  %xmm0,0x18(%rdx,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r15
jne    14e0 <populate2Dmatrix+0x3b0>
jmp    1470 <populate2Dmatrix+0x340>
nopl   0x0(%rax)
cmp    $0xc,%r10
jae    152a <populate2Dmatrix+0x3fa>
xor    %edi,%edi
jmp    158c <populate2Dmatrix+0x45c>
mov    %r8,%rbp
xor    %edi,%edi
nop
movups (%rax,%rdi,8),%xmm0
movups 0x10(%rax,%rdi,8),%xmm1
movups %xmm0,(%rdx,%rdi,8)
movups %xmm1,0x10(%rdx,%rdi,8)
movups 0x20(%rax,%rdi,8),%xmm0
movups 0x30(%rax,%rdi,8),%xmm1
movups %xmm0,0x20(%rdx,%rdi,8)
movups %xmm1,0x30(%rdx,%rdi,8)
movups 0x40(%rax,%rdi,8),%xmm0
movups 0x50(%rax,%rdi,8),%xmm1
movups %xmm0,0x40(%rdx,%rdi,8)
movups %xmm1,0x50(%rdx,%rdi,8)
movupd 0x60(%rax,%rdi,8),%xmm0
movupd 0x70(%rax,%rdi,8),%xmm1
movupd %xmm0,0x60(%rdx,%rdi,8)
movupd %xmm1,0x70(%rdx,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rbp
jne    1530 <populate2Dmatrix+0x400>
test   %r9,%r9
je     15d0 <populate2Dmatrix+0x4a0>
lea    (%rdx,%rdi,8),%rbp
add    $0x10,%rbp
lea    (%rax,%rdi,8),%rsi
add    $0x10,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd -0x10(%rsi,%rdi,1),%xmm0
movupd (%rsi,%rdi,1),%xmm1
movupd %xmm0,-0x10(%rbp,%rdi,1)
movupd %xmm1,0x0(%rbp,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r13
jne    15b0 <populate2Dmatrix+0x480>
mov    %r11,%rdi
cmp    %r15,%r11
je     1470 <populate2Dmatrix+0x340>
jmp    14ac <populate2Dmatrix+0x37c>
mov    0x8(%rsp),%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <free2D@plt>

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

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