int TWM_C(double *pfreq, double *pmag, int nPeaks, double *f0c, int nf0c,
          double *f0, double *f0error) {
  double Amax, min_val, maxMeasuredFreq, minF0Candidate, *ErrorPM, *ErrorMP,
      *pmag_local, **measMTX, **predMTX;
  int max_ind, min_ind, ii, jj, PMorMP, canMTXLen, maxnpeaks;
  maxnpeaks = 10;
  maxValArg(pmag, nPeaks, &Amax, &max_ind);
  minValArg(f0c, nf0c, &minF0Candidate, &min_ind);
  maxValArg(pfreq, nPeaks, &maxMeasuredFreq, &max_ind);
  canMTXLen = (((maxnpeaks) > (ceil(maxMeasuredFreq / minF0Candidate)))
                   ? (maxnpeaks)
                   : (ceil(maxMeasuredFreq / minF0Candidate)));
  predMTX = (double **)malloc(sizeof(double *) * nf0c);
  measMTX = (double **)malloc(sizeof(double *) * nf0c);
  for (ii = 0; ii < nf0c; ii++) {
    predMTX[ii] = (double *)malloc(sizeof(double) * canMTXLen);
    for (jj = 0; jj < canMTXLen; jj++) {
      predMTX[ii][jj] = (jj + 1) * f0c[ii];
    }
    measMTX[ii] = (double *)malloc(sizeof(double) * nPeaks);
    for (jj = 0; jj < nPeaks; jj++) {
      measMTX[ii][jj] = pfreq[jj];
    }
  }
  ErrorPM = (double *)malloc(sizeof(double) * nf0c);
  memset(ErrorPM, 0, sizeof(double) * nf0c);
  ErrorMP = (double *)malloc(sizeof(double) * nf0c);
  memset(ErrorMP, 0, sizeof(double) * nf0c);
  pmag_local = (double *)malloc(sizeof(double) * nPeaks);
  for (ii = 0; ii < nPeaks; ii++) {
    pmag_local[ii] = pow(10, (pmag[ii] - Amax) / 20.0);
  }
  maxnpeaks = (((maxnpeaks) < (nPeaks)) ? (maxnpeaks) : (nPeaks));
  PMorMP = 1;
  computeTWMError(predMTX, canMTXLen, measMTX, nPeaks, maxnpeaks, pmag_local,
                  ErrorPM, nf0c, PMorMP);
  PMorMP = 0;
  computeTWMError(measMTX, nPeaks, predMTX, canMTXLen, maxnpeaks, pmag_local,
                  ErrorMP, nf0c, PMorMP);
  for (ii = 0; ii < nf0c; ii++) {
    ErrorPM[ii] = (ErrorPM[ii] + 0.33 * ErrorMP[ii]) / maxnpeaks;
  }
  minValArg(ErrorPM, nf0c, &min_val, &min_ind);
  *f0error = min_val;
  *f0 = f0c[min_ind];
  free(ErrorPM);
  free(ErrorMP);
  free(pmag_local);
  for (ii = 0; ii < nf0c; ii++) {
    free(predMTX[ii]);
    free(measMTX[ii]);
  }
  free(predMTX);
  free(measMTX);
  return 1;
}


x86 assembly (clang, -O0):
<TWM_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0xa,-0x94(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x38(%rbp),%rdx
lea    -0x7c(%rbp),%rcx
mov    $0x0,%al
call   1080 <maxValArg@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x50(%rbp),%rdx
lea    -0x80(%rbp),%rcx
mov    $0x0,%al
call   1060 <minValArg@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x48(%rbp),%rdx
lea    -0x7c(%rbp),%rcx
mov    $0x0,%al
call   1080 <maxValArg@plt>
cvtsi2sdl -0x94(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
call   1040 <ceil@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    123b <TWM_C+0xbb>
cvtsi2sdl -0x94(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1252 <TWM_C+0xd2>
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
call   1040 <ceil@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
cvttsd2si %xmm0,%eax
mov    %eax,-0x90(%rbp)
movslq -0x24(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x78(%rbp)
movslq -0x24(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13b9 <TWM_C+0x239>
movslq -0x90(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x78(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x90(%rbp),%eax
jge    1329 <TWM_C+0x1a9>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x84(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    12cb <TWM_C+0x14b>
movslq -0x14(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x70(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13a0 <TWM_C+0x220>
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1352 <TWM_C+0x1d2>
jmp    13a5 <TWM_C+0x225>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1290 <TWM_C+0x110>
movslq -0x24(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
movslq -0x24(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1070 <memset@plt>
movslq -0x24(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
movslq -0x24(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1070 <memset@plt>
movslq -0x14(%rbp),%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    147d <TWM_C+0x2fd>
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
subsd  -0x38(%rbp),%xmm1
movsd  0xbc8(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xbb4(%rip),%xmm0
call   10a0 <pow@plt>
mov    -0x68(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    141c <TWM_C+0x29c>
mov    -0x94(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    149d <TWM_C+0x31d>
mov    -0x94(%rbp),%eax
mov    %eax,-0xac(%rbp)
jmp    14a6 <TWM_C+0x326>
mov    -0x14(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0xac(%rbp),%eax
mov    %eax,-0x94(%rbp)
movl   $0x1,-0x8c(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%esi
mov    -0x70(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x94(%rbp),%r8d
mov    -0x68(%rbp),%r9
mov    -0x58(%rbp),%r11
mov    -0x24(%rbp),%r10d
mov    -0x8c(%rbp),%eax
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1050 <computeTWMError@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x78(%rbp),%rdx
mov    -0x90(%rbp),%ecx
mov    -0x94(%rbp),%r8d
mov    -0x68(%rbp),%r9
mov    -0x60(%rbp),%r11
mov    -0x24(%rbp),%r10d
mov    -0x8c(%rbp),%eax
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1050 <computeTWMError@plt>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    15bb <TWM_C+0x43b>
mov    -0x58(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x60(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xa7d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x94(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    154c <TWM_C+0x3cc>
mov    -0x58(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x40(%rbp),%rdx
lea    -0x80(%rbp),%rcx
mov    $0x0,%al
call   1060 <minValArg@plt>
movsd  -0x40(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movslq -0x80(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1663 <TWM_C+0x4e3>
mov    -0x78(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1618 <TWM_C+0x498>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TWM_C>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9,0x60(%rsp)
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %rdi,%r12
lea    0x38(%rsp),%rdx
lea    0xd4(%rsp),%rbp
mov    %rsi,0x40(%rsp)
mov    %rsi,%rdi
mov    %r15d,%esi
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <maxValArg@plt>
lea    0xb8(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,0x50(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <minValArg@plt>
lea    0xc0(%rsp),%rdx
mov    %r12,%rdi
mov    %r15d,%esi
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <maxValArg@plt>
movsd  0xc0(%rsp),%xmm0
divsd  0xb8(%rsp),%xmm0
call   1040 <ceil@plt>
movsd  0xde6(%rip),%xmm1
maxsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r13d
movslq %r14d,%rbx
lea    0x0(,%rbx,8),%rbp
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %rbp,0x48(%rsp)
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %r15d,%ecx
mov    %r15d,0xc(%rsp)
mov    %rax,0x30(%rsp)
movslq %r15d,%rdx
mov    %r14,0x28(%rsp)
mov    %r14d,%r15d
mov    %ecx,%r14d
test   %ebx,%ebx
mov    %r13d,0x10(%rsp)
mov    %r15,0x58(%rsp)
jle    1623 <TWM_C+0x4a3>
movslq %r13d,%rax
lea    0x0(,%rax,8),%rcx
mov    %rcx,0xb0(%rsp)
shl    $0x3,%rdx
mov    %rdx,0x18(%rsp)
mov    %eax,%ebx
mov    %ebx,%eax
and    $0xfffffffc,%eax
mov    %rax,0xa8(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0xa0(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
mov    %r14d,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,0x90(%rsp)
add    $0xfffffffffffffffc,%rcx
mov    %rcx,0x88(%rsp)
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
movabs $0x7ffffffffffffffc,%rsi
ff ff 7f
or     $0x2,%rsi
mov    %rax,%rcx
mov    %rax,0x98(%rsp)
and    %rax,%rsi
mov    %rsi,0x78(%rsp)
mov    %edx,%ebp
and    $0x3,%ebp
and    $0xfffffffffffffffc,%rdx
mov    %rdx,0x68(%rsp)
lea    0x10(%r12),%rax
mov    %rax,0x70(%rsp)
mov    %rbp,0x80(%rsp)
shl    $0x5,%rbp
xor    %r13d,%r13d
jmp    133d <TWM_C+0x1bd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13
cmp    %r15,%r13
je     1612 <TWM_C+0x492>
mov    0xb0(%rsp),%rdi
call   1090 <malloc@plt>
mov    0x20(%rsp),%rcx
mov    %rax,(%rcx,%r13,8)
mov    0x10(%rsp),%edx
test   %edx,%edx
mov    0x18(%rsp),%rdi
jle    14ac <TWM_C+0x32c>
mov    0x50(%rsp),%rcx
movsd  (%rcx,%r13,8),%xmm0
cmp    $0x4,%edx
jae    1380 <TWM_C+0x200>
xor    %ecx,%ecx
jmp    1490 <TWM_C+0x310>
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x0,0xa0(%rsp)
je     15e9 <TWM_C+0x469>
mov    0x78(%rsp),%rdx
xor    %ecx,%ecx
movdqa 0xc7a(%rip),%xmm2
pcmpeqd %xmm6,%xmm6
movdqa 0xc7e(%rip),%xmm7
movdqa 0xc85(%rip),%xmm8
movdqa 0xc8c(%rip),%xmm9
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
pshufd $0xe8,%xmm2,%xmm3
movdqa %xmm3,%xmm4
psubd  %xmm6,%xmm4
paddd  %xmm7,%xmm3
cvtdq2pd %xmm4,%xmm4
cvtdq2pd %xmm3,%xmm3
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm3
movupd %xmm4,(%rax,%rcx,8)
movdqa %xmm2,%xmm4
paddq  %xmm8,%xmm4
pshufd $0xe8,%xmm4,%xmm4
movdqa %xmm4,%xmm5
psubd  %xmm6,%xmm5
paddd  %xmm7,%xmm4
cvtdq2pd %xmm5,%xmm5
cvtdq2pd %xmm4,%xmm4
movupd %xmm3,0x10(%rax,%rcx,8)
mulpd  %xmm1,%xmm5
mulpd  %xmm1,%xmm4
movupd %xmm5,0x20(%rax,%rcx,8)
movupd %xmm4,0x30(%rax,%rcx,8)
add    $0x8,%rcx
paddq  %xmm9,%xmm2
add    $0xfffffffffffffffe,%rdx
jne    13d0 <TWM_C+0x250>
testb  $0x1,0x98(%rsp)
01
je     1477 <TWM_C+0x2f7>
pshufd $0xe8,%xmm2,%xmm2
movdqa %xmm2,%xmm3
psubd  %xmm6,%xmm3
paddd  %xmm7,%xmm2
cvtdq2pd %xmm3,%xmm3
cvtdq2pd %xmm2,%xmm2
mulpd  %xmm1,%xmm3
mulpd  %xmm1,%xmm2
movupd %xmm3,(%rax,%rcx,8)
movupd %xmm2,0x10(%rax,%rcx,8)
mov    0xa8(%rsp),%rdx
mov    %rdx,%rcx
cmp    %rbx,%rdx
je     14ac <TWM_C+0x32c>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rdx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
mov    %rdx,%rcx
cmp    %rdx,%rbx
jne    1490 <TWM_C+0x310>
call   1090 <malloc@plt>
mov    0x30(%rsp),%rcx
mov    %rax,(%rcx,%r13,8)
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1330 <TWM_C+0x1b0>
cmp    $0x4,%ecx
jae    14e0 <TWM_C+0x360>
xor    %ecx,%ecx
jmp    15d0 <TWM_C+0x450>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpq   $0xc,0x88(%rsp)
jae    14ef <TWM_C+0x36f>
xor    %ecx,%ecx
jmp    1564 <TWM_C+0x3e4>
mov    0x68(%rsp),%rdx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
movups (%r12,%rcx,8),%xmm0
movups 0x10(%r12,%rcx,8),%xmm1
movups %xmm0,(%rax,%rcx,8)
movups %xmm1,0x10(%rax,%rcx,8)
movups 0x20(%r12,%rcx,8),%xmm0
movups 0x30(%r12,%rcx,8),%xmm1
movups %xmm0,0x20(%rax,%rcx,8)
movups %xmm1,0x30(%rax,%rcx,8)
movups 0x40(%r12,%rcx,8),%xmm0
movups 0x50(%r12,%rcx,8),%xmm1
movups %xmm0,0x40(%rax,%rcx,8)
movups %xmm1,0x50(%rax,%rcx,8)
movupd 0x60(%r12,%rcx,8),%xmm0
movupd 0x70(%r12,%rcx,8),%xmm1
movupd %xmm0,0x60(%rax,%rcx,8)
movupd %xmm1,0x70(%rax,%rcx,8)
add    $0x10,%rcx
add    $0xfffffffffffffffc,%rdx
jne    1500 <TWM_C+0x380>
cmpq   $0x0,0x80(%rsp)
je     15af <TWM_C+0x42f>
lea    (%rax,%rcx,8),%rdx
add    $0x10,%rdx
mov    0x70(%rsp),%rsi
lea    (%rsi,%rcx,8),%rcx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd -0x10(%rcx,%rsi,1),%xmm0
movupd (%rcx,%rsi,1),%xmm1
movupd %xmm0,-0x10(%rdx,%rsi,1)
movupd %xmm1,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rbp
jne    1590 <TWM_C+0x410>
mov    0x90(%rsp),%rdx
mov    %rdx,%rcx
cmp    %r14,%rdx
je     1330 <TWM_C+0x1b0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r12,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r14
jne    15d0 <TWM_C+0x450>
jmp    1330 <TWM_C+0x1b0>
xor    %ecx,%ecx
movdqa 0xa2d(%rip),%xmm2
pcmpeqd %xmm6,%xmm6
movdqa 0xa31(%rip),%xmm7
testb  $0x1,0x98(%rsp)
01
jne    144b <TWM_C+0x2cb>
jmp    1477 <TWM_C+0x2f7>
mov    0x28(%rsp),%r12
mov    0x48(%rsp),%rbp
mov    0x18(%rsp),%r15
jmp    1634 <TWM_C+0x4b4>
shl    $0x3,%rdx
mov    0x28(%rsp),%r12
mov    0x48(%rsp),%rbp
mov    %rdx,%r15
mov    $0x1,%edi
mov    %rbp,%rsi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    %rbp,%rsi
call   1070 <calloc@plt>
mov    %rax,0x18(%rsp)
mov    %r15,%rdi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1729 <TWM_C+0x5a9>
cmp    $0x1,%eax
jne    167b <TWM_C+0x4fb>
xor    %ebp,%ebp
mov    0x40(%rsp),%r15
jmp    16ee <TWM_C+0x56e>
mov    %r14d,%r12d
and    $0xfffffffe,%r12d
xor    %ebp,%ebp
mov    0x40(%rsp),%r15
nopl   0x0(%rax)
movsd  (%r15,%rbp,8),%xmm1
subsd  0x38(%rsp),%xmm1
movsd  0x964(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0x950(%rip),%xmm0
call   10a0 <pow@plt>
movsd  %xmm0,0x0(%r13,%rbp,8)
movsd  0x8(%r15,%rbp,8),%xmm1
subsd  0x38(%rsp),%xmm1
divsd  0x937(%rip),%xmm1
movsd  0x927(%rip),%xmm0
call   10a0 <pow@plt>
movsd  %xmm0,0x8(%r13,%rbp,8)
add    $0x2,%rbp
cmp    %rbp,%r12
jne    1690 <TWM_C+0x510>
test   $0x1,%r14b
mov    0x28(%rsp),%r12
mov    0xc(%rsp),%eax
je     1729 <TWM_C+0x5a9>
movsd  (%r15,%rbp,8),%xmm1
subsd  0x38(%rsp),%xmm1
divsd  0x8f7(%rip),%xmm1
movsd  0x8e7(%rip),%xmm0
call   10a0 <pow@plt>
mov    0xc(%rsp),%eax
movsd  %xmm0,0x0(%r13,%rbp,8)
cmp    $0xa,%eax
mov    $0xa,%r14d
cmovl  %eax,%r14d
sub    $0x8,%rsp
mov    %eax,%ebp
mov    0x28(%rsp),%rdi
mov    0x18(%rsp),%esi
mov    %r12,%r15
mov    0x38(%rsp),%r12
mov    %r12,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
mov    %r13,%r9
xor    %eax,%eax
push   $0x1
push   %r15
push   %rbx
call   1050 <computeTWMError@plt>
add    $0x18,%rsp
mov    %r12,%rdi
mov    %r15,%r12
mov    %ebp,%esi
mov    0x28(%rsp),%rdx
mov    0x18(%rsp),%ecx
mov    %r14d,%r8d
mov    %r13,%r9
xor    %eax,%eax
push   $0x0
push   %r15
mov    0x30(%rsp),%rbp
push   %rbp
call   1050 <computeTWMError@plt>
add    $0x20,%rsp
test   %r12d,%r12d
mov    0x58(%rsp),%r15
jle    1891 <TWM_C+0x711>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
cmp    $0x1,%r12d
jne    17b7 <TWM_C+0x637>
xor    %eax,%eax
jmp    185e <TWM_C+0x6de>
mov    %r15d,%eax
and    $0xfffffffe,%eax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x2(%rax),%rcx
mov    %rcx,%rdx
shr    %rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     1953 <TWM_C+0x7d3>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
movapd 0x873(%rip),%xmm2
nopl   (%rax)
movupd 0x0(%rbp,%rcx,8),%xmm3
mulpd  %xmm2,%xmm3
movupd (%rbx,%rcx,8),%xmm4
addpd  %xmm3,%xmm4
movupd 0x10(%rbx,%rcx,8),%xmm3
divpd  %xmm1,%xmm4
movupd %xmm4,(%rbx,%rcx,8)
movupd 0x10(%rbp,%rcx,8),%xmm4
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
divpd  %xmm1,%xmm4
movupd %xmm4,0x10(%rbx,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rsi
jne    17f0 <TWM_C+0x670>
test   $0x1,%dl
je     1859 <TWM_C+0x6d9>
movupd 0x0(%rbp,%rcx,8),%xmm2
mulpd  0x819(%rip),%xmm2
movupd (%rbx,%rcx,8),%xmm3
addpd  %xmm3,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rbx,%rcx,8)
cmp    %r15,%rax
je     1891 <TWM_C+0x711>
movsd  0x7aa(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  (%rbx,%rax,8),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r15
jne    1870 <TWM_C+0x6f0>
lea    0xc8(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <minValArg@plt>
movsd  0xc8(%rsp),%xmm0
mov    0x110(%rsp),%rax
movsd  %xmm0,(%rax)
movslq 0x14(%rsp),%rax
mov    0x50(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    0x60(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
test   %r12d,%r12d
mov    0x20(%rsp),%rbp
mov    0x30(%rsp),%r14
jle    192c <TWM_C+0x7ac>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%rbx,8),%rdi
call   1030 <free@plt>
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1910 <TWM_C+0x790>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    1839 <TWM_C+0x6b9>
jmp    1859 <TWM_C+0x6d9>

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

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