double logGAK(double *seq1, double *seq2, int nX, int nY, int dimvect,
              double sigma, int triangular) {
  int i, j, ii, cur, old, curpos, frompos1, frompos2, frompos3;
  double aux;
  int cl = nY + 1;
  double sum = 0;
  double gram, Sig;
  double *logM = malloc(2 * cl * sizeof(double));
  int trimax = (nX > nY) ? nX - 1 : nY - 1;
  double *logTriangularCoefficients = malloc((trimax + 1) * sizeof(double));
  if (triangular > 0) {
    for (i = 0; i <= trimax; i++) {
      logTriangularCoefficients[i] = -10000;
    }
    for (i = 0; i < ((trimax < triangular) ? trimax + 1 : triangular); i++) {
      logTriangularCoefficients[i] = log(1 - i / triangular);
    }
  } else
    for (i = 0; i <= trimax; i++) {
      logTriangularCoefficients[i] = 0;
    }
  Sig = -1 / (2 * sigma * sigma);
  for (j = 1; j < cl; j++) {
    logM[j] = -10000;
  }
  logM[0] = 0;
  cur = 1;
  old = 0;
  curpos = 0;
  for (i = 1; i <= nX; i++) {
    curpos = cur * cl;
    logM[curpos] = -10000;
    for (j = 1; j <= nY; j++) {
      curpos = cur * cl + j;
      if (logTriangularCoefficients[abs(i - j)] > -10000) {
        frompos1 = old * cl + j;
        frompos2 = cur * cl + j - 1;
        frompos3 = old * cl + j - 1;
        sum = 0;
        for (ii = 0; ii < dimvect; ii++) {
          sum += (seq1[i - 1 + ii * nX] - seq2[j - 1 + ii * nY]) *
                 (seq1[i - 1 + ii * nX] - seq2[j - 1 + ii * nY]);
        }
        gram = logTriangularCoefficients[abs(i - j)] + sum * Sig;
        gram -= log(2 - exp(gram));
        aux = (((logM[frompos1]) > (logM[frompos2]))
                   ? (logM[frompos1]) +
                         log1p(exp((logM[frompos2]) - (logM[frompos1])))
                   : (logM[frompos2]) +
                         log1p(exp((logM[frompos1]) - (logM[frompos2]))));
        logM[curpos] =
            (((aux) > (logM[frompos3]))
                 ? (aux) + log1p(exp((logM[frompos3]) - (aux)))
                 : (logM[frompos3]) + log1p(exp((aux) - (logM[frompos3])))) +
            gram;
      } else {
        logM[curpos] = -10000;
      }
    }
    cur = 1 - cur;
    old = 1 - old;
  }
  aux = logM[curpos];
  free(logM);
  free(logTriangularCoefficients);
  return aux;
}


x86 assembly (clang, -O0):
<logGAK>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
shl    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11ca <logGAK+0x6a>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11d6 <logGAK+0x76>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x90(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    12d0 <logGAK+0x170>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x84(%rbp),%eax
jg     1244 <logGAK+0xe4>
mov    -0x90(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xddf(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    120f <logGAK+0xaf>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1277 <logGAK+0x117>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1280 <logGAK+0x120>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x98(%rbp),%eax
mov    -0x9c(%rbp),%ecx
cmp    %ecx,%eax
jge    12cb <logGAK+0x16b>
mov    -0x30(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1070 <log@plt>
mov    -0x90(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    124b <logGAK+0xeb>
jmp    130c <logGAK+0x1ac>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x84(%rbp),%eax
jg     1307 <logGAK+0x1a7>
mov    -0x90(%rbp),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12d7 <logGAK+0x177>
jmp    130c <logGAK+0x1ac>
movsd  0xcf4(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xcda(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1365 <logGAK+0x205>
mov    -0x80(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xcbe(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1336 <logGAK+0x1d6>
mov    -0x80(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1739 <logGAK+0x5d9>
mov    -0x3c(%rbp),%eax
imul   -0x5c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  0xc5e(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1715 <logGAK+0x5b5>
mov    -0x3c(%rbp),%eax
imul   -0x5c(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x30(%rbp),%edi
sub    -0x34(%rbp),%edi
call   1040 <abs@plt>
mov    %eax,%ecx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc07(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16ed <logGAK+0x58d>
mov    -0x40(%rbp),%eax
imul   -0x5c(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
imul   -0x5c(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%eax
imul   -0x5c(%rbp),%eax
add    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14e7 <logGAK+0x387>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
imul   -0x18(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x38(%rbp),%edx
imul   -0x18(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    144f <logGAK+0x2ef>
mov    -0x90(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x30(%rbp),%edi
sub    -0x34(%rbp),%edi
call   1040 <abs@plt>
mov    %eax,%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xacb(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x4c(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    15cc <logGAK+0x46c>
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x80(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
call   1080 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    161c <logGAK+0x4bc>
mov    -0x80(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x80(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x4c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
call   1080 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x50(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1686 <logGAK+0x526>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x80(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x58(%rbp),%xmm0
call   1060 <exp@plt>
call   1080 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    16ce <logGAK+0x56e>
mov    -0x80(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x50(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
call   1060 <exp@plt>
call   1080 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1702 <logGAK+0x5a2>
mov    -0x80(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  0x913(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1707 <logGAK+0x5a7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13be <logGAK+0x25e>
mov    $0x1,%eax
sub    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    $0x1,%eax
sub    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    138c <logGAK+0x22c>
mov    -0x80(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x58(%rbp),%xmm0
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logGAK>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9d,%r14d
movsd  %xmm0,(%rsp)
mov    %r8d,0xc(%rsp)
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,0x40(%rsp)
mov    %rdi,0x38(%rsp)
lea    0x1(%rbx),%r15d
lea    (%rbx,%rbx,1),%eax
add    $0x2,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,0x60(%rsp)
cmp    %ebx,%ebp
mov    %rbx,0x18(%rsp)
mov    %rbp,0x10(%rsp)
cmovg  %ebp,%ebx
mov    %r14d,%ebp
movslq %ebx,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,%r13
movabs $0xc0c3880000000000,%r12
88 c3 c0
test   %r14d,%r14d
jle    11ed <logGAK+0x8d>
test   %ebx,%ebx
jle    132e <logGAK+0x1ce>
mov    %ebx,%eax
cmp    $0x4,%ebx
jae    120a <logGAK+0xaa>
xor    %ecx,%ecx
jmp    1320 <logGAK+0x1c0>
test   %ebx,%ebx
jle    1369 <logGAK+0x209>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
jmp    1369 <logGAK+0x209>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x1c,%rdi
jae    1230 <logGAK+0xd0>
xor    %edi,%edi
jmp    12d6 <logGAK+0x176>
and    $0xfffffffffffffff8,%rsi
xor    %edi,%edi
movapd 0xdc2(%rip),%xmm0
xchg   %ax,%ax
movupd %xmm0,0x0(%r13,%rdi,8)
movupd %xmm0,0x10(%r13,%rdi,8)
movupd %xmm0,0x20(%r13,%rdi,8)
movupd %xmm0,0x30(%r13,%rdi,8)
movupd %xmm0,0x40(%r13,%rdi,8)
movupd %xmm0,0x50(%r13,%rdi,8)
movupd %xmm0,0x60(%r13,%rdi,8)
movupd %xmm0,0x70(%r13,%rdi,8)
movupd %xmm0,0x80(%r13,%rdi,8)
movupd %xmm0,0x90(%r13,%rdi,8)
movupd %xmm0,0xa0(%r13,%rdi,8)
movupd %xmm0,0xb0(%r13,%rdi,8)
movupd %xmm0,0xc0(%r13,%rdi,8)
movupd %xmm0,0xd0(%r13,%rdi,8)
movupd %xmm0,0xe0(%r13,%rdi,8)
movupd %xmm0,0xf0(%r13,%rdi,8)
add    $0x20,%rdi
add    $0xfffffffffffffff8,%rsi
jne    1240 <logGAK+0xe0>
test   %rdx,%rdx
je     1314 <logGAK+0x1b4>
lea    0x10(,%rdi,8),%rsi
add    %r13,%rsi
shl    $0x5,%rdx
xor    %edi,%edi
movapd 0xd0c(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    1300 <logGAK+0x1a0>
cmp    %rax,%rcx
je     132e <logGAK+0x1ce>
nopl   0x0(%rax)
mov    %r12,0x0(%r13,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1320 <logGAK+0x1c0>
cmp    %ebp,%ebx
cmovg  %ebp,%ebx
test   %ebx,%ebx
jle    1369 <logGAK+0x209>
mov    %ebx,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %r14d,%eax
cltd
idiv   %ebp
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
call   1070 <log@plt>
movsd  %xmm0,0x0(%r13,%r14,8)
add    $0x1,%r14
cmp    %r14,%rbx
jne    1340 <logGAK+0x1e0>
mov    %r15d,%r11d
cmpl   $0x0,0x18(%rsp)
mov    0xc(%rsp),%r9d
mov    0x60(%rsp),%rdi
mov    0x10(%rsp),%r10
jle    146d <logGAK+0x30d>
lea    -0x1(%r11),%rcx
mov    $0x1,%eax
cmp    $0x4,%rcx
jb     1460 <logGAK+0x300>
mov    %rcx,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
mov    %ebp,%ebx
and    $0x3,%ebx
cmp    $0xc,%rsi
jae    13be <logGAK+0x25e>
xor    %esi,%esi
jmp    141a <logGAK+0x2ba>
movabs $0x7ffffffffffffff8,%rsi
ff ff 7f
or     $0x4,%rsi
and    %rsi,%rbp
xor    %esi,%esi
movapd 0xc27(%rip),%xmm0
nopl   0x0(%rax)
movupd %xmm0,0x8(%rdi,%rsi,8)
movupd %xmm0,0x18(%rdi,%rsi,8)
movupd %xmm0,0x28(%rdi,%rsi,8)
movupd %xmm0,0x38(%rdi,%rsi,8)
movupd %xmm0,0x48(%rdi,%rsi,8)
movupd %xmm0,0x58(%rdi,%rsi,8)
movupd %xmm0,0x68(%rdi,%rsi,8)
movupd %xmm0,0x78(%rdi,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rbp
jne    13e0 <logGAK+0x280>
test   %rbx,%rbx
je     1451 <logGAK+0x2f1>
movapd 0xbd9(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
lea    0x0(,%rsi,8),%rbp
or     $0x8,%rbp
movupd %xmm0,(%rdi,%rbp,1)
movupd %xmm0,0x10(%rdi,%rbp,1)
add    $0x4,%rsi
add    $0xffffffffffffffff,%rbx
jne    1430 <logGAK+0x2d0>
cmp    %rax,%rcx
je     146d <logGAK+0x30d>
or     $0x1,%rax
nopw   0x0(%rax,%rax,1)
mov    %r12,(%rdi,%rax,8)
add    $0x1,%rax
cmp    %rax,%r11
jne    1460 <logGAK+0x300>
movq   $0x0,(%rdi)
test   %r10d,%r10d
jle    17f2 <logGAK+0x692>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xb7a(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x98(%rsp)
mov    %r10d,%ebx
movslq 0x18(%rsp),%r12
add    $0x1,%r10d
mov    %r9d,%eax
mov    %rax,0x88(%rsp)
and    $0xfffffffe,%eax
mov    %rax,0x78(%rsp)
mov    %rbx,0x58(%rsp)
shl    $0x4,%rbx
mov    %rbx,0x70(%rsp)
mov    %r12,0x50(%rsp)
shl    $0x4,%r12
mov    %r12,0x68(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    $0x1,%ebp
mov    $0x1,%esi
movsd  0xb21(%rip),%xmm2
mov    0x38(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    %r13,0xa8(%rsp)
mov    %r11,0xa0(%rsp)
mov    %r10,0x10(%rsp)
mov    %r15d,0x30(%rsp)
jmp    155a <logGAK+0x3fa>
nopl   (%rax)
mov    0x10(%rsp),%r10
mov    0x30(%rsp),%r15d
mov    0x34(%rsp),%ebp
mov    $0x1,%eax
sub    %ebp,%eax
mov    $0x1,%ecx
sub    0x20(%rsp),%ecx
add    $0x1,%rsi
addq   $0x8,0x48(%rsp)
mov    %eax,%ebp
mov    %ecx,%eax
mov    %rax,0x20(%rsp)
cmp    %r10,%rsi
je     17e8 <logGAK+0x688>
mov    %ebp,%edx
imul   %r15d,%edx
movslq %edx,%rbx
movabs $0xc0c3880000000000,%rax
88 c3 c0
mov    %rax,(%rdi,%rbx,8)
cmpl   $0x0,0x18(%rsp)
jle    152e <logGAK+0x3ce>
mov    %ebp,0x34(%rsp)
mov    0x20(%rsp),%rax
imul   %r15d,%eax
lea    -0x1(%rsi),%rcx
mov    %rcx,0x80(%rsp)
cltq
mov    %rax,0xb0(%rsp)
mov    $0x1,%r12d
mov    0x40(%rsp),%r15
mov    %rsi,0xb8(%rsp)
mov    %rbx,0x90(%rsp)
jmp    16e7 <logGAK+0x587>
nopl   0x0(%rax,%rax,1)
mulsd  0x98(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1060 <exp@plt>
movsd  0xa41(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1070 <log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    0x60(%rsp),%r13
movsd  0x0(%r13,%r14,8),%xmm4
mov    %r14,%rbp
mov    0xc0(%rsp),%r14
movsd  -0x8(%r13,%r14,8),%xmm1
movapd %xmm4,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm4,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm0
orpd   %xmm3,%xmm0
maxsd  %xmm1,%xmm4
movsd  %xmm4,0x28(%rsp)
call   1060 <exp@plt>
call   1080 <log1p@plt>
movapd %xmm0,%xmm4
addsd  0x28(%rsp),%xmm4
movsd  -0x8(%r13,%rbp,8),%xmm1
movapd %xmm4,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm4,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm0
orpd   %xmm3,%xmm0
maxsd  %xmm1,%xmm4
movsd  %xmm4,0x28(%rsp)
call   1060 <exp@plt>
call   1080 <log1p@plt>
mov    %r14,%rdx
mov    %r13,%rdi
addsd  0x28(%rsp),%xmm0
addsd  (%rsp),%xmm0
mov    0xc(%rsp),%r9d
mov    0xa8(%rsp),%r13
mov    0xa0(%rsp),%r11
mov    0xb8(%rsp),%rsi
movsd  0x947(%rip),%xmm2
movsd  %xmm0,(%rdi,%rdx,8)
add    $0x1,%r12
add    $0x8,%r15
cmp    %r11,%r12
je     1520 <logGAK+0x3c0>
mov    %esi,%eax
sub    %r12d,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
lea    (%r12,%rbx,1),%rdx
movsd  0x0(%r13,%rcx,8),%xmm1
ucomisd %xmm2,%xmm1
movapd %xmm2,%xmm0
jbe    16d1 <logGAK+0x571>
mov    0xb0(%rsp),%rax
lea    (%r12,%rax,1),%r14
test   %r9d,%r9d
mov    %rdx,0xc0(%rsp)
xorpd  %xmm0,%xmm0
jle    15c0 <logGAK+0x460>
cmp    $0x1,%r9d
jne    1733 <logGAK+0x5d3>
xor    %eax,%eax
jmp    1792 <logGAK+0x632>
mov    %r15,%rcx
mov    0x48(%rsp),%rdx
xor    %eax,%eax
mov    0x58(%rsp),%r8
mov    0x78(%rsp),%rdi
mov    0x50(%rsp),%rbx
mov    0x70(%rsp),%rbp
mov    0x68(%rsp),%rsi
cs nopw 0x0(%rax,%rax,1)
movsd  (%rdx),%xmm2
subsd  (%rcx),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  (%rdx,%r8,8),%xmm0
subsd  (%rcx,%rbx,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rax
add    %rbp,%rdx
add    %rsi,%rcx
cmp    %rax,%rdi
jne    1760 <logGAK+0x600>
testb  $0x1,0x88(%rsp)
01
mov    0x90(%rsp),%rbx
je     15c0 <logGAK+0x460>
lea    -0x1(%r12),%rcx
mov    %rax,%rdx
imul   0x58(%rsp),%rdx
add    0x80(%rsp),%rdx
mov    0x38(%rsp),%rsi
movsd  (%rsi,%rdx,8),%xmm2
imul   0x50(%rsp),%rax
add    %rcx,%rax
mov    0x40(%rsp),%rcx
subsd  (%rcx,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
jmp    15c0 <logGAK+0x460>
movslq %edx,%rax
movsd  (%rdi,%rax,8),%xmm0
jmp    17f6 <logGAK+0x696>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @logGAK(double* %0, double* %1, i32 %2, i32 %3, i32 %4, double %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca i32
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double*
%30 = alloca i32
%31 = alloca double*
store double* %0, double** %8
store double* %1, double** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
store i32 %6, i32* %14
%32 = load i32, i32* %11
%33 = add nsw i32 %32, 1
store i32 %33, i32* %25
store double 0.000000e+00, double* %26
%34 = load i32, i32* %25
%35 = mul nsw i32 2, %34
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 8
%38 = call i8* @malloc(i64 %37)
%39 = bitcast i8* %38 to double*
store double* %39, double** %29
%40 = load i32, i32* %10
%41 = load i32, i32* %11
%42 = icmp sgt i32 %40, %41
br i1 %42, label %43, label %46
43: ; preds = %7
%44 = load i32, i32* %10
%45 = sub nsw i32 %44, 1
br label %49
46: ; preds = %7
%47 = load i32, i32* %11
%48 = sub nsw i32 %47, 1
br label %49
49: ; preds = %46, %43
%50 = phi i32 [ %45, %43 ], [ %48, %46 ]
store i32 %50, i32* %30
%51 = load i32, i32* %30
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 8
%55 = call i8* @malloc(i64 %54)
%56 = bitcast i8* %55 to double*
store double* %56, double** %31
%57 = load i32, i32* %14
%58 = icmp sgt i32 %57, 0
br i1 %58, label %59, label %101
59: ; preds = %49
store i32 0, i32* %15
br label %60
60: ; preds = %69, %59
%61 = load i32, i32* %15
%62 = load i32, i32* %30
%63 = icmp sle i32 %61, %62
br i1 %63, label %64, label %72
64: ; preds = %60
%65 = load double*, double** %31
%66 = load i32, i32* %15
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
store double -1.000000e+04, double* %68
br label %69
69: ; preds = %64
%70 = load i32, i32* %15
%71 = add nsw i32 %70, 1
store i32 %71, i32* %15
br label %60
72: ; preds = %60
store i32 0, i32* %15
br label %73
73: ; preds = %97, %72
%74 = load i32, i32* %15
%75 = load i32, i32* %30
%76 = load i32, i32* %14
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %81
78: ; preds = %73
%79 = load i32, i32* %30
%80 = add nsw i32 %79, 1
br label %83
81: ; preds = %73
%82 = load i32, i32* %14
br label %83
83: ; preds = %81, %78
%84 = phi i32 [ %80, %78 ], [ %82, %81 ]
%85 = icmp slt i32 %74, %84
br i1 %85, label %86, label %100
86: ; preds = %83
%87 = load i32, i32* %15
%88 = load i32, i32* %14
%89 = sdiv i32 %87, %88
%90 = sub nsw i32 1, %89
%91 = sitofp i32 %90 to double
%92 = call double @log(double %91)
%93 = load double*, double** %31
%94 = load i32, i32* %15
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
store double %92, double* %96
br label %97
97: ; preds = %86
%98 = load i32, i32* %15
%99 = add nsw i32 %98, 1
store i32 %99, i32* %15
br label %73
100: ; preds = %83
br label %115
101: ; preds = %49
store i32 0, i32* %15
br label %102
102: ; preds = %111, %101
%103 = load i32, i32* %15
%104 = load i32, i32* %30
%105 = icmp sle i32 %103, %104
br i1 %105, label %106, label %114
106: ; preds = %102
%107 = load double*, double** %31
%108 = load i32, i32* %15
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
store double 0.000000e+00, double* %110
br label %111
111: ; preds = %106
%112 = load i32, i32* %15
%113 = add nsw i32 %112, 1
store i32 %113, i32* %15
br label %102
114: ; preds = %102
br label %115
115: ; preds = %114, %100
%116 = load double, double* %13
%117 = fmul double 2.000000e+00, %116
%118 = load double, double* %13
%119 = fmul double %117, %118
%120 = fdiv double -1.000000e+00, %119
store double %120, double* %28
store i32 1, i32* %16
br label %121
121: ; preds = %130, %115
%122 = load i32, i32* %16
%123 = load i32, i32* %25
%124 = icmp slt i32 %122, %123
br i1 %124, label %125, label %133
125: ; preds = %121
%126 = load double*, double** %29
%127 = load i32, i32* %16
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %126, i64 %128
store double -1.000000e+04, double* %129
br label %130
130: ; preds = %125
%131 = load i32, i32* %16
%132 = add nsw i32 %131, 1
store i32 %132, i32* %16
br label %121
133: ; preds = %121
%134 = load double*, double** %29
%135 = getelementptr inbounds double, double* %134, i64 0
store double 0.000000e+00, double* %135
store i32 1, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 1, i32* %15
br label %136
136: ; preds = %365, %133
%137 = load i32, i32* %15
%138 = load i32, i32* %10
%139 = icmp sle i32 %137, %138
br i1 %139, label %140, label %368
140: ; preds = %136
%141 = load i32, i32* %18
%142 = load i32, i32* %25
%143 = mul nsw i32 %141, %142
store i32 %143, i32* %20
%144 = load double*, double** %29
%145 = load i32, i32* %20
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
store double -1.000000e+04, double* %147
store i32 1, i32* %16
br label %148
148: ; preds = %357, %140
%149 = load i32, i32* %16
%150 = load i32, i32* %11
%151 = icmp sle i32 %149, %150
br i1 %151, label %152, label %360
152: ; preds = %148
%153 = load i32, i32* %18
%154 = load i32, i32* %25
%155 = mul nsw i32 %153, %154
%156 = load i32, i32* %16
%157 = add nsw i32 %155, %156
store i32 %157, i32* %20
%158 = load double*, double** %31
%159 = load i32, i32* %15
%160 = load i32, i32* %16
%161 = sub nsw i32 %159, %160
%162 = call i32 @abs(i32 %161)
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %158, i64 %163
%165 = load double, double* %164
%166 = fcmp ogt double %165, -1.000000e+04
br i1 %166, label %167, label %351
167: ; preds = %152
%168 = load i32, i32* %19
%169 = load i32, i32* %25
%170 = mul nsw i32 %168, %169
%171 = load i32, i32* %16
%172 = add nsw i32 %170, %171
store i32 %172, i32* %21
%173 = load i32, i32* %18
%174 = load i32, i32* %25
%175 = mul nsw i32 %173, %174
%176 = load i32, i32* %16
%177 = add nsw i32 %175, %176
%178 = sub nsw i32 %177, 1
store i32 %178, i32* %22
%179 = load i32, i32* %19
%180 = load i32, i32* %25
%181 = mul nsw i32 %179, %180
%182 = load i32, i32* %16
%183 = add nsw i32 %181, %182
%184 = sub nsw i32 %183, 1
store i32 %184, i32* %23
store double 0.000000e+00, double* %26
store i32 0, i32* %17
br label %185
185: ; preds = %234, %167
%186 = load i32, i32* %17
%187 = load i32, i32* %12
%188 = icmp slt i32 %186, %187
br i1 %188, label %189, label %237
189: ; preds = %185
%190 = load double*, double** %8
%191 = load i32, i32* %15
%192 = sub nsw i32 %191, 1
%193 = load i32, i32* %17
%194 = load i32, i32* %10
%195 = mul nsw i32 %193, %194
%196 = add nsw i32 %192, %195
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %190, i64 %197
%199 = load double, double* %198
%200 = load double*, double** %9
%201 = load i32, i32* %16
%202 = sub nsw i32 %201, 1
%203 = load i32, i32* %17
%204 = load i32, i32* %11
%205 = mul nsw i32 %203, %204
%206 = add nsw i32 %202, %205
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %200, i64 %207
%209 = load double, double* %208
%210 = fsub double %199, %209
%211 = load double*, double** %8
%212 = load i32, i32* %15
%213 = sub nsw i32 %212, 1
%214 = load i32, i32* %17
%215 = load i32, i32* %10
%216 = mul nsw i32 %214, %215
%217 = add nsw i32 %213, %216
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds double, double* %211, i64 %218
%220 = load double, double* %219
%221 = load double*, double** %9
%222 = load i32, i32* %16
%223 = sub nsw i32 %222, 1
%224 = load i32, i32* %17
%225 = load i32, i32* %11
%226 = mul nsw i32 %224, %225
%227 = add nsw i32 %223, %226
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %221, i64 %228
%230 = load double, double* %229
%231 = fsub double %220, %230
%232 = load double, double* %26
%233 = call double @llvm.fmuladd.f64(double %210, double %231, double %232)
store double %233, double* %26
br label %234
234: ; preds = %189
%235 = load i32, i32* %17
%236 = add nsw i32 %235, 1
store i32 %236, i32* %17
br label %185
237: ; preds = %185
%238 = load double*, double** %31
%239 = load i32, i32* %15
%240 = load i32, i32* %16
%241 = sub nsw i32 %239, %240
%242 = call i32 @abs(i32 %241)
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %238, i64 %243
%245 = load double, double* %244
%246 = load double, double* %26
%247 = load double, double* %28
%248 = call double @llvm.fmuladd.f64(double %246, double %247, double %245)
store double %248, double* %27
%249 = load double, double* %27
%250 = call double @exp(double %249)
%251 = fsub double 2.000000e+00, %250
%252 = call double @log(double %251)
%253 = load double, double* %27
%254 = fsub double %253, %252
store double %254, double* %27
%255 = load double*, double** %29
%256 = load i32, i32* %21
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %255, i64 %257
%259 = load double, double* %258
%260 = load double*, double** %29
%261 = load i32, i32* %22
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds double, double* %260, i64 %262
%264 = load double, double* %263
%265 = fcmp ogt double %259, %264
br i1 %265, label %266, label %286
266: ; preds = %237
%267 = load double*, double** %29
%268 = load i32, i32* %21
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds double, double* %267, i64 %269
%271 = load double, double* %270
%272 = load double*, double** %29
%273 = load i32, i32* %22
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds double, double* %272, i64 %274
%276 = load double, double* %275
%277 = load double*, double** %29
%278 = load i32, i32* %21
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %277, i64 %279
%281 = load double, double* %280
%282 = fsub double %276, %281
%283 = call double @exp(double %282)
%284 = call double @log1p(double %283)
%285 = fadd double %271, %284
br label %306
286: ; preds = %237
%287 = load double*, double** %29
%288 = load i32, i32* %22
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %287, i64 %289
%291 = load double, double* %290
%292 = load double*, double** %29
%293 = load i32, i32* %21
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %292, i64 %294
%296 = load double, double* %295
%297 = load double*, double** %29
%298 = load i32, i32* %22
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds double, double* %297, i64 %299
%301 = load double, double* %300
%302 = fsub double %296, %301
%303 = call double @exp(double %302)
%304 = call double @log1p(double %303)
%305 = fadd double %291, %304
br label %306
306: ; preds = %286, %266
%307 = phi double [ %285, %266 ], [ %305, %286 ]
store double %307, double* %24
%308 = load double, double* %24
%309 = load double*, double** %29
%310 = load i32, i32* %23
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds double, double* %309, i64 %311
%313 = load double, double* %312
%314 = fcmp ogt double %308, %313
br i1 %314, label %315, label %327
315: ; preds = %306
%316 = load double, double* %24
%317 = load double*, double** %29
%318 = load i32, i32* %23
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds double, double* %317, i64 %319
%321 = load double, double* %320
%322 = load double, double* %24
%323 = fsub double %321, %322
%324 = call double @exp(double %323)
%325 = call double @log1p(double %324)
%326 = fadd double %316, %325
br label %343
327: ; preds = %306
%328 = load double*, double** %29
%329 = load i32, i32* %23
%330 = sext i32 %329 to i64
%331 = getelementptr inbounds double, double* %328, i64 %330
%332 = load double, double* %331
%333 = load double, double* %24
%334 = load double*, double** %29
%335 = load i32, i32* %23
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds double, double* %334, i64 %336
%338 = load double, double* %337
%339 = fsub double %333, %338
%340 = call double @exp(double %339)
%341 = call double @log1p(double %340)
%342 = fadd double %332, %341
br label %343
343: ; preds = %327, %315
%344 = phi double [ %326, %315 ], [ %342, %327 ]
%345 = load double, double* %27
%346 = fadd double %344, %345
%347 = load double*, double** %29
%348 = load i32, i32* %20
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds double, double* %347, i64 %349
store double %346, double* %350
br label %356
351: ; preds = %152
%352 = load double*, double** %29
%353 = load i32, i32* %20
%354 = sext i32 %353 to i64
%355 = getelementptr inbounds double, double* %352, i64 %354
store double -1.000000e+04, double* %355
br label %356
356: ; preds = %351, %343
br label %357
357: ; preds = %356
%358 = load i32, i32* %16
%359 = add nsw i32 %358, 1
store i32 %359, i32* %16
br label %148
360: ; preds = %148
%361 = load i32, i32* %18
%362 = sub nsw i32 1, %361
store i32 %362, i32* %18
%363 = load i32, i32* %19
%364 = sub nsw i32 1, %363
store i32 %364, i32* %19
br label %365
365: ; preds = %360
%366 = load i32, i32* %15
%367 = add nsw i32 %366, 1
store i32 %367, i32* %15
br label %136
368: ; preds = %136
%369 = load double*, double** %29
%370 = load i32, i32* %20
%371 = sext i32 %370 to i64
%372 = getelementptr inbounds double, double* %369, i64 %371
%373 = load double, double* %372
store double %373, double* %24
%374 = load double*, double** %29
%375 = bitcast double* %374 to i8*
%376 = load double*, double** %31
%377 = bitcast double* %376 to i8*
%378 = load double, double* %24
ret double %378
}

LLVM IR (-O2):
define double @logGAK(double* nocapture %0, double* nocapture %1, i32 %2, i32 %3, i32 %4, double %5, i32 %6) {
%8 = add i32 %3, 1
%9 = shl nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = shl nsw i64 %10, 3
%12 = tail call i8* @malloc(i64 %11)
%13 = bitcast i8* %12 to double*
%14 = icmp sgt i32 %2, %3
%15 = select i1 %14, i32 %2, i32 %3
%16 = sext i32 %15 to i64
%17 = shl nsw i64 %16, 3
%18 = tail call i8* @malloc(i64 %17)
%19 = bitcast i8* %18 to double*
%20 = icmp sgt i32 %6, 0
%21 = icmp sgt i32 %15, 0
br i1 %20, label %26, label %22
22: ; preds = %7
br i1 %21, label %23, label %122
23: ; preds = %22
%24 = zext i32 %15 to i64
%25 = shl nuw nsw i64 %24, 3
br label %122
26: ; preds = %7
br i1 %21, label %27, label %101
27: ; preds = %26
%28 = zext i32 %15 to i64
%29 = icmp ult i32 %15, 4
br i1 %29, label %99, label %30
30: ; preds = %27
%31 = and i64 %28, 4294967292
%32 = add nsw i64 %31, -4
%33 = lshr exact i64 %32, 2
%34 = add nuw nsw i64 %33, 1
%35 = and i64 %34, 7
%36 = icmp ult i64 %32, 28
br i1 %36, label %84, label %37
37: ; preds = %30
%38 = and i64 %34, 9223372036854775800
br label %39
39: ; preds = %39, %37
%40 = phi i64 [ 0, %37 ], [ %81, %39 ]
%41 = phi i64 [ 0, %37 ], [ %82, %39 ]
%42 = getelementptr inbounds double, double* %19, i64 %40
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %43
%44 = getelementptr inbounds double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %45
%46 = or i64 %40, 4
%47 = getelementptr inbounds double, double* %19, i64 %46
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %48
%49 = getelementptr inbounds double, double* %47, i64 2
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %50
%51 = or i64 %40, 8
%52 = getelementptr inbounds double, double* %19, i64 %51
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %53
%54 = getelementptr inbounds double, double* %52, i64 2
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %55
%56 = or i64 %40, 12
%57 = getelementptr inbounds double, double* %19, i64 %56
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %58
%59 = getelementptr inbounds double, double* %57, i64 2
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %60
%61 = or i64 %40, 16
%62 = getelementptr inbounds double, double* %19, i64 %61
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %63
%64 = getelementptr inbounds double, double* %62, i64 2
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %65
%66 = or i64 %40, 20
%67 = getelementptr inbounds double, double* %19, i64 %66
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %70
%71 = or i64 %40, 24
%72 = getelementptr inbounds double, double* %19, i64 %71
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %73
%74 = getelementptr inbounds double, double* %72, i64 2
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %75
%76 = or i64 %40, 28
%77 = getelementptr inbounds double, double* %19, i64 %76
%78 = bitcast double* %77 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %78
%79 = getelementptr inbounds double, double* %77, i64 2
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %80
%81 = add nuw i64 %40, 32
%82 = add i64 %41, 8
%83 = icmp eq i64 %82, %38
br i1 %83, label %84, label %39
84: ; preds = %39, %30
%85 = phi i64 [ 0, %30 ], [ %81, %39 ]
%86 = icmp eq i64 %35, 0
br i1 %86, label %97, label %87
87: ; preds = %84, %87
%88 = phi i64 [ %94, %87 ], [ %85, %84 ]
%89 = phi i64 [ %95, %87 ], [ 0, %84 ]
%90 = getelementptr inbounds double, double* %19, i64 %88
%91 = bitcast double* %90 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %91
%92 = getelementptr inbounds double, double* %90, i64 2
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %93
%94 = add nuw i64 %88, 4
%95 = add i64 %89, 1
%96 = icmp eq i64 %95, %35
br i1 %96, label %97, label %87
97: ; preds = %87, %84
%98 = icmp eq i64 %31, %28
br i1 %98, label %101, label %99
99: ; preds = %27, %97
%100 = phi i64 [ 0, %27 ], [ %31, %97 ]
br label %107
101: ; preds = %107, %97, %26
%102 = icmp sgt i32 %15, %6
%103 = select i1 %102, i32 %6, i32 %15
%104 = icmp sgt i32 %103, 0
br i1 %104, label %105, label %122
105: ; preds = %101
%106 = zext i32 %103 to i64
br label %112
107: ; preds = %99, %107
%108 = phi i64 [ %110, %107 ], [ %100, %99 ]
%109 = getelementptr inbounds double, double* %19, i64 %108
store double -1.000000e+04, double* %109
%110 = add nuw nsw i64 %108, 1
%111 = icmp eq i64 %110, %28
br i1 %111, label %101, label %107
112: ; preds = %105, %112
%113 = phi i64 [ 0, %105 ], [ %120, %112 ]
%114 = trunc i64 %113 to i32
%115 = sdiv i32 %114, %6
%116 = sub nsw i32 1, %115
%117 = sitofp i32 %116 to double
%118 = tail call double @log(double %117)
%119 = getelementptr inbounds double, double* %19, i64 %113
store double %118, double* %119
%120 = add nuw nsw i64 %113, 1
%121 = icmp eq i64 %120, %106
br i1 %121, label %122, label %112
122: ; preds = %112, %23, %22, %101
%123 = fmul double %5, 2.000000e+00
%124 = fmul double %123, %5
%125 = fdiv double -1.000000e+00, %124
%126 = icmp slt i32 %3, 1
br i1 %126, label %190, label %127
127: ; preds = %122
%128 = zext i32 %8 to i64
%129 = add nsw i64 %128, -1
%130 = icmp ult i64 %129, 4
br i1 %130, label %183, label %131
131: ; preds = %127
%132 = and i64 %129, -4
%133 = or i64 %132, 1
%134 = add nsw i64 %132, -4
%135 = lshr exact i64 %134, 2
%136 = add nuw nsw i64 %135, 1
%137 = and i64 %136, 3
%138 = icmp ult i64 %134, 12
br i1 %138, label %167, label %139
139: ; preds = %131
%140 = and i64 %136, 9223372036854775804
br label %141
141: ; preds = %141, %139
%142 = phi i64 [ 0, %139 ], [ %164, %141 ]
%143 = phi i64 [ 0, %139 ], [ %165, %141 ]
%144 = or i64 %142, 1
%145 = getelementptr inbounds double, double* %13, i64 %144
%146 = bitcast double* %145 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %146
%147 = getelementptr inbounds double, double* %145, i64 2
%148 = bitcast double* %147 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %148
%149 = or i64 %142, 5
%150 = getelementptr inbounds double, double* %13, i64 %149
%151 = bitcast double* %150 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %151
%152 = getelementptr inbounds double, double* %150, i64 2
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %153
%154 = or i64 %142, 9
%155 = getelementptr inbounds double, double* %13, i64 %154
%156 = bitcast double* %155 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %156
%157 = getelementptr inbounds double, double* %155, i64 2
%158 = bitcast double* %157 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %158
%159 = or i64 %142, 13
%160 = getelementptr inbounds double, double* %13, i64 %159
%161 = bitcast double* %160 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %161
%162 = getelementptr inbounds double, double* %160, i64 2
%163 = bitcast double* %162 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %163
%164 = add nuw i64 %142, 16
%165 = add nuw i64 %143, 4
%166 = icmp eq i64 %165, %140
br i1 %166, label %167, label %141
167: ; preds = %141, %131
%168 = phi i64 [ 0, %131 ], [ %164, %141 ]
%169 = icmp eq i64 %137, 0
br i1 %169, label %181, label %170
170: ; preds = %167, %170
%171 = phi i64 [ %178, %170 ], [ %168, %167 ]
%172 = phi i64 [ %179, %170 ], [ 0, %167 ]
%173 = or i64 %171, 1
%174 = getelementptr inbounds double, double* %13, i64 %173
%175 = bitcast double* %174 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %175
%176 = getelementptr inbounds double, double* %174, i64 2
%177 = bitcast double* %176 to <2 x double>*
store <2 x double> <double -1.000000e+04, double -1.000000e+04>, <2 x double>* %177
%178 = add nuw i64 %171, 4
%179 = add i64 %172, 1
%180 = icmp eq i64 %179, %137
br i1 %180, label %181, label %170
181: ; preds = %170, %167
%182 = icmp eq i64 %129, %132
br i1 %182, label %190, label %183
183: ; preds = %127, %181
%184 = phi i64 [ 1, %127 ], [ %133, %181 ]
br label %185
185: ; preds = %183, %185
%186 = phi i64 [ %188, %185 ], [ %184, %183 ]
%187 = getelementptr inbounds double, double* %13, i64 %186
store double -1.000000e+04, double* %187
%188 = add nuw nsw i64 %186, 1
%189 = icmp eq i64 %188, %128
br i1 %189, label %190, label %185
190: ; preds = %185, %181, %122
store double 0.000000e+00, double* %13
%191 = icmp slt i32 %2, 1
br i1 %191, label %321, label %192
192: ; preds = %190
%193 = icmp sgt i32 %4, 0
%194 = zext i32 %2 to i64
%195 = sext i32 %3 to i64
%196 = add nuw i32 %2, 1
%197 = zext i32 %196 to i64
%198 = zext i32 %8 to i64
%199 = zext i32 %4 to i64
%200 = and i64 %199, 1
%201 = icmp eq i32 %4, 1
%202 = and i64 %199, 4294967294
%203 = icmp eq i64 %200, 0
br label %204
204: ; preds = %192, %311
%205 = phi i64 [ 1, %192 ], [ %315, %311 ]
%206 = phi i32 [ 1, %192 ], [ %313, %311 ]
%207 = phi i32 [ 0, %192 ], [ %314, %311 ]
%208 = mul nsw i32 %206, %8
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %13, i64 %209
store double -1.000000e+04, double* %210
br i1 %126, label %311, label %211
211: ; preds = %204
%212 = mul nsw i32 %207, %8
%213 = add nsw i64 %205, -1
%214 = sext i32 %212 to i64
br label %215
215: ; preds = %211, %304
%216 = phi i64 [ 1, %211 ], [ %307, %304 ]
%217 = add nsw i64 %216, %209
%218 = sub nsw i64 %205, %216
%219 = trunc i64 %218 to i32
%220 = tail call i32 @llvm.abs.i32(i32 %219, i1 true)
%221 = zext i32 %220 to i64
%222 = getelementptr inbounds double, double* %19, i64 %221
%223 = load double, double* %222
%224 = fcmp ogt double %223, -1.000000e+04
br i1 %224, label %225, label %304
225: ; preds = %215
%226 = add nsw i64 %216, %214
%227 = add nsw i64 %217, -1
%228 = add nsw i64 %226, -1
br i1 %193, label %229, label %274
229: ; preds = %225
%230 = add nsw i64 %216, -1
br i1 %201, label %259, label %231
231: ; preds = %229, %231
%232 = phi i64 [ %256, %231 ], [ 0, %229 ]
%233 = phi double [ %255, %231 ], [ 0.000000e+00, %229 ]
%234 = phi i64 [ %257, %231 ], [ 0, %229 ]
%235 = mul nsw i64 %232, %194
%236 = add nsw i64 %213, %235
%237 = getelementptr inbounds double, double* %0, i64 %236
%238 = load double, double* %237
%239 = mul nsw i64 %232, %195
%240 = add nsw i64 %230, %239
%241 = getelementptr inbounds double, double* %1, i64 %240
%242 = load double, double* %241
%243 = fsub double %238, %242
%244 = tail call double @llvm.fmuladd.f64(double %243, double %243, double %233)
%245 = or i64 %232, 1
%246 = mul nsw i64 %245, %194
%247 = add nsw i64 %213, %246
%248 = getelementptr inbounds double, double* %0, i64 %247
%249 = load double, double* %248
%250 = mul nsw i64 %245, %195
%251 = add nsw i64 %230, %250
%252 = getelementptr inbounds double, double* %1, i64 %251
%253 = load double, double* %252
%254 = fsub double %249, %253
%255 = tail call double @llvm.fmuladd.f64(double %254, double %254, double %244)
%256 = add nuw nsw i64 %232, 2
%257 = add i64 %234, 2
%258 = icmp eq i64 %257, %202
br i1 %258, label %259, label %231
259: ; preds = %231, %229
%260 = phi double [ undef, %229 ], [ %255, %231 ]
%261 = phi i64 [ 0, %229 ], [ %256, %231 ]
%262 = phi double [ 0.000000e+00, %229 ], [ %255, %231 ]
br i1 %203, label %274, label %263
263: ; preds = %259
%264 = mul nsw i64 %261, %194
%265 = add nsw i64 %213, %264
%266 = getelementptr inbounds double, double* %0, i64 %265
%267 = load double, double* %266
%268 = mul nsw i64 %261, %195
%269 = add nsw i64 %230, %268
%270 = getelementptr inbounds double, double* %1, i64 %269
%271 = load double, double* %270
%272 = fsub double %267, %271
%273 = tail call double @llvm.fmuladd.f64(double %272, double %272, double %262)
br label %274
274: ; preds = %263, %259, %225
%275 = phi double [ 0.000000e+00, %225 ], [ %260, %259 ], [ %273, %263 ]
%276 = tail call double @llvm.fmuladd.f64(double %275, double %125, double %223)
%277 = tail call double @exp(double %276)
%278 = fsub double 2.000000e+00, %277
%279 = tail call double @log(double %278)
%280 = fsub double %276, %279
%281 = getelementptr inbounds double, double* %13, i64 %226
%282 = load double, double* %281
%283 = getelementptr inbounds double, double* %13, i64 %227
%284 = load double, double* %283
%285 = fcmp ogt double %282, %284
%286 = fsub double %282, %284
%287 = fsub double %284, %282
%288 = select i1 %285, double %287, double %286
%289 = select i1 %285, double %282, double %284
%290 = tail call double @exp(double %288)
%291 = tail call double @log1p(double %290)
%292 = fadd double %289, %291
%293 = getelementptr inbounds double, double* %13, i64 %228
%294 = load double, double* %293
%295 = fcmp ogt double %292, %294
%296 = fsub double %292, %294
%297 = fsub double %294, %292
%298 = select i1 %295, double %297, double %296
%299 = select i1 %295, double %292, double %294
%300 = tail call double @exp(double %298)
%301 = tail call double @log1p(double %300)
%302 = fadd double %299, %301
%303 = fadd double %280, %302
br label %304
304: ; preds = %215, %274
%305 = phi double [ %303, %274 ], [ -1.000000e+04, %215 ]
%306 = getelementptr inbounds double, double* %13, i64 %217
store double %305, double* %306
%307 = add nuw nsw i64 %216, 1
%308 = icmp eq i64 %307, %198
br i1 %308, label %309, label %215
309: ; preds = %304
%310 = trunc i64 %217 to i32
br label %311
311: ; preds = %309, %204
%312 = phi i32 [ %208, %204 ], [ %310, %309 ]
%313 = sub nsw i32 1, %206
%314 = sub nsw i32 1, %207
%315 = add nuw nsw i64 %205, 1
%316 = icmp eq i64 %315, %197
br i1 %316, label %317, label %204
317: ; preds = %311
%318 = sext i32 %312 to i64
%319 = getelementptr inbounds double, double* %13, i64 %318
%320 = load double, double* %319
br label %321
321: ; preds = %190, %317
%322 = phi double [ %320, %317 ], [ 0.000000e+00, %190 ]
tail call void @free(i8* %12)
tail call void @free(i8* %18)
ret double %322
}