#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 coreGTRGAMMA(const int upper, double *sumtable, volatile double *d1,
                  volatile double *d2, double *EIGN, double *gammaRates,
                  double lz, int *wrptr) {
  int i, j, k;
  double *diagptable, *diagptable_start, *sum, tmp_1, inv_Li, dlnLidlz,
      d2lnLidlz2, ki, kisqr, dlnLdlz = 0.0, d2lnLdlz2 = 0.0;
  diagptable = diagptable_start = (double *)rax_malloc(sizeof(double) * 64);
  for (i = 0; i < 4; i++) {
    ki = gammaRates[i];
    kisqr = ki * ki;
    diagptable[i * 16] = exp(EIGN[0] * ki * lz);
    diagptable[i * 16 + 1] = exp(EIGN[1] * ki * lz);
    diagptable[i * 16 + 2] = exp(EIGN[2] * ki * lz);
    diagptable[i * 16 + 3] = EIGN[0] * ki;
    diagptable[i * 16 + 4] = EIGN[0] * EIGN[0] * kisqr;
    diagptable[i * 16 + 5] = EIGN[1] * ki;
    diagptable[i * 16 + 6] = EIGN[1] * EIGN[1] * kisqr;
    diagptable[i * 16 + 7] = EIGN[2] * ki;
    diagptable[i * 16 + 8] = EIGN[2] * EIGN[2] * kisqr;
  }
  for (i = 0; i < upper; i++) {
    sum = &(sumtable[i * 16]);
    inv_Li = 0.0;
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (j = 0; j < 4; j++) {
      inv_Li += sum[4 * j];
      for (k = 0; k < 3; k++) {
        tmp_1 = diagptable[16 * j + k] * sum[4 * j + k + 1];
        inv_Li += tmp_1;
        dlnLidlz += tmp_1 * diagptable[16 * j + k * 2 + 3];
        d2lnLidlz2 += tmp_1 * diagptable[16 * j + k * 2 + 4];
      }
    }
    inv_Li = 1.0 / FABS(inv_Li);
    dlnLidlz *= inv_Li;
    d2lnLidlz2 *= inv_Li;
    dlnLdlz += wrptr[i] * dlnLidlz;
    d2lnLdlz2 += wrptr[i] * (d2lnLidlz2 - dlnLidlz * dlnLidlz);
  }
  *d1 = dlnLdlz;
  *d2 = d2lnLdlz2;
  rax_free(diagptable_start);
}


x86 assembly (clang, -O0):
<coreGTRGAMMA>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    $0x200,%edi
call   1040 <rax_malloc@plt>
mov    %rax,-0x58(%rbp)
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x4,-0x3c(%rbp)
jge    1367 <coreGTRGAMMA+0x227>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
call   1060 <exp@plt>
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
call   1060 <exp@plt>
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
call   1060 <exp@plt>
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x28(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    119a <coreGTRGAMMA+0x5a>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1579 <coreGTRGAMMA+0x439>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x4,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x4,-0x40(%rbp)
jge    14b2 <coreGTRGAMMA+0x372>
mov    -0x60(%rbp),%rax
mov    -0x40(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    149f <coreGTRGAMMA+0x35f>
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%ecx
shl    $0x4,%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x40(%rbp),%ecx
shl    $0x2,%ecx
add    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%ecx
shl    $0x4,%ecx
mov    -0x44(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x40(%rbp),%ecx
shl    $0x4,%ecx
mov    -0x44(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13de <coreGTRGAMMA+0x29e>
jmp    14a4 <coreGTRGAMMA+0x364>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13b1 <coreGTRGAMMA+0x271>
movsd  -0x70(%rbp),%xmm0
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xb39(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    136e <coreGTRGAMMA+0x22e>
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRGAMMA>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm0,(%rsp)
mov    %r9,%r13
mov    %r8,%r14
mov    %rcx,0x40(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rsi,%r12
mov    %edi,0xc(%rsp)
mov    0x80(%rsp),%r15
mov    $0x200,%edi
call   1040 <rax_malloc@plt>
mov    %rax,%rbx
mov    $0x8,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x0(%r13),%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%r14),%xmm0
mulsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x40(%rbx,%rbp,8)
movsd  0x8(%r14),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x38(%rbx,%rbp,8)
movsd  0x10(%r14),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x30(%rbx,%rbp,8)
movsd  (%r14),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x28(%rbx,%rbp,8)
movsd  (%r14),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbx,%rbp,8)
movsd  0x8(%r14),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x18(%rbx,%rbp,8)
movsd  0x8(%r14),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbx,%rbp,8)
movapd %xmm2,%xmm0
mulsd  0x10(%r14),%xmm0
movsd  %xmm0,-0x8(%rbx,%rbp,8)
movsd  0x10(%r14),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x8,%r13
add    $0x10,%rbp
cmp    $0x48,%rbp
jne    1190 <coreGTRGAMMA+0x50>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1560 <coreGTRGAMMA+0x420>
mov    %eax,%r14d
add    $0x70,%r12
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movapd %xmm0,0x10(%rsp)
movsd  -0x70(%r12),%xmm0
xorpd  %xmm4,%xmm4
addsd  %xmm4,%xmm0
movsd  (%rbx),%xmm2
movsd  0x8(%rbx),%xmm1
mulsd  -0x68(%r12),%xmm2
addsd  %xmm2,%xmm0
movsd  0x18(%rbx),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
mulsd  0x20(%rbx),%xmm2
addsd  %xmm4,%xmm2
mulsd  -0x60(%r12),%xmm1
addsd  %xmm1,%xmm0
movsd  0x28(%rbx),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0x30(%rbx),%xmm1
addsd  %xmm3,%xmm4
movsd  0x10(%rbx),%xmm3
mulsd  -0x58(%r12),%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm3,%xmm0
movsd  0x38(%rbx),%xmm2
mulsd  %xmm3,%xmm2
mulsd  0x40(%rbx),%xmm3
addsd  -0x50(%r12),%xmm0
addsd  %xmm4,%xmm2
movsd  0x80(%rbx),%xmm4
mulsd  -0x48(%r12),%xmm4
addsd  %xmm1,%xmm3
addsd  %xmm4,%xmm0
movsd  0x98(%rbx),%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm2,%xmm1
mulsd  0xa0(%rbx),%xmm4
addsd  %xmm3,%xmm4
movsd  0x88(%rbx),%xmm2
mulsd  -0x40(%r12),%xmm2
addsd  %xmm2,%xmm0
movsd  0xa8(%rbx),%xmm3
mulsd  %xmm2,%xmm3
mulsd  0xb0(%rbx),%xmm2
addsd  %xmm1,%xmm3
movsd  0x90(%rbx),%xmm1
mulsd  -0x38(%r12),%xmm1
addsd  %xmm4,%xmm2
addsd  %xmm1,%xmm0
movsd  0xb8(%rbx),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0xc0(%rbx),%xmm1
addsd  -0x30(%r12),%xmm0
addsd  %xmm3,%xmm4
movsd  0x100(%rbx),%xmm3
mulsd  -0x28(%r12),%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm3,%xmm0
movsd  0x118(%rbx),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
mulsd  0x120(%rbx),%xmm3
addsd  %xmm1,%xmm3
movupd 0x108(%rbx),%xmm1
movupd -0x20(%r12),%xmm4
mulpd  %xmm1,%xmm4
addsd  %xmm4,%xmm0
movsd  0x128(%rbx),%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm2,%xmm5
movsd  0x130(%rbx),%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
unpckhpd %xmm4,%xmm4
movsd  0x138(%rbx),%xmm3
mulsd  %xmm4,%xmm3
movsd  0x140(%rbx),%xmm6
mulsd  %xmm4,%xmm6
movapd %xmm4,%xmm1
addsd  %xmm0,%xmm1
movupd (%r12),%xmm0
addsd  %xmm5,%xmm3
addsd  -0x10(%r12),%xmm1
addsd  %xmm2,%xmm6
movsd  0x180(%rbx),%xmm2
mulsd  -0x8(%r12),%xmm2
addsd  %xmm2,%xmm1
movsd  0x198(%rbx),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
mulsd  0x1a0(%rbx),%xmm2
addsd  %xmm6,%xmm2
movupd 0x188(%rbx),%xmm3
mulpd  %xmm0,%xmm3
addsd  %xmm3,%xmm1
movsd  0x1a8(%rbx),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
movsd  0x1b0(%rbx),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
unpckhpd %xmm3,%xmm3
movsd  0x1b8(%rbx),%xmm2
mulsd  %xmm3,%xmm2
movsd  0x1c0(%rbx),%xmm6
mulsd  %xmm3,%xmm6
movapd %xmm3,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm5,%xmm2
movapd %xmm2,0x20(%rsp)
addsd  %xmm4,%xmm6
movsd  %xmm6,(%rsp)
call   1030 <FABS@plt>
movsd  0xafd(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd 0x20(%rsp),%xmm3
mulsd  %xmm1,%xmm3
mulsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl (%r15,%rbp,4),%xmm0
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movapd %xmm3,%xmm2
unpcklpd %xmm0,%xmm0
unpcklpd %xmm1,%xmm2
movapd 0x10(%rsp),%xmm1
mulpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
addpd  %xmm1,%xmm0
add    $0x1,%rbp
sub    $0xffffffffffffff80,%r12
cmp    %rbp,%r14
jne    12a0 <coreGTRGAMMA+0x160>
addpd  %xmm1,%xmm2
jmp    1564 <coreGTRGAMMA+0x424>
xorpd  %xmm2,%xmm2
mov    0x38(%rsp),%rax
movlpd %xmm2,(%rax)
mov    0x40(%rsp),%rax
movhpd %xmm2,(%rax)
mov    %rbx,%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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

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