#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 coreGTRCAT(int upper, int numberOfCategories, double *sum,
                volatile double *d1, volatile double *d2, double *rptr,
                double *EIGN, int *cptr, double lz, int *wgt) {
  int i;
  double *d, *d_start, tmp_0, tmp_1, tmp_2, inv_Li, dlnLidlz, d2lnLidlz2,
      dlnLdlz = 0.0, d2lnLdlz2 = 0.0;
  double e[6];
  double dd1, dd2, dd3;
  e[0] = EIGN[0];
  e[1] = EIGN[0] * EIGN[0];
  e[2] = EIGN[1];
  e[3] = EIGN[1] * EIGN[1];
  e[4] = EIGN[2];
  e[5] = EIGN[2] * EIGN[2];
  d = d_start = (double *)rax_malloc(numberOfCategories * 4 * sizeof(double));
  dd1 = e[0] * lz;
  dd2 = e[2] * lz;
  dd3 = e[4] * lz;
  for (i = 0; i < numberOfCategories; i++) {
    d[i * 4] = exp(dd1 * rptr[i]);
    d[i * 4 + 1] = exp(dd2 * rptr[i]);
    d[i * 4 + 2] = exp(dd3 * rptr[i]);
  }
  for (i = 0; i < upper; i++) {
    double r = rptr[cptr[i]], wr1 = r * wgt[i], wr2 = r * r * wgt[i];
    d = &d_start[4 * cptr[i]];
    inv_Li = sum[4 * i];
    inv_Li += (tmp_0 = d[0] * sum[4 * i + 1]);
    inv_Li += (tmp_1 = d[1] * sum[4 * i + 2]);
    inv_Li += (tmp_2 = d[2] * sum[4 * i + 3]);
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz = tmp_0 * e[0];
    d2lnLidlz2 = tmp_0 * e[1];
    dlnLidlz += tmp_1 * e[2];
    d2lnLidlz2 += tmp_1 * e[3];
    dlnLidlz += tmp_2 * e[4];
    d2lnLidlz2 += tmp_2 * e[5];
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wr1 * dlnLidlz;
    d2lnLdlz2 += wr2 * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *d1 = dlnLdlz;
  *d2 = d2lnLdlz2;
  rax_free(d_start);
}


x86 assembly (clang, -O0):
<coreGTRCAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <rax_malloc@plt>
mov    %rax,-0x48(%rbp)
mov    %rax,-0x40(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1308 <coreGTRCAT+0x1c8>
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
mov    -0x40(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
mov    -0x40(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xd8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
mov    -0x40(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1264 <coreGTRCAT+0x124>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1596 <coreGTRCAT+0x456>
mov    -0x28(%rbp),%rax
mov    0x18(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0xe0(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x48(%rbp),%rax
mov    0x18(%rbp),%rcx
movslq -0x34(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xbac(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0xe8(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0xf0(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    130f <coreGTRCAT+0x1cf>
movsd  -0x80(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRCAT>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movsd  %xmm0,0x20(%rsp)
mov    %r9,%r13
mov    %r8,0x70(%rsp)
mov    %rcx,0x68(%rsp)
mov    %rdx,%r12
mov    %esi,%ebp
mov    %edi,%r14d
mov    0x100(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    0xf8(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    0xf0(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %esi,%edi
shl    $0x5,%edi
call   1040 <rax_malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1250 <coreGTRCAT+0x110>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %ebp,%r15d
shl    $0x3,%r15
xor    %ebp,%ebp
xchg   %ax,%ax
movsd  0x0(%r13,%rbp,1),%xmm0
mulsd  0x40(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,(%rbx,%rbp,4)
movsd  0x0(%r13,%rbp,1),%xmm0
mulsd  0x30(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x8(%rbx,%rbp,4)
movsd  0x0(%r13,%rbp,1),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x10(%rbx,%rbp,4)
add    $0x8,%rbp
cmp    %rbp,%r15
jne    1200 <coreGTRCAT+0xc0>
test   %r14d,%r14d
jle    13ef <coreGTRCAT+0x2af>
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x80(%rsp)
mov    %r14d,%eax
shl    $0x2,%rax
mov    %rax,0x78(%rsp)
xorpd  %xmm0,%xmm0
xor    %r15d,%r15d
mov    0x58(%rsp),%rbp
mov    0x60(%rsp),%r14
nop
movapd %xmm0,0x20(%rsp)
movslq 0x0(%rbp,%r15,1),%rax
movsd  0x0(%r13,%rax,8),%xmm0
xorps  %xmm2,%xmm2
cvtsi2sdl (%r14,%r15,1),%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
unpcklpd %xmm2,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,0x40(%rsp)
shl    $0x5,%rax
movsd  (%rbx,%rax,1),%xmm1
mulsd  0x8(%r12,%r15,8),%xmm1
movsd  %xmm1,0x98(%rsp)
movsd  (%r12,%r15,8),%xmm0
addsd  %xmm1,%xmm0
movupd 0x8(%rbx,%rax,1),%xmm1
movupd 0x10(%r12,%r15,8),%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,0xa0(%rsp)
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
movapd %xmm1,0x30(%rsp)
addsd  %xmm1,%xmm0
call   1030 <FABS@plt>
movsd  0xcbb(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
movsd  0x98(%rsp),%xmm3
mulsd  %xmm3,%xmm0
movapd 0xa0(%rsp),%xmm4
movapd %xmm4,%xmm2
mulsd  0x10(%rsp),%xmm2
mulsd  0x90(%rsp),%xmm3
addsd  %xmm0,%xmm2
mulsd  0x88(%rsp),%xmm4
movapd 0x30(%rsp),%xmm5
movapd %xmm5,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  %xmm3,%xmm4
addsd  %xmm2,%xmm0
movapd %xmm5,%xmm2
mulsd  0x80(%rsp),%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm2
mulpd  0x40(%rsp),%xmm2
movapd %xmm2,%xmm0
addpd  %xmm1,%xmm0
add    $0x4,%r15
cmp    %r15,0x78(%rsp)
jne    12b0 <coreGTRCAT+0x170>
addpd  %xmm1,%xmm2
jmp    13f3 <coreGTRCAT+0x2b3>
xorpd  %xmm2,%xmm2
mov    0x68(%rsp),%rax
movhpd %xmm2,(%rax)
mov    0x70(%rsp),%rax
movlpd %xmm2,(%rax)
mov    %rbx,%rdi
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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

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