#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(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[16], s[16], dd[16];
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  double dlnLdlz = 0.0;
  double d2lnLdlz2 = 0.0;
  d1 = d_start = (double *)rax_malloc(numberOfCategories * 16 * sizeof(double));
  for (l = 1; l < 16; 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 < 16; l++)
      d1[16 * 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[16 * cptr[i]];
    sum = &sumtable[16 * i];
    inv_Li = sum[0];
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (l = 1; l < 16; 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>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%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,-0x208(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
mov    -0x14(%rbp),%eax
shl    $0x4,%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   $0x10,-0x40(%rbp)
jge    1232 <coreGTRCATSECONDARY+0xf2>
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,-0xe0(%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,-0x160(%rbp,%rax,8)
ff ff
movslq -0x40(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x10(%rbp),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x1e0(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11ab <coreGTRCATSECONDARY+0x6b>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12ab <coreGTRCATSECONDARY+0x16b>
movl   $0x1,-0x40(%rbp)
cmpl   $0x10,-0x40(%rbp)
jge    1298 <coreGTRCATSECONDARY+0x158>
movslq -0x40(%rbp),%rax
movsd  -0x1e0(%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
mov    -0x3c(%rbp),%ecx
shl    $0x4,%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    124c <coreGTRCATSECONDARY+0x10c>
jmp    129d <coreGTRCATSECONDARY+0x15d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1239 <coreGTRCATSECONDARY+0xf9>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    150f <coreGTRCATSECONDARY+0x3cf>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x218(%rbp)
ff
movsd  -0x218(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x220(%rbp)
ff
movsd  -0x218(%rbp),%xmm0
ff
mulsd  -0x218(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x228(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
shl    $0x4,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
movl   $0x1,-0x40(%rbp)
cmpl   $0x10,-0x40(%rbp)
jge    142e <coreGTRCATSECONDARY+0x2ee>
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,-0x1e8(%rbp)
ff
addsd  -0x1f0(%rbp),%xmm0
ff
movsd  %xmm0,-0x1f0(%rbp)
ff
movsd  -0x1e8(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x1f8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
movsd  -0x1e8(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0xe0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x200(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    138a <coreGTRCATSECONDARY+0x24a>
movsd  -0x1f0(%rbp),%xmm0
ff
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xbba(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
movsd  -0x1f0(%rbp),%xmm0
ff
mulsd  -0x1f8(%rbp),%xmm0
ff
movsd  %xmm0,-0x1f8(%rbp)
ff
movsd  -0x1f0(%rbp),%xmm0
ff
mulsd  -0x200(%rbp),%xmm0
ff
movsd  %xmm0,-0x200(%rbp)
ff
movsd  -0x220(%rbp),%xmm0
ff
movsd  -0x1f8(%rbp),%xmm2
ff
movsd  -0x208(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
movsd  -0x228(%rbp),%xmm0
ff
movsd  -0x200(%rbp),%xmm1
ff
movsd  -0x1f8(%rbp),%xmm2
ff
movsd  -0x1f8(%rbp),%xmm3
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x210(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x210(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12b2 <coreGTRCATSECONDARY+0x172>
movsd  -0x208(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x210(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRCATSECONDARY>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
mov    %r9,%rbx
mov    %r8d,0xc(%rsp)
mov    %rcx,0x68(%rsp)
mov    %rdx,%r15
mov    %esi,%ebp
movsd  %xmm0,0x50(%rsp)
mov    %rdi,%r14
mov    0x280(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    0x278(%rsp),%rax
mov    %rax,0x28(%rsp)
mov    0x270(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    %esi,%edi
shl    $0x7,%edi
call   1040 <rax_malloc@plt>
mov    %rax,%r12
movups (%r14),%xmm0
movups 0x10(%r14),%xmm1
movups 0x20(%r14),%xmm2
movups 0x30(%r14),%xmm3
movups %xmm0,0x138(%rsp)
movups %xmm1,0x148(%rsp)
movups %xmm2,0x158(%rsp)
movups %xmm3,0x168(%rsp)
movups 0x40(%r14),%xmm0
movups %xmm0,0x178(%rsp)
movups 0x50(%r14),%xmm0
movups %xmm0,0x188(%rsp)
movups 0x60(%r14),%xmm0
movups %xmm0,0x198(%rsp)
mov    0x70(%r14),%rax
mov    %rax,0x1a8(%rsp)
movupd (%r14),%xmm0
movapd %xmm0,%xmm1
mulpd  %xmm0,%xmm0
movupd %xmm0,0x1b8(%rsp)
movupd 0x10(%r14),%xmm0
movapd %xmm0,%xmm2
mulpd  %xmm0,%xmm0
movupd %xmm0,0x1c8(%rsp)
movupd 0x20(%r14),%xmm0
movapd %xmm0,%xmm3
mulpd  %xmm0,%xmm0
movupd %xmm0,0x1d8(%rsp)
movupd 0x30(%r14),%xmm0
movapd %xmm0,%xmm4
mulpd  %xmm0,%xmm0
movupd %xmm0,0x1e8(%rsp)
movupd 0x40(%r14),%xmm0
movapd %xmm0,%xmm5
mulpd  %xmm0,%xmm0
movupd %xmm0,0x1f8(%rsp)
movupd 0x50(%r14),%xmm0
movapd %xmm0,%xmm6
mulpd  %xmm0,%xmm0
movupd %xmm0,0x208(%rsp)
movupd 0x60(%r14),%xmm0
movapd %xmm0,%xmm8
mulpd  %xmm0,%xmm0
movupd %xmm0,0x218(%rsp)
movsd  0x70(%r14),%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x228(%rsp)
test   %ebp,%ebp
jle    155c <coreGTRCATSECONDARY+0x41c>
movapd %xmm1,%xmm7
movapd %xmm1,%xmm0
movsd  0x50(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm0,0xd0(%rsp)
unpckhpd %xmm7,%xmm7
mulsd  %xmm1,%xmm7
movapd %xmm7,0x40(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0xc0(%rsp)
unpckhpd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,0x30(%rsp)
movapd %xmm3,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0xb0(%rsp)
unpckhpd %xmm3,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,0x120(%rsp)
movapd %xmm4,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0xa0(%rsp)
unpckhpd %xmm4,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm4,0x110(%rsp)
movapd %xmm5,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x90(%rsp)
unpckhpd %xmm5,%xmm5
mulsd  %xmm1,%xmm5
movapd %xmm5,0x100(%rsp)
movapd %xmm6,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x80(%rsp)
unpckhpd %xmm6,%xmm6
mulsd  %xmm1,%xmm6
movapd %xmm6,0xf0(%rsp)
movapd %xmm8,%xmm7
movapd %xmm8,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x70(%rsp)
unpckhpd %xmm8,%xmm7
mulsd  %xmm1,%xmm7
movapd %xmm7,0xe0(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%r14d
lea    0x78(%r12),%rbp
xor    %r13d,%r13d
nopl   0x0(%rax)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xd0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x40(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xc0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x30(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xb0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x120(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xa0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x110(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x90(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x100(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x80(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xf0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x70(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0xe0(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  (%r15,%r13,8),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x0(%rbp)
add    $0x1,%r13
sub    $0xffffffffffffff80,%rbp
cmp    %r13,%r14
jne    13e0 <coreGTRCATSECONDARY+0x2a0>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    16b3 <coreGTRCATSECONDARY+0x573>
mov    %rbx,%r13
mov    %eax,%r14d
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
mov    0x28(%rsp),%rbx
jmp    15f4 <coreGTRCATSECONDARY+0x4b4>
nopl   0x0(%rax,%rax,1)
unpcklpd %xmm2,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
movapd %xmm5,0x40(%rsp)
movapd %xmm6,0x30(%rsp)
call   1030 <FABS@plt>
movsd  0xa5b(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd 0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
unpcklpd %xmm1,%xmm0
mulpd  0x40(%rsp),%xmm0
movapd %xmm0,%xmm1
movapd 0x10(%rsp),%xmm2
addpd  %xmm2,%xmm1
add    $0x1,%rbp
sub    $0xffffffffffffff80,%rbx
cmp    %r14,%rbp
je     16aa <coreGTRCATSECONDARY+0x56a>
movapd %xmm1,0x10(%rsp)
mov    0x68(%rsp),%rax
movslq (%rax,%rbp,4),%rax
mov    0x60(%rsp),%rcx
xorps  %xmm5,%xmm5
cvtsi2sdl (%rcx,%rbp,4),%xmm5
movsd  (%r15,%rax,8),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
shl    $0x7,%rax
add    %r12,%rax
mov    %rbp,%rcx
shl    $0x7,%rcx
mov    0x28(%rsp),%rdx
movsd  (%rdx,%rcx,1),%xmm0
mov    $0x2,%ecx
xorpd  %xmm3,%xmm3
nop
movsd  -0x8(%rax,%rcx,8),%xmm4
mulsd  -0x8(%rbx,%rcx,8),%xmm4
addsd  %xmm4,%xmm0
movsd  0x1a8(%rsp,%rcx,8),%xmm6
movhpd 0x128(%rsp,%rcx,8),%xmm6
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm6
addpd  %xmm3,%xmm6
cmp    $0x10,%rcx
je     1580 <coreGTRCATSECONDARY+0x440>
movsd  (%rax,%rcx,8),%xmm4
mulsd  (%rbx,%rcx,8),%xmm4
addsd  %xmm4,%xmm0
movsd  0x1b0(%rsp,%rcx,8),%xmm3
movhpd 0x130(%rsp,%rcx,8),%xmm3
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm3
addpd  %xmm6,%xmm3
add    $0x2,%rcx
jmp    1640 <coreGTRCATSECONDARY+0x500>
addpd  %xmm2,%xmm0
mov    %r13,%rbx
jmp    16b7 <coreGTRCATSECONDARY+0x577>
xorpd  %xmm0,%xmm0
movlpd %xmm0,(%rbx)
mov    0x58(%rsp),%rax
movhpd %xmm0,(%rax)
mov    %r12,%rdi
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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