#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_7(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[7], s[7], dd[7];
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  double dlnLdlz = 0.0;
  double d2lnLdlz2 = 0.0;
  d1 = d_start = (double *)rax_malloc(numberOfCategories * 7 * sizeof(double));
  for (l = 1; l < 7; 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 < 7; l++)
      d1[7 * 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[7 * cptr[i]];
    sum = &sumtable[7 * i];
    inv_Li = sum[0];
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (l = 1; l < 7; 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_7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%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,-0x138(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
imul   $0x7,-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   $0x7,-0x40(%rbp)
jge    1230 <coreGTRCATSECONDARY_7+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,-0xd0(%rbp,%rax,8)
ff ff
movslq -0x40(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x10(%rbp),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11a9 <coreGTRCATSECONDARY_7+0x69>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12a7 <coreGTRCATSECONDARY_7+0x167>
movl   $0x1,-0x40(%rbp)
cmpl   $0x7,-0x40(%rbp)
jge    1294 <coreGTRCATSECONDARY_7+0x154>
movslq -0x40(%rbp),%rax
movsd  -0x110(%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   $0x7,-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_7+0x10a>
jmp    1299 <coreGTRCATSECONDARY_7+0x159>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1237 <coreGTRCATSECONDARY_7+0xf7>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1507 <coreGTRCATSECONDARY_7+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,-0x148(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
mulsd  -0x148(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x7,(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    0x18(%rbp),%rax
imul   $0x7,-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,-0x120(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movl   $0x1,-0x40(%rbp)
cmpl   $0x7,-0x40(%rbp)
jge    1426 <coreGTRCATSECONDARY_7+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,-0x118(%rbp)
ff
addsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x128(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x130(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1382 <coreGTRCATSECONDARY_7+0x242>
movsd  -0x120(%rbp),%xmm0
ff
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xbc2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
mulsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
mulsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm2
ff
movsd  -0x138(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
movsd  -0x130(%rbp),%xmm1
ff
movsd  -0x128(%rbp),%xmm2
ff
movsd  -0x128(%rbp),%xmm3
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x140(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12ae <coreGTRCATSECONDARY_7+0x16e>
movsd  -0x138(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x140(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRCATSECONDARY_7>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9,0xb0(%rsp)
mov    %r8d,0x8(%rsp)
mov    %rcx,0xa0(%rsp)
mov    %rdx,%r13
mov    %esi,%ebp
movsd  %xmm0,0x50(%rsp)
mov    %rdi,%rbx
mov    0x120(%rsp),%rax
mov    %rax,0x98(%rsp)
mov    0x118(%rsp),%r14
mov    0x110(%rsp),%rax
mov    %rax,0xa8(%rsp)
imul   $0x38,%esi,%edi
call   1040 <rax_malloc@plt>
mov    %rax,%r12
movsd  (%rbx),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
test   %ebp,%ebp
jle    12fd <coreGTRCATSECONDARY_7+0x1bd>
movsd  0x48(%rsp),%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x80(%rsp)
movsd  0x40(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  0x38(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  0x30(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x28(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    %ebp,%r15d
lea    0x30(%r12),%rbx
xor    %ebp,%ebp
nop
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x80(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x28(%rbx)
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  0x18(%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  0x50(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    $0x38,%rbx
cmp    %rbp,%r15
jne    1260 <coreGTRCATSECONDARY_7+0x120>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    159a <coreGTRCATSECONDARY_7+0x45a>
movsd  0x48(%rsp),%xmm6
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x40(%rsp),%xmm12
movapd %xmm12,%xmm0
mulsd  %xmm12,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm8
movapd %xmm8,%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm0,0xd0(%rsp)
movsd  0x30(%rsp),%xmm9
movapd %xmm9,%xmm0
mulsd  %xmm9,%xmm0
movsd  %xmm0,0xc8(%rsp)
movsd  0x28(%rsp),%xmm10
movapd %xmm10,%xmm0
mulsd  %xmm10,%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  0x20(%rsp),%xmm11
movapd %xmm11,%xmm0
mulsd  %xmm11,%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    %eax,%eax
mov    %rax,0x8(%rsp)
xorpd  %xmm1,%xmm1
xor    %r15d,%r15d
mov    0xa0(%rsp),%rbp
mov    0x98(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movslq 0x0(%rbp,%r15,4),%rax
imul   $0x38,%rax,%rcx
movupd 0x8(%r12,%rcx,1),%xmm0
movupd 0x18(%r12,%rcx,1),%xmm4
movupd 0x28(%r12,%rcx,1),%xmm5
movupd 0x8(%r14),%xmm3
mulpd  %xmm0,%xmm3
movupd 0x18(%r14),%xmm2
mulpd  %xmm4,%xmm2
movupd 0x28(%r14),%xmm7
mulpd  %xmm5,%xmm7
movsd  (%r14),%xmm0
addsd  %xmm3,%xmm0
movapd %xmm3,%xmm4
mulsd  %xmm6,%xmm4
xorpd  %xmm13,%xmm13
addsd  %xmm13,%xmm4
movapd %xmm3,%xmm5
unpckhpd %xmm3,%xmm3
movapd %xmm3,%xmm6
mulsd  %xmm12,%xmm6
addsd  %xmm4,%xmm6
mulsd  0x18(%rsp),%xmm5
addsd  %xmm13,%xmm5
addsd  %xmm3,%xmm0
mulsd  0x10(%rsp),%xmm3
addsd  %xmm5,%xmm3
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm6,%xmm4
movapd %xmm2,%xmm5
mulsd  0xd0(%rsp),%xmm5
addsd  %xmm3,%xmm5
unpckhpd %xmm2,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm9,%xmm3
addsd  %xmm4,%xmm3
addsd  %xmm2,%xmm0
mulsd  0xc8(%rsp),%xmm2
addsd  %xmm5,%xmm2
addsd  %xmm7,%xmm0
movapd %xmm7,%xmm4
mulsd  %xmm10,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm7,%xmm3
mulsd  0xc0(%rsp),%xmm3
addsd  %xmm2,%xmm3
unpckhpd %xmm7,%xmm7
movapd %xmm7,%xmm2
mulsd  %xmm11,%xmm2
addsd  %xmm4,%xmm2
movapd %xmm2,0x50(%rsp)
movsd  0x0(%r13,%rax,8),%xmm2
addsd  %xmm7,%xmm0
mulsd  0xb8(%rsp),%xmm7
addsd  %xmm3,%xmm7
movapd %xmm7,0x70(%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,0x80(%rsp)
movapd %xmm1,0x60(%rsp)
call   1030 <FABS@plt>
movapd 0x60(%rsp),%xmm2
movsd  0x20(%rsp),%xmm11
movsd  0x28(%rsp),%xmm10
movsd  0x30(%rsp),%xmm9
movsd  0x38(%rsp),%xmm8
movsd  0x40(%rsp),%xmm12
movsd  0x48(%rsp),%xmm6
movsd  0xab8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd 0x50(%rsp),%xmm3
mulsd  %xmm1,%xmm3
mulsd  0x70(%rsp),%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm3,%xmm0
unpcklpd %xmm1,%xmm0
mulpd  0x80(%rsp),%xmm0
movapd %xmm0,%xmm1
addpd  %xmm2,%xmm1
add    $0x1,%r15
add    $0x38,%r14
cmp    %r15,0x8(%rsp)
jne    13c0 <coreGTRCATSECONDARY_7+0x280>
addpd  %xmm2,%xmm0
jmp    159e <coreGTRCATSECONDARY_7+0x45e>
xorpd  %xmm0,%xmm0
mov    0xb0(%rsp),%rax
movlpd %xmm0,(%rax)
mov    0xa8(%rsp),%rax
movhpd %xmm0,(%rax)
mov    %r12,%rdi
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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