void mi2c(double **x, int N, int K, double *psi, double *scal, double *mic) {
  int i, k, *n1;
  double *xc, dx;
  double *eps, Eps;
  int maxdim;
  double dxy1;
  int *nn;
  int d;
  int BOX, BOX1;
  int **box, *lis;
  int **box1;
  int **lis1;
  int **mxi;
  double epsilon;
  int inveps;
  int dim = 2;
  nn = (int *)malloc((K + 1) * sizeof(int));
  xc = (double *)malloc((dim + 1) * sizeof(double));
  BOX = 1;
  while (0.5 * BOX * BOX * K < N)
    BOX *= 2;
  epsilon = 4.0 / BOX;
  inveps = BOX / 4;
  BOX1 = N - 5;
  box1 = (int **)malloc(dim * sizeof(int *));
  lis1 = (int **)malloc(dim * sizeof(int *));
  mxi = (int **)malloc(dim * sizeof(int *));
  for (d = 0; d < dim; d++) {
    box1[d] = (int *)malloc((BOX1 + 1) * sizeof(int));
    lis1[d] = (int *)malloc(N * sizeof(int));
    mxi[d] = (int *)malloc((BOX1 + 1) * sizeof(int));
  }
  box = (int **)malloc(BOX * sizeof(int *));
  for (i = 0; i < BOX; i++)
    box[i] = (int *)malloc(BOX * sizeof(int));
  lis = (int *)malloc(N * sizeof(int));
  eps = (double *)malloc(dim * sizeof(double));
  n1 = (int *)malloc(dim * sizeof(int));
  make_box2(x, dim, N, 0, 1, BOX, inveps, box, lis);
  for (d = 0; d < dim; d++)
    make_box1(x[d], N, scal[d], BOX1, box1[d], lis1[d], mxi[d]);
  dxy1 = 0.0;
  for (i = 0; i < N; i++) {
    for (d = 0; d < dim; d++)
      xc[d] = x[d][i];
    neiK(x, dim, 0, dim - 1, i, BOX, epsilon, K, box, lis, nn);
    Eps = 0;
    maxdim = -1;
    for (d = 0; d < dim; d++) {
      eps[d] = 0;
      for (k = 1; k <= K; k++) {
        if ((dx = fabs(xc[d] - x[d][nn[k]])) > eps[d])
          eps[d] = dx;
      }
      if (eps[d] > Eps) {
        Eps = eps[d];
        maxdim = d;
      }
    }
    for (d = 0; d < dim; d++) {
      n1[d] = neiE1(x[d], i, scal[d], BOX1, Eps, box1[d], lis1[d], mxi[d]);
      if (d == maxdim) {
        dxy1 += psi[n1[d]];
      } else {
        dxy1 += psi[n1[d] + 1];
      }
    }
  }
  dxy1 /= N;
  *mic = psi[N] + psi[K] - dxy1;
  free(xc);
  free(nn);
  for (i = 0; i < BOX; i++)
    free(box[i]);
  free(box);
  free(lis);
  for (d = 0; d < dim; d++) {
    free(box1[d]);
    free(lis1[d]);
    free(mxi[d]);
  }
  free(box1);
  free(lis1);
  free(mxi);
  free(eps);
  free(n1);
}


x86 assembly (clang, -O0):
<mi2c>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x2,-0xc0(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0xc0(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x80(%rbp)
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  0xe31(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x18(%rbp),%xmm0
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1202 <mi2c+0xa2>
mov    -0x80(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    11c2 <mi2c+0x62>
cvtsi2sdl -0x80(%rbp),%xmm1
movsd  0xdf9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x80(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xbc(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x84(%rbp)
movslq -0xc0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movslq -0xc0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0xa8(%rbp)
movslq -0xc0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0xb0(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    130e <mi2c+0x1ae>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0xa0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0xa8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0xb0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1284 <mi2c+0x124>
movslq -0x80(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x80(%rbp),%eax
jge    1362 <mi2c+0x202>
movslq -0x80(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x90(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1329 <mi2c+0x1c9>
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x98(%rbp)
movslq -0xc0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0xc0(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0xc0(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x80(%rbp),%r9d
mov    -0xbc(%rbp),%r11d
mov    -0x90(%rbp),%r10
mov    -0x98(%rbp),%rax
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1080 <make_box2@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    145b <mi2c+0x2fb>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x84(%rbp),%edx
mov    -0xa0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0xa8(%rbp),%rax
movslq -0x7c(%rbp),%r8
mov    (%rax,%r8,8),%r8
mov    -0xb0(%rbp),%rax
movslq -0x7c(%rbp),%r9
mov    (%rax,%r9,8),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    13e8 <mi2c+0x288>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1704 <mi2c+0x5a4>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    14bc <mi2c+0x35c>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    147d <mi2c+0x31d>
mov    -0x10(%rbp),%rdi
mov    -0xc0(%rbp),%esi
mov    -0xc0(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x34(%rbp),%r8d
mov    -0x80(%rbp),%r9d
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%ebx
mov    -0x90(%rbp),%r11
mov    -0x98(%rbp),%r10
mov    -0x78(%rbp),%rax
xor    %edx,%edx
mov    %ebx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x1,%al
call   1050 <neiK@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0xffffffff,-0x64(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    160c <mi2c+0x4ac>
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     15c9 <mi2c+0x469>
mov    -0x48(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x78(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xa88(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    15b6 <mi2c+0x456>
movsd  -0x50(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15bb <mi2c+0x45b>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    154b <mi2c+0x3eb>
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    15f9 <mi2c+0x499>
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    15fe <mi2c+0x49e>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1525 <mi2c+0x3c5>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    16f1 <mi2c+0x591>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%esi
mov    -0x28(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x84(%rbp),%edx
movsd  -0x60(%rbp),%xmm1
mov    -0xa0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0xa8(%rbp),%rax
movslq -0x7c(%rbp),%r8
mov    (%rax,%r8,8),%r8
mov    -0xb0(%rbp),%rax
movslq -0x7c(%rbp),%r9
mov    (%rax,%r9,8),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
mov    %eax,%edx
mov    -0x40(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x7c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jne    16ba <mi2c+0x55a>
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%rcx
movslq -0x7c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    16de <mi2c+0x57e>
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%rcx
movslq -0x7c(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    16e3 <mi2c+0x583>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1613 <mi2c+0x4b3>
jmp    16f6 <mi2c+0x596>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    146a <mi2c+0x30a>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x80(%rbp),%eax
jge    1785 <mi2c+0x625>
mov    -0x90(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1757 <mi2c+0x5f7>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    17fd <mi2c+0x69d>
mov    -0xa0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xb0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    17a4 <mi2c+0x644>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi2c>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %r9,0xc8(%rsp)
mov    %r8,0x58(%rsp)
mov    %rcx,0x98(%rsp)
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,0x8(%rsp)
lea    0x1(%rbp),%eax
mov    %eax,0xa0(%rsp)
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,0x48(%rsp)
cvtsi2sd %ebp,%xmm0
cvtsi2sd %r15d,%xmm3
mov    $0x1,%eax
movsd  0xe3c(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%r13d
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm0,%xmm2
lea    0x0(%r13,%r13,1),%eax
ucomisd %xmm2,%xmm3
ja     11d0 <mi2c+0x70>
movsd  %xmm3,0xc0(%rsp)
mov    %r13d,%eax
shr    $0x2,%eax
mov    %rax,0x50(%rsp)
mov    %r15,(%rsp)
movslq %r15d,%rax
lea    -0x10(,%rax,4),%r15
ff
mov    %rax,0xb8(%rsp)
lea    0x0(,%rax,4),%rbp
mov    %r15,%rdi
movsd  %xmm4,0x10(%rsp)
call   1070 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %rbp,%rdi
call   1070 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %r15,%rdi
call   1070 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r15,%rdi
call   1070 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %rbp,0x60(%rsp)
mov    %rbp,%rdi
call   1070 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %r15,%rdi
call   1070 <malloc@plt>
mov    %rax,0x18(%rsp)
movsd  0xd7f(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0xe0(%rsp)
mov    %r13d,%r15d
lea    0x0(,%r15,8),%rdi
call   1070 <malloc@plt>
mov    %rax,%r14
shl    $0x2,%r15
cmp    $0x2,%r13d
mov    $0x1,%r12d
cmovae %r13d,%r12d
xor    %ebp,%ebp
nop
mov    %r15,%rdi
call   1070 <malloc@plt>
mov    %rax,(%r14,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    12c0 <mi2c+0x160>
mov    %r12,0xb0(%rsp)
mov    (%rsp),%rbp
lea    -0x5(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    0x60(%rsp),%rdi
call   1070 <malloc@plt>
mov    %rax,%r10
sub    $0x8,%rsp
mov    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %r13d,%r9d
xor    %eax,%eax
mov    %r10,0x90(%rsp)
push   %r10
mov    %r14,0xa0(%rsp)
push   %r14
push   0x68(%rsp)
call   1080 <make_box2@plt>
add    $0x20,%rsp
mov    (%r15),%rdi
mov    0x58(%rsp),%r12
movsd  (%r12),%xmm0
mov    %ebp,%esi
mov    0x10(%rsp),%r14d
mov    %r14d,%edx
mov    0x40(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x30(%rsp),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
mov    0x8(%r15),%rdi
movsd  0x8(%r12),%xmm0
mov    %ebp,%esi
mov    %r14d,%edx
mov    0x28(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
test   %ebp,%ebp
mov    0x90(%rsp),%r15
jle    1709 <mi2c+0x5a9>
mov    %ebp,%eax
mov    %rax,0xd0(%rsp)
mov    0xa0(%rsp),%eax
lea    -0x1(%rax),%r12
add    $0xfffffffffffffffe,%rax
mov    %rax,0x80(%rsp)
mov    %r12,%rax
mov    %r12,0x78(%rsp)
and    $0xfffffffffffffffe,%r12
neg    %r12
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    %r13,0xd8(%rsp)
mov    0x98(%rsp),%r14
jmp    14c7 <mi2c+0x367>
nopw   0x0(%rax,%rax,1)
andpd  %xmm6,%xmm2
orpd   %xmm2,%xmm1
mov    $0x1,%r15d
movapd %xmm1,0x60(%rsp)
mov    0x8(%rsp),%rax
mov    (%rax),%rdi
mov    0x58(%rsp),%rax
movsd  (%rax),%xmm0
mov    0x50(%rsp),%rbp
mov    %ebp,%esi
mov    0x10(%rsp),%edx
mov    0x40(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x30(%rsp),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
cmp    $0x1,%r15
sbb    $0xffffffff,%eax
xor    %r13d,%r13d
cltq
movsd  (%rsp),%xmm0
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
cmp    $0x1,%r15
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdi
mov    0x58(%rsp),%rax
movsd  0x8(%rax),%xmm0
setne  %r13b
mov    %ebp,%esi
mov    0x10(%rsp),%edx
movapd 0x60(%rsp),%xmm1
mov    0x28(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
add    %eax,%r13d
movslq %r13d,%rax
mov    0xd8(%rsp),%r13
movsd  (%rsp),%xmm0
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
add    $0x1,%rbp
cmp    0xd0(%rsp),%rbp
mov    0x90(%rsp),%r15
je     1712 <mi2c+0x5b2>
mov    0x8(%rsp),%rdi
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
movsd  (%rax,%rbp,8),%xmm0
movaps %xmm0,0xa0(%rsp)
movsd  (%rcx,%rbp,8),%xmm0
movaps %xmm0,0x60(%rsp)
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %rbp,0x50(%rsp)
mov    %ebp,%r8d
mov    %r13d,%r9d
movsd  0xe0(%rsp),%xmm0
mov    $0x1,%al
push   %rbx
push   0x90(%rsp)
push   %r15
mov    0x60(%rsp),%rbp
push   %rbp
call   1050 <neiK@plt>
add    $0x20,%rsp
xorpd  %xmm1,%xmm1
mov    $0xffffffff,%r15d
test   %ebp,%ebp
jle    13fe <mi2c+0x29e>
mov    0x8(%rsp),%rax
mov    (%rax),%rax
cmpq   $0x0,0x80(%rsp)
je     16c0 <mi2c+0x560>
xorpd  %xmm0,%xmm0
mov    $0x1,%ecx
movapd 0xac1(%rip),%xmm4
movapd 0x60(%rsp),%xmm5
movapd 0xa0(%rsp),%xmm2
xchg   %ax,%ax
movslq (%rbx,%rcx,4),%rdx
movapd %xmm2,%xmm1
subsd  (%rax,%rdx,8),%xmm1
andpd  %xmm4,%xmm1
maxsd  %xmm0,%xmm1
movslq 0x4(%rbx,%rcx,4),%rdx
movapd %xmm2,%xmm0
subsd  (%rax,%rdx,8),%xmm0
andpd  %xmm4,%xmm0
maxsd  %xmm1,%xmm0
lea    (%r12,%rcx,1),%rdx
add    $0x2,%rdx
add    $0x2,%rcx
cmp    $0x1,%rdx
jne    1570 <mi2c+0x410>
testb  $0x1,0x78(%rsp)
je     15cd <mi2c+0x46d>
movslq (%rbx,%rcx,4),%rcx
subsd  (%rax,%rcx,8),%xmm2
andpd  0xa5b(%rip),%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
xorpd  %xmm2,%xmm2
xorpd  %xmm6,%xmm6
cmpl   $0x0,0x48(%rsp)
jle    166d <mi2c+0x50d>
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rax
cmpq   $0x0,0x80(%rsp)
je     16f0 <mi2c+0x590>
xorpd  %xmm6,%xmm6
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq (%rbx,%rcx,4),%rdx
movapd %xmm5,%xmm3
subsd  (%rax,%rdx,8),%xmm3
andpd  %xmm4,%xmm3
maxsd  %xmm6,%xmm3
movslq 0x4(%rbx,%rcx,4),%rdx
movapd %xmm5,%xmm6
subsd  (%rax,%rdx,8),%xmm6
andpd  %xmm4,%xmm6
maxsd  %xmm3,%xmm6
lea    (%r12,%rcx,1),%rdx
add    $0x2,%rdx
add    $0x2,%rcx
cmp    $0x1,%rdx
jne    1610 <mi2c+0x4b0>
testb  $0x1,0x78(%rsp)
je     166d <mi2c+0x50d>
movslq (%rbx,%rcx,4),%rcx
subsd  (%rax,%rcx,8),%xmm5
andpd  0x9bb(%rip),%xmm5
maxsd  %xmm6,%xmm5
movapd %xmm5,%xmm6
ucomisd 0x99b(%rip),%xmm0
mov    $0xffffffff,%r15d
mov    $0x0,%eax
cmova  %rax,%r15
movapd %xmm0,%xmm3
maxsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm6
movapd %xmm6,%xmm4
maxsd  %xmm3,%xmm4
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movapd %xmm2,%xmm1
andnpd %xmm4,%xmm1
ja     13f0 <mi2c+0x290>
andpd  %xmm0,%xmm2
orpd   %xmm2,%xmm1
jmp    13fe <mi2c+0x29e>
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
mov    $0x1,%ecx
movapd 0x94f(%rip),%xmm4
movapd 0x60(%rsp),%xmm5
movapd 0xa0(%rsp),%xmm2
testb  $0x1,0x78(%rsp)
jne    15b4 <mi2c+0x454>
jmp    15cd <mi2c+0x46d>
xorpd  %xmm6,%xmm6
mov    $0x1,%ecx
testb  $0x1,0x78(%rsp)
jne    1654 <mi2c+0x4f4>
jmp    166d <mi2c+0x50d>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm1
divsd  0xc0(%rsp),%xmm1
mov    0x98(%rsp),%rcx
mov    0xb8(%rsp),%rax
movsd  (%rcx,%rax,8),%xmm0
movslq 0x48(%rsp),%rax
addsd  (%rcx,%rax,8),%xmm0
subsd  %xmm1,%xmm0
mov    0xc8(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    0xb0(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1770 <mi2c+0x610>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x88(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mi2c(double** %0, i32 %1, i32 %2, double* %3, double* %4, double* %5) {
%7 = alloca double**
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double
%18 = alloca double*
%19 = alloca double
%20 = alloca i32
%21 = alloca double
%22 = alloca i32*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32**
%27 = alloca i32*
%28 = alloca i32**
%29 = alloca i32**
%30 = alloca i32**
%31 = alloca double
%32 = alloca i32
%33 = alloca i32
store double** %0, double*** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i32 2, i32* %33
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 4
%38 = call i8* @malloc(i64 %37)
%39 = bitcast i8* %38 to i32*
store i32* %39, i32** %22
%40 = load i32, i32* %33
%41 = add nsw i32 %40, 1
%42 = sext i32 %41 to i64
%43 = mul i64 %42, 8
%44 = call i8* @malloc(i64 %43)
%45 = bitcast i8* %44 to double*
store double* %45, double** %16
store i32 1, i32* %24
br label %46
46: ; preds = %59, %6
%47 = load i32, i32* %24
%48 = sitofp i32 %47 to double
%49 = fmul double 5.000000e-01, %48
%50 = load i32, i32* %24
%51 = sitofp i32 %50 to double
%52 = fmul double %49, %51
%53 = load i32, i32* %9
%54 = sitofp i32 %53 to double
%55 = fmul double %52, %54
%56 = load i32, i32* %8
%57 = sitofp i32 %56 to double
%58 = fcmp olt double %55, %57
br i1 %58, label %59, label %62
59: ; preds = %46
%60 = load i32, i32* %24
%61 = mul nsw i32 %60, 2
store i32 %61, i32* %24
br label %46
62: ; preds = %46
%63 = load i32, i32* %24
%64 = sitofp i32 %63 to double
%65 = fdiv double 4.000000e+00, %64
store double %65, double* %31
%66 = load i32, i32* %24
%67 = sdiv i32 %66, 4
store i32 %67, i32* %32
%68 = load i32, i32* %8
%69 = sub nsw i32 %68, 5
store i32 %69, i32* %25
%70 = load i32, i32* %33
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 8
%73 = call i8* @malloc(i64 %72)
%74 = bitcast i8* %73 to i32**
store i32** %74, i32*** %28
%75 = load i32, i32* %33
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 8
%78 = call i8* @malloc(i64 %77)
%79 = bitcast i8* %78 to i32**
store i32** %79, i32*** %29
%80 = load i32, i32* %33
%81 = sext i32 %80 to i64
%82 = mul i64 %81, 8
%83 = call i8* @malloc(i64 %82)
%84 = bitcast i8* %83 to i32**
store i32** %84, i32*** %30
store i32 0, i32* %23
br label %85
85: ; preds = %119, %62
%86 = load i32, i32* %23
%87 = load i32, i32* %33
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %122
89: ; preds = %85
%90 = load i32, i32* %25
%91 = add nsw i32 %90, 1
%92 = sext i32 %91 to i64
%93 = mul i64 %92, 4
%94 = call i8* @malloc(i64 %93)
%95 = bitcast i8* %94 to i32*
%96 = load i32**, i32*** %28
%97 = load i32, i32* %23
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32*, i32** %96, i64 %98
store i32* %95, i32** %99
%100 = load i32, i32* %8
%101 = sext i32 %100 to i64
%102 = mul i64 %101, 4
%103 = call i8* @malloc(i64 %102)
%104 = bitcast i8* %103 to i32*
%105 = load i32**, i32*** %29
%106 = load i32, i32* %23
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32*, i32** %105, i64 %107
store i32* %104, i32** %108
%109 = load i32, i32* %25
%110 = add nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = mul i64 %111, 4
%113 = call i8* @malloc(i64 %112)
%114 = bitcast i8* %113 to i32*
%115 = load i32**, i32*** %30
%116 = load i32, i32* %23
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32*, i32** %115, i64 %117
store i32* %114, i32** %118
br label %119
119: ; preds = %89
%120 = load i32, i32* %23
%121 = add nsw i32 %120, 1
store i32 %121, i32* %23
br label %85
122: ; preds = %85
%123 = load i32, i32* %24
%124 = sext i32 %123 to i64
%125 = mul i64 %124, 8
%126 = call i8* @malloc(i64 %125)
%127 = bitcast i8* %126 to i32**
store i32** %127, i32*** %26
store i32 0, i32* %13
br label %128
128: ; preds = %142, %122
%129 = load i32, i32* %13
%130 = load i32, i32* %24
%131 = icmp slt i32 %129, %130
br i1 %131, label %132, label %145
132: ; preds = %128
%133 = load i32, i32* %24
%134 = sext i32 %133 to i64
%135 = mul i64 %134, 4
%136 = call i8* @malloc(i64 %135)
%137 = bitcast i8* %136 to i32*
%138 = load i32**, i32*** %26
%139 = load i32, i32* %13
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32*, i32** %138, i64 %140
store i32* %137, i32** %141
br label %142
142: ; preds = %132
%143 = load i32, i32* %13
%144 = add nsw i32 %143, 1
store i32 %144, i32* %13
br label %128
145: ; preds = %128
%146 = load i32, i32* %8
%147 = sext i32 %146 to i64
%148 = mul i64 %147, 4
%149 = call i8* @malloc(i64 %148)
%150 = bitcast i8* %149 to i32*
store i32* %150, i32** %27
%151 = load i32, i32* %33
%152 = sext i32 %151 to i64
%153 = mul i64 %152, 8
%154 = call i8* @malloc(i64 %153)
%155 = bitcast i8* %154 to double*
store double* %155, double** %18
%156 = load i32, i32* %33
%157 = sext i32 %156 to i64
%158 = mul i64 %157, 4
%159 = call i8* @malloc(i64 %158)
%160 = bitcast i8* %159 to i32*
store i32* %160, i32** %15
%161 = load double**, double*** %7
%162 = load i32, i32* %33
%163 = load i32, i32* %8
%164 = load i32, i32* %24
%165 = load i32, i32* %32
%166 = load i32**, i32*** %26
%167 = load i32*, i32** %27
%168 = call i32 (double**, i32, i32, i32, i32, i32, i32, i32**, i32*, ...) bitcast (i32 (...)* @make_box2 to i32 (double**, i32, i32, i32, i32, i32, i32, i32**, i32*, ...)*)(double** %161, i32 %162, i32 %163, i32 0, i32 1, i32 %164, i32 %165, i32** %166, i32* %167)
store i32 0, i32* %23
br label %169
169: ; preds = %202, %145
%170 = load i32, i32* %23
%171 = load i32, i32* %33
%172 = icmp slt i32 %170, %171
br i1 %172, label %173, label %205
173: ; preds = %169
%174 = load double**, double*** %7
%175 = load i32, i32* %23
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double*, double** %174, i64 %176
%178 = load double*, double** %177
%179 = load i32, i32* %8
%180 = load double*, double** %11
%181 = load i32, i32* %23
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %180, i64 %182
%184 = load double, double* %183
%185 = load i32, i32* %25
%186 = load i32**, i32*** %28
%187 = load i32, i32* %23
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i32*, i32** %186, i64 %188
%190 = load i32*, i32** %189
%191 = load i32**, i32*** %29
%192 = load i32, i32* %23
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i32*, i32** %191, i64 %193
%195 = load i32*, i32** %194
%196 = load i32**, i32*** %30
%197 = load i32, i32* %23
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i32*, i32** %196, i64 %198
%200 = load i32*, i32** %199
%201 = call i32 (double*, i32, double, i32, i32*, i32*, i32*, ...) bitcast (i32 (...)* @make_box1 to i32 (double*, i32, double, i32, i32*, i32*, i32*, ...)*)(double* %178, i32 %179, double %184, i32 %185, i32* %190, i32* %195, i32* %200)
br label %202
202: ; preds = %173
%203 = load i32, i32* %23
%204 = add nsw i32 %203, 1
store i32 %204, i32* %23
br label %169
205: ; preds = %169
store double 0.000000e+00, double* %21
store i32 0, i32* %13
br label %206
206: ; preds = %386, %205
%207 = load i32, i32* %13
%208 = load i32, i32* %8
%209 = icmp slt i32 %207, %208
br i1 %209, label %210, label %389
210: ; preds = %206
store i32 0, i32* %23
br label %211
211: ; preds = %229, %210
%212 = load i32, i32* %23
%213 = load i32, i32* %33
%214 = icmp slt i32 %212, %213
br i1 %214, label %215, label %232
215: ; preds = %211
%216 = load double**, double*** %7
%217 = load i32, i32* %23
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds double*, double** %216, i64 %218
%220 = load double*, double** %219
%221 = load i32, i32* %13
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %220, i64 %222
%224 = load double, double* %223
%225 = load double*, double** %16
%226 = load i32, i32* %23
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %225, i64 %227
store double %224, double* %228
br label %229
229: ; preds = %215
%230 = load i32, i32* %23
%231 = add nsw i32 %230, 1
store i32 %231, i32* %23
br label %211
232: ; preds = %211
%233 = load double**, double*** %7
%234 = load i32, i32* %33
%235 = load i32, i32* %33
%236 = sub nsw i32 %235, 1
%237 = load i32, i32* %13
%238 = load i32, i32* %24
%239 = load double, double* %31
%240 = load i32, i32* %9
%241 = load i32**, i32*** %26
%242 = load i32*, i32** %27
%243 = load i32*, i32** %22
%244 = call i32 (double**, i32, i32, i32, i32, i32, double, i32, i32**, i32*, i32*, ...) bitcast (i32 (...)* @neiK to i32 (double**, i32, i32, i32, i32, i32, double, i32, i32**, i32*, i32*, ...)*)(double** %233, i32 %234, i32 0, i32 %236, i32 %237, i32 %238, double %239, i32 %240, i32** %241, i32* %242, i32* %243)
store double 0.000000e+00, double* %19
store i32 -1, i32* %20
store i32 0, i32* %23
br label %245
245: ; preds = %311, %232
%246 = load i32, i32* %23
%247 = load i32, i32* %33
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %314
249: ; preds = %245
%250 = load double*, double** %18
%251 = load i32, i32* %23
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double, double* %250, i64 %252
store double 0.000000e+00, double* %253
store i32 1, i32* %14
br label %254
254: ; preds = %292, %249
%255 = load i32, i32* %14
%256 = load i32, i32* %9
%257 = icmp sle i32 %255, %256
br i1 %257, label %258, label %295
258: ; preds = %254
%259 = load double*, double** %16
%260 = load i32, i32* %23
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds double, double* %259, i64 %261
%263 = load double, double* %262
%264 = load double**, double*** %7
%265 = load i32, i32* %23
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double*, double** %264, i64 %266
%268 = load double*, double** %267
%269 = load i32*, i32** %22
%270 = load i32, i32* %14
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i32, i32* %269, i64 %271
%273 = load i32, i32* %272
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds double, double* %268, i64 %274
%276 = load double, double* %275
%277 = fsub double %263, %276
%278 = call double @llvm.fabs.f64(double %277)
store double %278, double* %17
%279 = load double*, double** %18
%280 = load i32, i32* %23
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds double, double* %279, i64 %281
%283 = load double, double* %282
%284 = fcmp ogt double %278, %283
br i1 %284, label %285, label %291
285: ; preds = %258
%286 = load double, double* %17
%287 = load double*, double** %18
%288 = load i32, i32* %23
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %287, i64 %289
store double %286, double* %290
br label %291
291: ; preds = %285, %258
br label %292
292: ; preds = %291
%293 = load i32, i32* %14
%294 = add nsw i32 %293, 1
store i32 %294, i32* %14
br label %254
295: ; preds = %254
%296 = load double*, double** %18
%297 = load i32, i32* %23
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %296, i64 %298
%300 = load double, double* %299
%301 = load double, double* %19
%302 = fcmp ogt double %300, %301
br i1 %302, label %303, label %310
303: ; preds = %295
%304 = load double*, double** %18
%305 = load i32, i32* %23
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds double, double* %304, i64 %306
%308 = load double, double* %307
store double %308, double* %19
%309 = load i32, i32* %23
store i32 %309, i32* %20
br label %310
310: ; preds = %303, %295
br label %311
311: ; preds = %310
%312 = load i32, i32* %23
%313 = add nsw i32 %312, 1
store i32 %313, i32* %23
br label %245
314: ; preds = %245
store i32 0, i32* %23
br label %315
315: ; preds = %382, %314
%316 = load i32, i32* %23
%317 = load i32, i32* %33
%318 = icmp slt i32 %316, %317
br i1 %318, label %319, label %385
319: ; preds = %315
%320 = load double**, double*** %7
%321 = load i32, i32* %23
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double*, double** %320, i64 %322
%324 = load double*, double** %323
%325 = load i32, i32* %13
%326 = load double*, double** %11
%327 = load i32, i32* %23
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %326, i64 %328
%330 = load double, double* %329
%331 = load i32, i32* %25
%332 = load double, double* %19
%333 = load i32**, i32*** %28
%334 = load i32, i32* %23
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds i32*, i32** %333, i64 %335
%337 = load i32*, i32** %336
%338 = load i32**, i32*** %29
%339 = load i32, i32* %23
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds i32*, i32** %338, i64 %340
%342 = load i32*, i32** %341
%343 = load i32**, i32*** %30
%344 = load i32, i32* %23
%345 = sext i32 %344 to i64
%346 = getelementptr inbounds i32*, i32** %343, i64 %345
%347 = load i32*, i32** %346
%348 = call i32 (double*, i32, double, i32, double, i32*, i32*, i32*, ...) bitcast (i32 (...)* @neiE1 to i32 (double*, i32, double, i32, double, i32*, i32*, i32*, ...)*)(double* %324, i32 %325, double %330, i32 %331, double %332, i32* %337, i32* %342, i32* %347)
%349 = load i32*, i32** %15
%350 = load i32, i32* %23
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds i32, i32* %349, i64 %351
store i32 %348, i32* %352
%353 = load i32, i32* %23
%354 = load i32, i32* %20
%355 = icmp eq i32 %353, %354
br i1 %355, label %356, label %368
356: ; preds = %319
%357 = load double*, double** %10
%358 = load i32*, i32** %15
%359 = load i32, i32* %23
%360 = sext i32 %359 to i64
%361 = getelementptr inbounds i32, i32* %358, i64 %360
%362 = load i32, i32* %361
%363 = sext i32 %362 to i64
%364 = getelementptr inbounds double, double* %357, i64 %363
%365 = load double, double* %364
%366 = load double, double* %21
%367 = fadd double %366, %365
store double %367, double* %21
br label %381
368: ; preds = %319
%369 = load double*, double** %10
%370 = load i32*, i32** %15
%371 = load i32, i32* %23
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds i32, i32* %370, i64 %372
%374 = load i32, i32* %373
%375 = add nsw i32 %374, 1
%376 = sext i32 %375 to i64
%377 = getelementptr inbounds double, double* %369, i64 %376
%378 = load double, double* %377
%379 = load double, double* %21
%380 = fadd double %379, %378
store double %380, double* %21
br label %381
381: ; preds = %368, %356
br label %382
382: ; preds = %381
%383 = load i32, i32* %23
%384 = add nsw i32 %383, 1
store i32 %384, i32* %23
br label %315
385: ; preds = %315
br label %386
386: ; preds = %385
%387 = load i32, i32* %13
%388 = add nsw i32 %387, 1
store i32 %388, i32* %13
br label %206
389: ; preds = %206
%390 = load i32, i32* %8
%391 = sitofp i32 %390 to double
%392 = load double, double* %21
%393 = fdiv double %392, %391
store double %393, double* %21
%394 = load double*, double** %10
%395 = load i32, i32* %8
%396 = sext i32 %395 to i64
%397 = getelementptr inbounds double, double* %394, i64 %396
%398 = load double, double* %397
%399 = load double*, double** %10
%400 = load i32, i32* %9
%401 = sext i32 %400 to i64
%402 = getelementptr inbounds double, double* %399, i64 %401
%403 = load double, double* %402
%404 = fadd double %398, %403
%405 = load double, double* %21
%406 = fsub double %404, %405
%407 = load double*, double** %12
store double %406, double* %407
%408 = load double*, double** %16
%409 = bitcast double* %408 to i8*
%410 = load i32*, i32** %22
%411 = bitcast i32* %410 to i8*
store i32 0, i32* %13
br label %412
412: ; preds = %423, %389
%413 = load i32, i32* %13
%414 = load i32, i32* %24
%415 = icmp slt i32 %413, %414
br i1 %415, label %416, label %426
416: ; preds = %412
%417 = load i32**, i32*** %26
%418 = load i32, i32* %13
%419 = sext i32 %418 to i64
%420 = getelementptr inbounds i32*, i32** %417, i64 %419
%421 = load i32*, i32** %420
%422 = bitcast i32* %421 to i8*
br label %423
423: ; preds = %416
%424 = load i32, i32* %13
%425 = add nsw i32 %424, 1
store i32 %425, i32* %13
br label %412
426: ; preds = %412
%427 = load i32**, i32*** %26
%428 = bitcast i32** %427 to i8*
%429 = load i32*, i32** %27
%430 = bitcast i32* %429 to i8*
store i32 0, i32* %23
br label %431
431: ; preds = %454, %426
%432 = load i32, i32* %23
%433 = load i32, i32* %33
%434 = icmp slt i32 %432, %433
br i1 %434, label %435, label %457
435: ; preds = %431
%436 = load i32**, i32*** %28
%437 = load i32, i32* %23
%438 = sext i32 %437 to i64
%439 = getelementptr inbounds i32*, i32** %436, i64 %438
%440 = load i32*, i32** %439
%441 = bitcast i32* %440 to i8*
%442 = load i32**, i32*** %29
%443 = load i32, i32* %23
%444 = sext i32 %443 to i64
%445 = getelementptr inbounds i32*, i32** %442, i64 %444
%446 = load i32*, i32** %445
%447 = bitcast i32* %446 to i8*
%448 = load i32**, i32*** %30
%449 = load i32, i32* %23
%450 = sext i32 %449 to i64
%451 = getelementptr inbounds i32*, i32** %448, i64 %450
%452 = load i32*, i32** %451
%453 = bitcast i32* %452 to i8*
br label %454
454: ; preds = %435
%455 = load i32, i32* %23
%456 = add nsw i32 %455, 1
store i32 %456, i32* %23
br label %431
457: ; preds = %431
%458 = load i32**, i32*** %28
%459 = bitcast i32** %458 to i8*
%460 = load i32**, i32*** %29
%461 = bitcast i32** %460 to i8*
%462 = load i32**, i32*** %30
%463 = bitcast i32** %462 to i8*
%464 = load double*, double** %18
%465 = bitcast double* %464 to i8*
%466 = load i32*, i32** %15
%467 = bitcast i32* %466 to i8*
ret void
}

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