#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 coreGTRCATPROT(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[20], s[20], dd[20];
  double tmp;
  double inv_Li, dlnLidlz, d2lnLidlz2;
  double dlnLdlz = 0.0;
  double d2lnLdlz2 = 0.0;
  d1 = d_start = (double *)rax_malloc(numberOfCategories * 20 * sizeof(double));
  for (l = 1; l < 20; 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 < 20; l++)
      d1[20 * 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[20 * cptr[i]];
    sum = &sumtable[20 * i];
    inv_Li = sum[0];
    dlnLidlz = 0.0;
    d2lnLidlz2 = 0.0;
    for (l = 1; l < 20; 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):
<coreGTRCATPROT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%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,-0x268(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x270(%rbp)
ff
imul   $0x14,-0x14(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <rax_malloc@plt>
mov    %rax,-0x50(%rbp)
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x40(%rbp)
cmpl   $0x14,-0x40(%rbp)
jge    1230 <coreGTRCATPROT+0xf0>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x100(%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,-0x1a0(%rbp,%rax,8)
ff ff
movslq -0x40(%rbp),%rax
movsd  -0x1a0(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x10(%rbp),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x240(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11a9 <coreGTRCATPROT+0x69>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12a7 <coreGTRCATPROT+0x167>
movl   $0x1,-0x40(%rbp)
cmpl   $0x14,-0x40(%rbp)
jge    1294 <coreGTRCATPROT+0x154>
movslq -0x40(%rbp),%rax
movsd  -0x240(%rbp,%rax,8),%xmm0
ff ff
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
mov    -0x48(%rbp),%rax
imul   $0x14,-0x3c(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    124a <coreGTRCATPROT+0x10a>
jmp    1299 <coreGTRCATPROT+0x159>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1237 <coreGTRCATPROT+0xf7>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1507 <coreGTRCATPROT+0x3c7>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x278(%rbp)
ff
movsd  -0x278(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x280(%rbp)
ff
movsd  -0x278(%rbp),%xmm0
ff
mulsd  -0x278(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x288(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x14,(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    0x18(%rbp),%rax
imul   $0x14,-0x3c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x250(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x258(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x260(%rbp)
ff
movl   $0x1,-0x40(%rbp)
cmpl   $0x14,-0x40(%rbp)
jge    1426 <coreGTRCATPROT+0x2e6>
mov    -0x48(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x248(%rbp)
ff
addsd  -0x250(%rbp),%xmm0
ff
movsd  %xmm0,-0x250(%rbp)
ff
movsd  -0x248(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0x1a0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x258(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x258(%rbp)
ff
movsd  -0x248(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
movsd  -0x100(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x260(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x260(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1382 <coreGTRCATPROT+0x242>
movsd  -0x250(%rbp),%xmm0
ff
call   1030 <FABS@plt>
movaps %xmm0,%xmm1
movsd  0xbc2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x250(%rbp)
ff
movsd  -0x250(%rbp),%xmm0
ff
mulsd  -0x258(%rbp),%xmm0
ff
movsd  %xmm0,-0x258(%rbp)
ff
movsd  -0x250(%rbp),%xmm0
ff
mulsd  -0x260(%rbp),%xmm0
ff
movsd  %xmm0,-0x260(%rbp)
ff
movsd  -0x280(%rbp),%xmm0
ff
movsd  -0x258(%rbp),%xmm2
ff
movsd  -0x268(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x268(%rbp)
ff
movsd  -0x288(%rbp),%xmm0
ff
movsd  -0x260(%rbp),%xmm1
ff
movsd  -0x258(%rbp),%xmm2
ff
movsd  -0x258(%rbp),%xmm3
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x270(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x270(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12ae <coreGTRCATPROT+0x16e>
movsd  -0x268(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x270(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rdi
call   1050 <rax_free@plt>
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreGTRCATPROT>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
mov    %r9,0x40(%rsp)
mov    %r8d,0x20(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rdx,%r13
mov    %esi,%ebx
movaps %xmm0,0x10(%rsp)
mov    %rdi,%r14
mov    0x290(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x288(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    0x280(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    %esi,%eax
shl    $0x5,%eax
lea    (%rax,%rax,4),%edi
call   1040 <rax_malloc@plt>
mov    %rax,%r12
lea    0x1a8(%rsp),%rdi
mov    $0x98,%edx
mov    %r14,%rsi
call   1060 <memcpy@plt>
movapd 0x10(%rsp),%xmm3
movapd %xmm3,%xmm0
unpcklpd %xmm3,%xmm0
movupd (%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0x68(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x108(%rsp)
movupd 0x10(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0x78(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x118(%rsp)
movupd 0x20(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0x88(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x128(%rsp)
movupd 0x30(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0x98(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x138(%rsp)
movupd 0x40(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0xa8(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x148(%rsp)
movupd 0x50(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0xb8(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x158(%rsp)
movupd 0x60(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0xc8(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x168(%rsp)
movupd 0x70(%r14),%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0xd8(%rsp)
mulpd  %xmm0,%xmm1
movupd %xmm1,0x178(%rsp)
movupd 0x80(%r14),%xmm1
mulpd  %xmm1,%xmm0
mulpd  %xmm1,%xmm1
movupd %xmm1,0xe8(%rsp)
movupd %xmm0,0x188(%rsp)
movsd  0x90(%r14),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0xf8(%rsp)
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x198(%rsp)
test   %ebx,%ebx
jle    1394 <coreGTRCATPROT+0x244>
mov    %ebx,%r14d
xor    %r15d,%r15d
mov    %r12,%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x100(%rsp,%rbp,8),%xmm0
mulsd  0x0(%r13,%r15,8),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x14,%rbp
jne    1360 <coreGTRCATPROT+0x210>
add    $0x1,%r15
add    $0xa0,%rbx
cmp    %r14,%r15
jne    1350 <coreGTRCATPROT+0x200>
mov    0x20(%rsp),%eax
test   %eax,%eax
jle    14fc <coreGTRCATPROT+0x3ac>
mov    %eax,%r14d
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
mov    0x8(%rsp),%r15
mov    0x30(%rsp),%rbx
jmp    1437 <coreGTRCATPROT+0x2e7>
nopl   0x0(%rax,%rax,1)
unpcklpd %xmm2,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
movapd %xmm5,0x10(%rsp)
movapd %xmm6,0x50(%rsp)
call   1030 <FABS@plt>
movsd  0xc1b(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd 0x50(%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  0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
movapd 0x20(%rsp),%xmm2
addpd  %xmm2,%xmm1
add    $0x1,%rbp
add    $0xa0,%r15
cmp    %r14,%rbp
je     14f6 <coreGTRCATPROT+0x3a6>
movapd %xmm1,0x20(%rsp)
movslq (%rbx,%rbp,4),%rax
movsd  0x0(%r13,%rax,8),%xmm1
mov    0x48(%rsp),%rcx
xorps  %xmm5,%xmm5
cvtsi2sdl (%rcx,%rbp,4),%xmm5
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
lea    (%rax,%rax,4),%rax
shl    $0x5,%rax
add    %r12,%rax
lea    0x0(,%rbp,4),%rcx
add    %rbp,%rcx
shl    $0x5,%rcx
mov    0x8(%rsp),%rdx
movsd  (%rdx,%rcx,1),%xmm0
mov    $0x2,%ecx
xorpd  %xmm3,%xmm3
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rax,%rcx,8),%xmm4
mulsd  -0x8(%r15,%rcx,8),%xmm4
addsd  %xmm4,%xmm0
movsd  0x58(%rsp,%rcx,8),%xmm6
movhpd 0x198(%rsp,%rcx,8),%xmm6
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm6
addpd  %xmm3,%xmm6
cmp    $0x14,%rcx
je     13c0 <coreGTRCATPROT+0x270>
movsd  (%rax,%rcx,8),%xmm4
mulsd  (%r15,%rcx,8),%xmm4
addsd  %xmm4,%xmm0
movsd  0x60(%rsp,%rcx,8),%xmm3
movhpd 0x1a0(%rsp,%rcx,8),%xmm3
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm3
addpd  %xmm6,%xmm3
add    $0x2,%rcx
jmp    1490 <coreGTRCATPROT+0x340>
addpd  %xmm2,%xmm0
jmp    1500 <coreGTRCATPROT+0x3b0>
xorpd  %xmm0,%xmm0
mov    0x40(%rsp),%rax
movlpd %xmm0,(%rax)
mov    0x38(%rsp),%rax
movhpd %xmm0,(%rax)
mov    %r12,%rdi
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <rax_free@plt>

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