#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 */
double FABS(double);
double exp(double);
int /*<<< orphan*/ rax_free(double *);
scalar_t__ rax_malloc(int);
void coreGTRCATSECONDARY_6(double *EIGN, double lz, int numberOfCategories,
                           double *rptr, int *cptr, int upper,
                           volatile double *ext_dlnLdlz,
                           volatile double *ext_d2lnLdlz2, double *sumtable,
                           int *wgt) {
  int i, l;
  double *d1, *d_start, *sum;
  double e[6], s[6], dd[6];
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  double dlnLdlz = 0.0;
  double d2lnLdlz2 = 0.0;
  d1 = d_start = (double *)rax_malloc(numberOfCategories * 6 * sizeof(double));
  for (l = 1; l < 6; l++) {
    e[l] = EIGN[l - 1] * EIGN[l - 1];
    s[l] = EIGN[l - 1];
    dd[l] = s[l] * lz;
  }
  for (i = 0; i < numberOfCategories; i++) {
    for (l = 1; l < 6; l++)
      d1[6 * i + l] = exp(dd[l] * rptr[i]);
  }
  for (i = 0; i < upper; i++) {
    double r = rptr[cptr[i]], wr1 = r * wgt[i], wr2 = r * r * wgt[i];
    d1 = &d_start[6 * cptr[i]];
    sum = &sumtable[6 * i];
    inv_Li = sum[0];
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (l = 1; l < 6; l++) {
      inv_Li += (tmp = d1[l] * sum[l]);
      dlnLidlz += tmp * s[l];
      d2lnLidlz2 += tmp * e[l];
    }
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wr1 * dlnLidlz;
    d2lnLdlz2 += wr2 * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *ext_dlnLdlz = dlnLdlz;
  *ext_d2lnLdlz2 = d2lnLdlz2;
  rax_free(d_start);
}


x86 assembly (clang, -O0):
<coreGTRCATSECONDARY_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
imul   $0x6,-0x14(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <rax_malloc@plt>
mov    %rax,-0x50(%rbp)
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x40(%rbp)
cmpl   $0x6,-0x40(%rbp)
jge    1230 <coreGTRCATSECONDARY_6+0xf0>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xc0(%rbp,%rax,8)
ff ff
movslq -0x40(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x10(%rbp),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11a9 <coreGTRCATSECONDARY_6+0x69>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12a7 <coreGTRCATSECONDARY_6+0x167>
movl   $0x1,-0x40(%rbp)
cmpl   $0x6,-0x40(%rbp)
jge    1294 <coreGTRCATSECONDARY_6+0x154>
movslq -0x40(%rbp),%rax
movsd  -0xf0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
mov    -0x48(%rbp),%rax
imul   $0x6,-0x3c(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    124a <coreGTRCATSECONDARY_6+0x10a>
jmp    1299 <coreGTRCATSECONDARY_6+0x159>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1237 <coreGTRCATSECONDARY_6+0xf7>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1507 <coreGTRCATSECONDARY_6+0x3c7>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x128(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x6,(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    0x18(%rbp),%rax
imul   $0x6,-0x3c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movl   $0x1,-0x40(%rbp)
cmpl   $0x6,-0x40(%rbp)
jge    1426 <coreGTRCATSECONDARY_6+0x2e6>
mov    -0x48(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
addsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x108(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x110(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1382 <coreGTRCATSECONDARY_6+0x242>
movsd  -0x100(%rbp),%xmm0
ff
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xbc2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
mulsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
mulsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  -0x108(%rbp),%xmm2
ff
movsd  -0x118(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x108(%rbp),%xmm2
ff
movsd  -0x108(%rbp),%xmm3
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x120(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12ae <coreGTRCATSECONDARY_6+0x16e>
movsd  -0x118(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x120(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRCATSECONDARY_6>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,0xa0(%rsp)
mov    %r8d,0x8(%rsp)
mov    %rcx,0x90(%rsp)
mov    %rdx,%r13
mov    %esi,%ebp
movsd  %xmm0,0x40(%rsp)
mov    %rdi,%rbx
mov    0x110(%rsp),%rax
mov    %rax,0x88(%rsp)
mov    0x108(%rsp),%r14
mov    0x100(%rsp),%rax
mov    %rax,0x98(%rsp)
mov    %esi,%eax
shl    $0x4,%eax
lea    (%rax,%rax,2),%edi
call   1040 <rax_malloc@plt>
mov    %rax,%r12
movsd  (%rbx),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x18(%rsp)
test   %ebp,%ebp
jle    12cf <coreGTRCATSECONDARY_6+0x18f>
movsd  0x38(%rsp),%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  0x30(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  0x28(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    %ebp,%r15d
lea    0x28(%r12),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x70(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x20(%rbx)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x60(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x18(%rbx)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x10(%rbx)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x8(%rbx)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x40(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    $0x30,%rbx
cmp    %rbp,%r15
jne    1250 <coreGTRCATSECONDARY_6+0x110>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1523 <coreGTRCATSECONDARY_6+0x3e3>
movsd  0x38(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x30(%rsp),%xmm6
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  0x28(%rsp),%xmm7
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
movsd  %xmm0,0xb8(%rsp)
movsd  0x20(%rsp),%xmm8
movapd %xmm8,%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  0x18(%rsp),%xmm9
movapd %xmm9,%xmm0
mulsd  %xmm9,%xmm0
movsd  %xmm0,0xa8(%rsp)
mov    %eax,%eax
mov    %rax,0x8(%rsp)
add    $0x20,%r14
xorpd  %xmm1,%xmm1
xor    %r15d,%r15d
mov    0x90(%rsp),%rbp
mov    0x88(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq 0x0(%rbp,%r15,4),%rax
lea    (%rax,%rax,2),%rcx
shl    $0x4,%rcx
movsd  0x8(%r12,%rcx,1),%xmm3
mulsd  -0x18(%r14),%xmm3
movsd  -0x20(%r14),%xmm0
addsd  %xmm3,%xmm0
movapd %xmm3,%xmm4
mulsd  %xmm2,%xmm4
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm4
mulsd  0x10(%rsp),%xmm3
addsd  %xmm2,%xmm3
movupd 0x10(%r12,%rcx,1),%xmm5
movupd -0x10(%r14),%xmm2
mulpd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm5
mulsd  %xmm6,%xmm5
addsd  %xmm4,%xmm5
movapd %xmm2,%xmm4
mulsd  0xc0(%rsp),%xmm4
addsd  %xmm3,%xmm4
unpckhpd %xmm2,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm7,%xmm3
addsd  %xmm5,%xmm3
movupd 0x20(%r12,%rcx,1),%xmm5
addsd  %xmm2,%xmm0
mulsd  0xb8(%rsp),%xmm2
addsd  %xmm4,%xmm2
movupd (%r14),%xmm4
mulpd  %xmm4,%xmm5
addsd  %xmm5,%xmm0
movapd %xmm5,%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm5,%xmm3
mulsd  0xb0(%rsp),%xmm3
addsd  %xmm2,%xmm3
unpckhpd %xmm5,%xmm5
movapd %xmm5,%xmm2
mulsd  %xmm9,%xmm2
addsd  %xmm4,%xmm2
movapd %xmm2,0x40(%rsp)
movsd  0x0(%r13,%rax,8),%xmm2
addsd  %xmm5,%xmm0
mulsd  0xa8(%rsp),%xmm5
addsd  %xmm3,%xmm5
movapd %xmm5,0x60(%rsp)
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
unpcklpd %xmm3,%xmm2
xorps  %xmm3,%xmm3
cvtsi2sdl (%rbx,%r15,4),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm3,0x70(%rsp)
movapd %xmm1,0x50(%rsp)
call   1030 <FABS@plt>
movapd 0x50(%rsp),%xmm3
movsd  0x18(%rsp),%xmm9
movsd  0x20(%rsp),%xmm8
movsd  0x28(%rsp),%xmm7
movsd  0x30(%rsp),%xmm6
movsd  0x38(%rsp),%xmm2
movsd  0xb2c(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd 0x40(%rsp),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0x60(%rsp),%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm4,%xmm0
unpcklpd %xmm1,%xmm0
mulpd  0x70(%rsp),%xmm0
movapd %xmm0,%xmm1
addpd  %xmm3,%xmm1
add    $0x1,%r15
add    $0x30,%r14
cmp    %r15,0x8(%rsp)
jne    1380 <coreGTRCATSECONDARY_6+0x240>
addpd  %xmm3,%xmm0
jmp    1527 <coreGTRCATSECONDARY_6+0x3e7>
xorpd  %xmm0,%xmm0
mov    0xa0(%rsp),%rax
movlpd %xmm0,(%rax)
mov    0x98(%rsp),%rax
movhpd %xmm0,(%rax)
mov    %r12,%rdi
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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

LLVM IR (-O2):
define void @coreGTRCATSECONDARY_6(double* nocapture %0, double %1, i32 %2, double* nocapture %3, i32* nocapture %4, i32 %5, double* %6, double* %7, double* nocapture %8, i32* nocapture %9) {
%11 = mul i32 %2, 48
%12 = tail call i64 @rax_malloc(i32 %11)
%13 = load double, double* %0
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %0, i64 3
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %0, i64 4
%21 = load double, double* %20
%22 = fmul double %13, %13
%23 = fmul double %13, %1
%24 = fmul double %15, %15
%25 = fmul double %15, %1
%26 = fmul double %17, %17
%27 = fmul double %17, %1
%28 = fmul double %19, %19
%29 = fmul double %19, %1
%30 = fmul double %21, %21
%31 = fmul double %21, %1
%32 = inttoptr i64 %12 to double*
%33 = icmp sgt i32 %2, 0
br i1 %33, label %34, label %67
34: ; preds = %10
%35 = zext i32 %2 to i64
br label %36
36: ; preds = %34, %36
%37 = phi i64 [ 0, %34 ], [ %65, %36 ]
%38 = getelementptr inbounds double, double* %3, i64 %37
%39 = mul nuw nsw i64 %37, 6
%40 = load double, double* %38
%41 = fmul double %23, %40
%42 = tail call double @exp(double %41)
%43 = or i64 %39, 1
%44 = getelementptr inbounds double, double* %32, i64 %43
store double %42, double* %44
%45 = load double, double* %38
%46 = fmul double %25, %45
%47 = tail call double @exp(double %46)
%48 = add nuw nsw i64 %39, 2
%49 = getelementptr inbounds double, double* %32, i64 %48
store double %47, double* %49
%50 = load double, double* %38
%51 = fmul double %27, %50
%52 = tail call double @exp(double %51)
%53 = add nuw nsw i64 %39, 3
%54 = getelementptr inbounds double, double* %32, i64 %53
store double %52, double* %54
%55 = load double, double* %38
%56 = fmul double %29, %55
%57 = tail call double @exp(double %56)
%58 = add nuw nsw i64 %39, 4
%59 = getelementptr inbounds double, double* %32, i64 %58
store double %57, double* %59
%60 = load double, double* %38
%61 = fmul double %31, %60
%62 = tail call double @exp(double %61)
%63 = add nuw nsw i64 %39, 5
%64 = getelementptr inbounds double, double* %32, i64 %63
store double %62, double* %64
%65 = add nuw nsw i64 %37, 1
%66 = icmp eq i64 %65, %35
br i1 %66, label %67, label %36
67: ; preds = %36, %10
%68 = icmp sgt i32 %5, 0
br i1 %68, label %69, label %145
69: ; preds = %67
%70 = zext i32 %5 to i64
br label %71
71: ; preds = %69, %71
%72 = phi i64 [ 0, %69 ], [ %141, %71 ]
%73 = phi <2 x double> [ zeroinitializer, %69 ], [ %140, %71 ]
%74 = getelementptr inbounds i32, i32* %4, i64 %72
%75 = load i32, i32* %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %3, i64 %76
%78 = load double, double* %77
%79 = getelementptr inbounds i32, i32* %9, i64 %72
%80 = load i32, i32* %79
%81 = sitofp i32 %80 to double
%82 = fmul double %78, %78
%83 = mul nsw i32 %75, 6
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %32, i64 %84
%86 = mul nuw nsw i64 %72, 6
%87 = getelementptr inbounds double, double* %8, i64 %86
%88 = load double, double* %87
%89 = getelementptr inbounds double, double* %85, i64 1
%90 = load double, double* %89
%91 = getelementptr inbounds double, double* %87, i64 1
%92 = load double, double* %91
%93 = fmul double %90, %92
%94 = fadd double %88, %93
%95 = tail call double @llvm.fmuladd.f64(double %93, double %13, double 0.000000e+00)
%96 = tail call double @llvm.fmuladd.f64(double %93, double %22, double 0.000000e+00)
%97 = getelementptr inbounds double, double* %85, i64 2
%98 = getelementptr inbounds double, double* %87, i64 2
%99 = bitcast double* %97 to <2 x double>*
%100 = load <2 x double>, <2 x double>* %99
%101 = bitcast double* %98 to <2 x double>*
%102 = load <2 x double>, <2 x double>* %101
%103 = fmul <2 x double> %100, %102
%104 = extractelement <2 x double> %103, i64 0
%105 = fadd double %94, %104
%106 = tail call double @llvm.fmuladd.f64(double %104, double %15, double %95)
%107 = tail call double @llvm.fmuladd.f64(double %104, double %24, double %96)
%108 = extractelement <2 x double> %103, i64 1
%109 = fadd double %105, %108
%110 = tail call double @llvm.fmuladd.f64(double %108, double %17, double %106)
%111 = tail call double @llvm.fmuladd.f64(double %108, double %26, double %107)
%112 = getelementptr inbounds double, double* %85, i64 4
%113 = getelementptr inbounds double, double* %87, i64 4
%114 = bitcast double* %112 to <2 x double>*
%115 = load <2 x double>, <2 x double>* %114
%116 = bitcast double* %113 to <2 x double>*
%117 = load <2 x double>, <2 x double>* %116
%118 = fmul <2 x double> %115, %117
%119 = extractelement <2 x double> %118, i64 0
%120 = fadd double %109, %119
%121 = tail call double @llvm.fmuladd.f64(double %119, double %19, double %110)
%122 = tail call double @llvm.fmuladd.f64(double %119, double %28, double %111)
%123 = extractelement <2 x double> %118, i64 1
%124 = fadd double %120, %123
%125 = tail call double @llvm.fmuladd.f64(double %123, double %21, double %121)
%126 = tail call double @llvm.fmuladd.f64(double %123, double %30, double %122)
%127 = insertelement <2 x double> poison, double %78, i64 0
%128 = insertelement <2 x double> %127, double %82, i64 1
%129 = insertelement <2 x double> poison, double %81, i64 0
%130 = shufflevector <2 x double> %129, <2 x double> poison, <2 x i32> zeroinitializer
%131 = fmul <2 x double> %128, %130
%132 = tail call double @FABS(double %124)
%133 = fdiv double 1.000000e+00, %132
%134 = fmul double %125, %133
%135 = fmul double %126, %133
%136 = fneg double %134
%137 = tail call double @llvm.fmuladd.f64(double %136, double %134, double %135)
%138 = insertelement <2 x double> poison, double %134, i64 0
%139 = insertelement <2 x double> %138, double %137, i64 1
%140 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %131, <2 x double> %139, <2 x double> %73)
%141 = add nuw nsw i64 %72, 1
%142 = icmp eq i64 %141, %70
br i1 %142, label %143, label %71
143: ; preds = %71
%144 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %131, <2 x double> %139, <2 x double> %73)
br label %145
145: ; preds = %143, %67
%146 = phi <2 x double> [ zeroinitializer, %67 ], [ %144, %143 ]
%147 = extractelement <2 x double> %146, i64 0
store volatile double %147, double* %6
%148 = extractelement <2 x double> %146, i64 1
store volatile double %148, double* %7
%149 = tail call i32 @rax_free(double* %32)
ret void
}