void evaluateGTRCATMULT_VECTOR(int *ex2, int *cptr, int *modelptr,
                               double *x2_start, double *v, double *EIGN,
                               double *rptr, double *tipVector, double *pz,
                               char *tipX1, int lower, int n,
                               int numberOfCategories, int numberOfModels,
                               int multiBranch) {
  double z, lz = 0.0, ki, lz1, lz2, lz3, term;
  int i;
  double *diagptable, *diagptable_start;
  double *x1, *x2;
  int model, modelCounter;
  if (!multiBranch) {
    z = pz[0];
    if (z < 1.0E-15)
      z = 1.0E-15;
    lz = log(z);
  }
  diagptable = diagptable_start = (double *)malloc(
      sizeof(double) * numberOfCategories * 3 * numberOfModels);
  for (modelCounter = 0; modelCounter < numberOfModels; modelCounter++) {
    if (multiBranch) {
      z = pz[modelCounter];
      if (z < 1.0E-15)
        z = 1.0E-15;
      lz = log(z);
    }
    lz1 = EIGN[modelCounter * 3] * lz;
    lz2 = EIGN[modelCounter * 3 + 1] * lz;
    lz3 = EIGN[modelCounter * 3 + 2] * lz;
    for (i = 0; i < numberOfCategories; i++) {
      ki = rptr[i];
      *diagptable++ = exp(ki * lz1);
      *diagptable++ = exp(ki * lz2);
      *diagptable++ = exp(ki * lz3);
    }
  }
  for (i = lower; i < n; i++) {
    model = modelptr[i];
    x1 = &(tipVector[model * 64 + 4 * tipX1[i]]);
    x2 = &x2_start[4 * i];
    diagptable =
        &diagptable_start[model * 3 * numberOfCategories + 3 * cptr[i]];
    term = x1[0] * x2[0];
    term += x1[1] * x2[1] * *diagptable++;
    term += x1[2] * x2[2] * *diagptable++;
    term += x1[3] * x2[3] * *diagptable++;
    term =
        (log(term)) +
        (ex2[i] *
         log((
             1.0 /
             115792089237316195423570985008687907853269984665640564039457584007913129639936.0)));
    v[i] = term;
  }
  free(diagptable_start);
}


x86 assembly (clang, -O0):
<evaluateGTRCATMULT_VECTOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,0x50(%rbp)
jne    11d0 <evaluateGTRCATMULT_VECTOR+0x90>
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe57(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    11c1 <evaluateGTRCATMULT_VECTOR+0x81>
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x40(%rbp)
movslq 0x40(%rbp),%rax
shl    $0x3,%rax
imul   $0x3,%rax,%rdi
movslq 0x48(%rbp),%rax
imul   %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    0x48(%rbp),%eax
jge    1367 <evaluateGTRCATMULT_VECTOR+0x227>
cmpl   $0x0,0x50(%rbp)
je     1258 <evaluateGTRCATMULT_VECTOR+0x118>
mov    0x20(%rbp),%rax
movslq -0x98(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdcf(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1249 <evaluateGTRCATMULT_VECTOR+0x109>
movsd  0xdbc(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
imul   $0x3,-0x98(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
imul   $0x3,-0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
imul   $0x3,-0x98(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    0x40(%rbp),%eax
jge    134e <evaluateGTRCATMULT_VECTOR+0x20e>
mov    0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  %xmm0,(%rax)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    12bc <evaluateGTRCATMULT_VECTOR+0x17c>
jmp    1353 <evaluateGTRCATMULT_VECTOR+0x213>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11fb <evaluateGTRCATMULT_VECTOR+0xbb>
mov    0x30(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    0x38(%rbp),%eax
jge    1545 <evaluateGTRCATMULT_VECTOR+0x405>
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x94(%rbp)
mov    0x18(%rbp),%rax
mov    -0x94(%rbp),%ecx
shl    $0x6,%ecx
mov    0x28(%rbp),%rdx
movslq -0x6c(%rbp),%rsi
movsbl (%rdx,%rsi,1),%edx
shl    $0x2,%edx
add    %edx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x6c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x80(%rbp),%rax
imul   $0x3,-0x94(%rbp),%ecx
imul   0x40(%rbp),%ecx
mov    -0x10(%rbp),%rdx
movslq -0x6c(%rbp),%rsi
imul   $0x3,(%rdx,%rsi,4),%edx
add    %edx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x88(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x90(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x88(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x90(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  (%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x88(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x90(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  (%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x88(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x90(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x78(%rbp)
movsd  (%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xb08(%rip),%xmm0
call   1060 <log@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    136d <evaluateGTRCATMULT_VECTOR+0x22d>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluateGTRCATMULT_VECTOR>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,0x88(%rsp)
mov    %r8,0x68(%rsp)
mov    %rcx,0x80(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,0x58(%rsp)
mov    %rdi,0x60(%rsp)
mov    0x110(%rsp),%ecx
mov    0x108(%rsp),%ebx
mov    0x100(%rsp),%ebp
mov    0xf8(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0xf0(%rsp),%r13d
mov    0xe8(%rsp),%rax
mov    %rax,0x78(%rsp)
mov    0xe0(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0xd8(%rsp),%rax
mov    %rax,0x70(%rsp)
mov    0xd0(%rsp),%r12
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ecx,0x44(%rsp)
test   %ecx,%ecx
jne    11fa <evaluateGTRCATMULT_VECTOR+0xba>
movsd  0xe1a(%rip),%xmm0
mov    0x48(%rsp),%rax
maxsd  (%rax),%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x8(%rsp)
movslq %ebp,%rax
mov    %ebp,0x14(%rsp)
movslq %ebx,%rbp
imul   %rbp,%rax
shl    $0x3,%rax
lea    (%rax,%rax,2),%rdi
call   1040 <malloc@plt>
mov    %rax,%rdi
test   %ebp,%ebp
mov    0x14(%rsp),%ebp
mov    %rax,0x20(%rsp)
jle    1336 <evaluateGTRCATMULT_VECTOR+0x1f6>
mov    %ebx,%eax
mov    %rax,0x90(%rsp)
mov    %ebp,%r15d
xor    %r14d,%r14d
mov    %rdi,%rbx
jmp    1252 <evaluateGTRCATMULT_VECTOR+0x112>
xchg   %ax,%ax
add    $0x1,%r14
cmp    0x90(%rsp),%r14
je     1336 <evaluateGTRCATMULT_VECTOR+0x1f6>
cmpl   $0x0,0x44(%rsp)
je     127c <evaluateGTRCATMULT_VECTOR+0x13c>
movsd  0xd9f(%rip),%xmm0
mov    0x48(%rsp),%rax
maxsd  (%rax,%r14,8),%xmm0
call   1060 <log@plt>
mov    0x20(%rsp),%rdi
movsd  %xmm0,0x8(%rsp)
test   %ebp,%ebp
jle    1240 <evaluateGTRCATMULT_VECTOR+0x100>
lea    (%r14,%r14,2),%eax
mov    0x88(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0x8(%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0x10(%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r12,%rbp,8),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x38(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  %xmm0,(%rbx)
movsd  0x30(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,0x8(%rbx)
movsd  0x18(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,0x10(%rbx)
add    $0x18,%rbx
add    $0x1,%rbp
cmp    %rbp,%r15
jne    12d0 <evaluateGTRCATMULT_VECTOR+0x190>
mov    0x14(%rsp),%ebp
mov    0x20(%rsp),%rdi
jmp    1240 <evaluateGTRCATMULT_VECTOR+0x100>
mov    0x40(%rsp),%ecx
cmp    %ecx,%r13d
mov    %ebp,%r14d
mov    0x80(%rsp),%rbp
mov    0x78(%rsp),%r12
mov    0x70(%rsp),%rbx
jge    1470 <evaluateGTRCATMULT_VECTOR+0x330>
movslq %r13d,%rax
movslq %ecx,%r8
shl    $0x2,%r13d
mov    0x50(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x38(%rsp)
add    %rax,%r12
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x30(%rsp)
mov    0x60(%rsp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x28(%rsp)
mov    0x68(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x8(%rsp)
sub    %rax,%r8
mov    %r8,0x18(%rsp)
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rax
movslq (%rax,%r15,4),%rax
mov    %rax,%rcx
shl    $0x6,%rcx
movsbq (%r12,%r15,1),%rdx
lea    (%rcx,%rdx,4),%rcx
imul   %r14d,%eax
mov    0x30(%rsp),%rdx
add    (%rdx,%r15,4),%eax
movslq %r13d,%r13
lea    (%rax,%rax,2),%eax
movsd  (%rbx,%rcx,8),%xmm0
movsd  0x8(%rbx,%rcx,8),%xmm1
mulsd  0x0(%rbp,%r13,8),%xmm0
mulsd  0x8(%rbp,%r13,8),%xmm1
cltq
mulsd  (%rdi,%rax,8),%xmm1
movsd  0x10(%rbx,%rcx,8),%xmm2
mulsd  0x10(%rbp,%r13,8),%xmm2
mulsd  0x8(%rdi,%rax,8),%xmm2
addsd  %xmm0,%xmm1
movsd  0x18(%rbx,%rcx,8),%xmm0
mulsd  0x18(%rbp,%r13,8),%xmm0
addsd  %xmm1,%xmm2
mulsd  0x10(%rdi,%rax,8),%xmm0
addsd  %xmm2,%xmm0
call   1060 <log@plt>
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rax
xorps  %xmm1,%xmm1
cvtsi2sdl (%rax,%r15,4),%xmm1
mulsd  0xbba(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x8(%rsp),%rax
movsd  %xmm1,(%rax,%r15,8)
add    $0x4,%r13d
add    $0x1,%r15
cmp    %r15,0x18(%rsp)
jne    13b0 <evaluateGTRCATMULT_VECTOR+0x270>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @evaluateGTRCATMULT_VECTOR(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, double* nocapture %3, double* nocapture writeonly %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8, i8* nocapture %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14) {
%16 = icmp eq i32 %14, 0
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load double, double* %8
%19 = fcmp olt double %18, 1.000000e-15
%20 = select i1 %19, double 1.000000e-15, double %18
%21 = tail call double @log(double %20)
br label %22
22: ; preds = %17, %15
%23 = phi double [ 0.000000e+00, %15 ], [ %21, %17 ]
%24 = sext i32 %12 to i64
%25 = mul nsw i64 %24, 24
%26 = sext i32 %13 to i64
%27 = mul i64 %25, %26
%28 = tail call i8* @malloc(i64 %27)
%29 = bitcast i8* %28 to double*
%30 = icmp sgt i32 %13, 0
br i1 %30, label %31, label %35
31: ; preds = %22
%32 = icmp sgt i32 %12, 0
%33 = zext i32 %13 to i64
%34 = zext i32 %12 to i64
br label %40
35: ; preds = %84, %22
%36 = icmp slt i32 %10, %11
br i1 %36, label %37, label %145
37: ; preds = %35
%38 = sext i32 %10 to i64
%39 = sext i32 %11 to i64
br label %88
40: ; preds = %31, %84
%41 = phi i64 [ 0, %31 ], [ %86, %84 ]
%42 = phi double [ %23, %31 ], [ %51, %84 ]
%43 = phi double* [ %29, %31 ], [ %85, %84 ]
br i1 %16, label %50, label %44
44: ; preds = %40
%45 = getelementptr inbounds double, double* %8, i64 %41
%46 = load double, double* %45
%47 = fcmp olt double %46, 1.000000e-15
%48 = select i1 %47, double 1.000000e-15, double %46
%49 = tail call double @log(double %48)
br label %50
50: ; preds = %44, %40
%51 = phi double [ %49, %44 ], [ %42, %40 ]
%52 = trunc i64 %41 to i32
%53 = mul nsw i32 %52, 3
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds double, double* %5, i64 %54
%56 = load double, double* %55
%57 = fmul double %51, %56
%58 = add nuw nsw i32 %53, 1
%59 = zext i32 %58 to i64
%60 = getelementptr inbounds double, double* %5, i64 %59
%61 = load double, double* %60
%62 = fmul double %51, %61
%63 = add nuw nsw i32 %53, 2
%64 = zext i32 %63 to i64
%65 = getelementptr inbounds double, double* %5, i64 %64
%66 = load double, double* %65
%67 = fmul double %51, %66
br i1 %32, label %68, label %84
68: ; preds = %50, %68
%69 = phi i64 [ %82, %68 ], [ 0, %50 ]
%70 = phi double* [ %81, %68 ], [ %43, %50 ]
%71 = getelementptr inbounds double, double* %6, i64 %69
%72 = load double, double* %71
%73 = fmul double %57, %72
%74 = tail call double @exp(double %73)
%75 = getelementptr inbounds double, double* %70, i64 1
store double %74, double* %70
%76 = fmul double %62, %72
%77 = tail call double @exp(double %76)
%78 = getelementptr inbounds double, double* %70, i64 2
store double %77, double* %75
%79 = fmul double %67, %72
%80 = tail call double @exp(double %79)
%81 = getelementptr inbounds double, double* %70, i64 3
store double %80, double* %78
%82 = add nuw nsw i64 %69, 1
%83 = icmp eq i64 %82, %34
br i1 %83, label %84, label %68
84: ; preds = %68, %50
%85 = phi double* [ %43, %50 ], [ %81, %68 ]
%86 = add nuw nsw i64 %41, 1
%87 = icmp eq i64 %86, %33
br i1 %87, label %35, label %40
88: ; preds = %37, %88
%89 = phi i64 [ %38, %37 ], [ %143, %88 ]
%90 = trunc i64 %89 to i32
%91 = getelementptr inbounds i32, i32* %2, i64 %89
%92 = load i32, i32* %91
%93 = shl nsw i32 %92, 6
%94 = getelementptr inbounds i8, i8* %9, i64 %89
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = shl nsw i32 %96, 2
%98 = add nsw i32 %97, %93
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %7, i64 %99
%101 = shl nsw i32 %90, 2
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %3, i64 %102
%104 = mul i32 %92, %12
%105 = getelementptr inbounds i32, i32* %1, i64 %89
%106 = load i32, i32* %105
%107 = add i32 %106, %104
%108 = mul i32 %107, 3
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %29, i64 %109
%111 = load double, double* %100
%112 = load double, double* %103
%113 = fmul double %111, %112
%114 = getelementptr inbounds double, double* %100, i64 1
%115 = load double, double* %114
%116 = getelementptr inbounds double, double* %103, i64 1
%117 = load double, double* %116
%118 = fmul double %115, %117
%119 = getelementptr inbounds double, double* %110, i64 1
%120 = load double, double* %110
%121 = tail call double @llvm.fmuladd.f64(double %118, double %120, double %113)
%122 = getelementptr inbounds double, double* %100, i64 2
%123 = load double, double* %122
%124 = getelementptr inbounds double, double* %103, i64 2
%125 = load double, double* %124
%126 = fmul double %123, %125
%127 = getelementptr inbounds double, double* %119, i64 1
%128 = load double, double* %119
%129 = tail call double @llvm.fmuladd.f64(double %126, double %128, double %121)
%130 = getelementptr inbounds double, double* %100, i64 3
%131 = load double, double* %130
%132 = getelementptr inbounds double, double* %103, i64 3
%133 = load double, double* %132
%134 = fmul double %131, %133
%135 = load double, double* %127
%136 = tail call double @llvm.fmuladd.f64(double %134, double %135, double %129)
%137 = tail call double @log(double %136)
%138 = getelementptr inbounds i32, i32* %0, i64 %89
%139 = load i32, i32* %138
%140 = sitofp i32 %139 to double
%141 = tail call double @llvm.fmuladd.f64(double %140, double 0xC0662E42FEFA39EF, double %137)
%142 = getelementptr inbounds double, double* %4, i64 %89
store double %141, double* %142
%143 = add nsw i64 %89, 1
%144 = icmp eq i64 %143, %39
br i1 %144, label %145, label %88
145: ; preds = %88, %35
tail call void @free(i8* %28)
ret void
}