#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*/ assert(int);
double exp(double);
void makeP_FlexLG4(double z1, double z2, double *rptr, double *EI[4],
                   double *EIGN[4], int numberOfCategories, double *left,
                   double *right, const int numStates) {
  int i, j, k;
  const int rates = numStates - 1, statesSquare = numStates * numStates;
  double d1[64], d2[64];
  assert(numStates <= 64);
  for (i = 0; i < numberOfCategories; i++) {
    for (j = 0; j < rates; j++) {
      d1[j] = exp(rptr[i] * EIGN[i][j] * z1);
      d2[j] = exp(rptr[i] * EIGN[i][j] * z2);
    }
    for (j = 0; j < numStates; j++) {
      left[statesSquare * i + numStates * j] = 1.0;
      right[statesSquare * i + numStates * j] = 1.0;
      for (k = 1; k < numStates; k++) {
        left[statesSquare * i + numStates * j + k] =
            d1[k - 1] * EI[i][rates * j + (k - 1)];
        right[statesSquare * i + numStates * j + k] =
            d2[k - 1] * EI[i][rates * j + (k - 1)];
      }
    }
  }
}


x86 assembly (clang, -O0):
<makeP_FlexLG4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    0x10(%rbp),%eax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    0x10(%rbp),%eax
imul   0x10(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x40,0x10(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1361 <makeP_FlexLG4+0x241>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    1219 <makeP_FlexLG4+0xf9>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movslq -0x48(%rbp),%rax
movsd  %xmm0,-0x260(%rbp,%rax,8)
ff ff
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
movslq -0x48(%rbp),%rax
movsd  %xmm0,-0x460(%rbp,%rax,8)
ff ff
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    118d <makeP_FlexLG4+0x6d>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    134e <makeP_FlexLG4+0x22e>
mov    -0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x44(%rbp),%ecx
mov    0x10(%rbp),%edx
imul   -0x48(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  0xdb5(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x44(%rbp),%ecx
mov    0x10(%rbp),%edx
imul   -0x48(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  0xd91(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    133b <makeP_FlexLG4+0x21b>
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x260(%rbp,%rax,8),%xmm0
ff ff
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x50(%rbp),%ecx
imul   -0x48(%rbp),%ecx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x44(%rbp),%ecx
mov    0x10(%rbp),%edx
imul   -0x48(%rbp),%edx
add    %edx,%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x460(%rbp,%rax,8),%xmm0
ff ff
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x50(%rbp),%ecx
imul   -0x48(%rbp),%ecx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x44(%rbp),%ecx
mov    0x10(%rbp),%edx
imul   -0x48(%rbp),%edx
add    %edx,%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    127b <makeP_FlexLG4+0x15b>
jmp    1340 <makeP_FlexLG4+0x220>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1220 <makeP_FlexLG4+0x100>
jmp    1353 <makeP_FlexLG4+0x233>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    117a <makeP_FlexLG4+0x5a>
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeP_FlexLG4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x508,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,%r13
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,0xe8(%rsp)
mov    %rdi,%rbp
movsd  %xmm1,0xf0(%rsp)
movsd  %xmm0,0x50(%rsp)
mov    0x540(%rsp),%r14d
xor    %edi,%edi
cmp    $0x41,%r14d
setl   %dil
call   1030 <assert@plt>
test   %ebx,%ebx
jle    162c <makeP_FlexLG4+0x50c>
mov    %r14,%r9
lea    -0x1(%r14),%eax
movslq %eax,%r8
mov    %ebx,%eax
mov    %rax,0x68(%rsp)
mov    %r9d,%eax
lea    0x8(%r13),%r10
mov    %r9d,%esi
imul   %esi,%esi
mov    %rsi,0x38(%rsp)
lea    0x0(,%rax,8),%r11
add    %r13,%r11
mov    0x18(%rsp),%rsi
lea    0x8(%rsi),%rdi
lea    (%rsi,%rax,8),%rbx
lea    -0x1(%rax),%rcx
mov    %rax,0x30(%rsp)
add    $0xfffffffffffffffd,%rax
mov    %rax,0xb0(%rsp)
mov    %rax,%rdx
shr    %rdx
add    $0x1,%rdx
mov    %r10,0xd0(%rsp)
mov    %rbx,0xb8(%rsp)
cmp    %rbx,%r10
setb   %al
mov    %r11,0xc8(%rsp)
mov    %rdi,0xc0(%rsp)
cmp    %r11,%rdi
setb   %bl
and    %al,%bl
mov    %bl,0xf(%rsp)
mov    %rcx,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0xa0(%rsp)
mov    %rcx,0x48(%rsp)
or     $0x1,%rcx
mov    %rcx,0x98(%rsp)
mov    %rdx,%rax
mov    %rdx,0xa8(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x90(%rsp)
mov    %r8,0x58(%rsp)
mov    %r8d,%r12d
lea    0x18(%rsi),%rax
mov    %rax,0x88(%rsp)
lea    0x18(%r13),%rax
mov    %rax,0x80(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %r14d,%r14d
mov    %r13,0x20(%rsp)
mov    %r15,0x78(%rsp)
mov    %rbp,0x70(%rsp)
mov    %r12,0x60(%rsp)
jmp    12b1 <makeP_FlexLG4+0x191>
nopw   0x0(%rax,%rax,1)
mov    0x28(%rsp),%r14
add    $0x1,%r14
mov    0x10(%rsp),%rax
add    0x38(%rsp),%eax
mov    %rax,0x10(%rsp)
cmp    0x68(%rsp),%r14
mov    0x78(%rsp),%r15
mov    0x70(%rsp),%rbp
mov    0x60(%rsp),%r12
je     162c <makeP_FlexLG4+0x50c>
cmp    $0x2,%r9d
movsd  0x50(%rsp),%xmm1
jl     1318 <makeP_FlexLG4+0x1f8>
xor    %ebx,%ebx
nop
movsd  0x0(%rbp,%r14,8),%xmm0
mov    (%r15,%r14,8),%rax
mulsd  (%rax,%rbx,8),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x300(%rsp,%rbx,8)
movsd  0x0(%rbp,%r14,8),%xmm0
mov    (%r15,%r14,8),%rax
mulsd  (%rax,%rbx,8),%xmm0
mulsd  0xf0(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x50(%rsp),%xmm1
movsd  %xmm0,0x100(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    12c0 <makeP_FlexLG4+0x1a0>
mov    %r14,0x28(%rsp)
mov    0x540(%rsp),%r9d
test   %r9d,%r9d
mov    0x18(%rsp),%r14
jle    1280 <makeP_FlexLG4+0x160>
mov    0x28(%rsp),%rax
mov    %rax,%rcx
imul   0x38(%rsp),%rcx
mov    %rcx,0xd8(%rsp)
imul   %r9d,%eax
mov    %rax,0xf8(%rsp)
mov    $0x2,%r12d
mov    $0xffffffffffffffff,%r10
mov    0x10(%rsp),%rax
mov    %eax,%r11d
xor    %r15d,%r15d
jmp    138d <makeP_FlexLG4+0x26d>
nop
add    $0x1,%r15
add    %r9d,%r11d
mov    0x58(%rsp),%rax
add    %rax,%r12
add    %rax,%r10
cmp    0x30(%rsp),%r15
je     1280 <makeP_FlexLG4+0x160>
mov    0xf8(%rsp),%rax
add    %r15d,%eax
imul   %r9d,%eax
movslq %eax,%rcx
movabs $0x3ff0000000000000,%rax
mov    %rax,0x0(%r13,%rcx,8)
mov    %rax,(%r14,%rcx,8)
cmp    $0x2,%r9d
jl     1370 <makeP_FlexLG4+0x250>
movslq %r11d,%rsi
mov    0xe8(%rsp),%rax
mov    0x28(%rsp),%rdx
mov    (%rax,%rdx,8),%rdi
mov    $0x1,%r8d
mov    0x48(%rsp),%rdx
cmp    $0x2,%rdx
jb     15c0 <makeP_FlexLG4+0x4a0>
mov    %rsi,0x40(%rsp)
mov    %r15d,%eax
imul   0x30(%rsp),%eax
add    0xd8(%rsp),%eax
mov    %r15,%rsi
imul   0x58(%rsp),%rsi
add    %rsi,%rdx
cltq
mov    %rdi,%rbx
mov    0xd0(%rsp),%rdi
lea    (%rdi,%rax,8),%rdi
mov    0xc8(%rsp),%rbp
lea    0x0(%rbp,%rax,8),%rbp
lea    (%rbx,%rdx,8),%rdx
cmp    %rdx,%rdi
mov    %rbx,%r13
mov    %rsi,0xe0(%rsp)
lea    (%rbx,%rsi,8),%rdi
setb   %r9b
cmp    %rbp,%rdi
setb   %bl
and    %r9b,%bl
mov    0xc0(%rsp),%rbp
lea    0x0(%rbp,%rax,8),%rbp
or     0xf(%rsp),%bl
cmp    %rdx,%rbp
mov    0xb8(%rsp),%rdx
lea    (%rdx,%rax,8),%rdx
setb   %al
cmp    %rdx,%rdi
setb   %dl
test   %bl,%bl
jne    149e <makeP_FlexLG4+0x37e>
and    %dl,%al
mov    0x540(%rsp),%r9d
mov    %r13,%rdi
mov    0x20(%rsp),%r13
mov    0x40(%rsp),%rsi
jne    15c0 <makeP_FlexLG4+0x4a0>
cmpq   $0x2,0xb0(%rsp)
jae    14b8 <makeP_FlexLG4+0x398>
xor    %ebp,%ebp
jmp    1543 <makeP_FlexLG4+0x423>
mov    0x540(%rsp),%r9d
mov    %r13,%rdi
mov    0x20(%rsp),%r13
mov    0x40(%rsp),%rsi
jmp    15c0 <makeP_FlexLG4+0x4a0>
mov    0x88(%rsp),%rax
lea    (%rax,%rsi,8),%r8
mov    0x80(%rsp),%rax
lea    (%rax,%rsi,8),%r13
lea    (%rdi,%r12,8),%r9
mov    0x90(%rsp),%r14
xor    %ebp,%ebp
xchg   %ax,%ax
movupd -0x10(%r9,%rbp,8),%xmm0
mulpd  0x300(%rsp,%rbp,8),%xmm0
movupd %xmm0,-0x10(%r13,%rbp,8)
movupd -0x10(%r9,%rbp,8),%xmm0
mulpd  0x100(%rsp,%rbp,8),%xmm0
movupd %xmm0,-0x10(%r8,%rbp,8)
movupd (%r9,%rbp,8),%xmm0
mulpd  0x310(%rsp,%rbp,8),%xmm0
movupd %xmm0,0x0(%r13,%rbp,8)
movupd (%r9,%rbp,8),%xmm0
mulpd  0x110(%rsp,%rbp,8),%xmm0
movupd %xmm0,(%r8,%rbp,8)
add    $0x4,%rbp
add    $0xfffffffffffffffe,%r14
jne    14e0 <makeP_FlexLG4+0x3c0>
testb  $0x1,0xa8(%rsp)
01
mov    0x18(%rsp),%r14
mov    0x20(%rsp),%r13
mov    0x540(%rsp),%r9d
je     159d <makeP_FlexLG4+0x47d>
mov    %rbp,%rax
or     $0x1,%rax
mov    0xe0(%rsp),%rdx
add    %rbp,%rdx
movupd (%rdi,%rdx,8),%xmm0
mulpd  0x300(%rsp,%rbp,8),%xmm0
add    %rcx,%rax
movupd %xmm0,0x0(%r13,%rax,8)
movupd (%rdi,%rdx,8),%xmm0
mulpd  0x100(%rsp,%rbp,8),%xmm0
movupd %xmm0,(%r14,%rax,8)
mov    0x98(%rsp),%r8
mov    0xa0(%rsp),%rax
cmp    %rax,0x48(%rsp)
je     1370 <makeP_FlexLG4+0x250>
nopl   0x0(%rax,%rax,1)
add    %r8,%rsi
lea    0x0(,%rsi,8),%rcx
add    %r13,%rcx
lea    (%r14,%rsi,8),%rbx
lea    0x2f8(%rsp),%rax
lea    (%rax,%r8,8),%rdx
lea    0xf8(%rsp),%rax
lea    (%rax,%r8,8),%rsi
lea    (%r8,%r10,1),%rax
lea    (%rdi,%rax,8),%rdi
mov    0x30(%rsp),%rbp
sub    %r8,%rbp
xor    %eax,%eax
nopl   0x0(%rax)
movsd  (%rdx,%rax,8),%xmm0
mulsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
movsd  (%rsi,%rax,8),%xmm0
mulsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rbp
jne    1600 <makeP_FlexLG4+0x4e0>
jmp    1370 <makeP_FlexLG4+0x250>
add    $0x508,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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