void mi2r_(double **x, int N, int K, double *psi, double *scal, double *mir) {
  int i, k, *n2;
  double *xc, dx;
  double *eps;
  double dxy2;
  int *nn;
  int d;
  int BOX, BOX1;
  int **box, *lis;
  int **box1;
  int **lis1;
  int **mxi;
  double epsilon;
  int inveps;
  int dim = 2;
  double *phi;
  phi = (double *)malloc((K + 1) * sizeof(double));
  for (i = 1; i <= K; i++)
    phi[i] = psi[i] - (dim - 1) / ((double)(i));
  nn = (int *)malloc((K + 1) * sizeof(int));
  xc = (double *)malloc((dim + 1) * sizeof(double));
  BOX = 1;
  while (0.5 * BOX * BOX < 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));
  n2 = (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]);
  dxy2 = 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);
    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;
      }
    }
    for (d = 0; d < dim; d++) {
      n2[d] = neiE1(x[d], i, scal[d], BOX1, eps[d], box1[d], lis1[d], mxi[d]);
      dxy2 += psi[n2[d]];
    }
  }
  dxy2 /= N;
  *mir = psi[N] + phi[K] - dxy2;
  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(n2);
  free(phi);
}


x86 assembly (clang, -O0):
<mi2r_>:
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,-0xb0(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0xb8(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11fd <mi2r_+0x9d>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb0(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl -0x34(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ac <mi2r_+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x70(%rbp)
cvtsi2sdl -0x70(%rbp),%xmm0
movsd  0xdc0(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x70(%rbp),%xmm0
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    126a <mi2r_+0x10a>
mov    -0x70(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1233 <mi2r_+0xd3>
cvtsi2sdl -0x70(%rbp),%xmm1
movsd  0xd91(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x70(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xac(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x74(%rbp)
movslq -0xb0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x90(%rbp)
movslq -0xb0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x98(%rbp)
movslq -0xb0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    136d <mi2r_+0x20d>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x90(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x98(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0xa0(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    12e9 <mi2r_+0x189>
movslq -0x70(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x70(%rbp),%eax
jge    13bb <mi2r_+0x25b>
movslq -0x70(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x80(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1385 <mi2r_+0x225>
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x88(%rbp)
movslq -0xb0(%rbp),%rdi
shl    $0x3,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0xb0(%rbp),%rdi
shl    $0x2,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0xb0(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x70(%rbp),%r9d
mov    -0xac(%rbp),%r11d
mov    -0x80(%rbp),%r10
mov    -0x88(%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,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    14ae <mi2r_+0x34e>
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x74(%rbp),%edx
mov    -0x90(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x98(%rbp),%rax
movslq -0x6c(%rbp),%r8
mov    (%rax,%r8,8),%r8
mov    -0xa0(%rbp),%rax
movslq -0x6c(%rbp),%r9
mov    (%rax,%r9,8),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    143e <mi2r_+0x2de>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    16e0 <mi2r_+0x580>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    150f <mi2r_+0x3af>
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    14d0 <mi2r_+0x370>
mov    -0x10(%rbp),%rdi
mov    -0xb0(%rbp),%esi
mov    -0xb0(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x34(%rbp),%r8d
mov    -0x70(%rbp),%r9d
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%ebx
mov    -0x80(%rbp),%r11
mov    -0x88(%rbp),%r10
mov    -0x68(%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>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    161d <mi2r_+0x4bd>
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     160a <mi2r_+0x4aa>
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x68(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xa47(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    15f7 <mi2r_+0x497>
movsd  -0x50(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15fc <mi2r_+0x49c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    158c <mi2r_+0x42c>
jmp    160f <mi2r_+0x4af>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1566 <mi2r_+0x406>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    16cd <mi2r_+0x56d>
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%esi
mov    -0x28(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x74(%rbp),%edx
mov    -0x58(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x90(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x98(%rbp),%rax
movslq -0x6c(%rbp),%r8
mov    (%rax,%r8,8),%r8
mov    -0xa0(%rbp),%rax
movslq -0x6c(%rbp),%r9
mov    (%rax,%r9,8),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
mov    %eax,%edx
mov    -0x40(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    -0x40(%rbp),%rcx
movslq -0x6c(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1624 <mi2r_+0x4c4>
jmp    16d2 <mi2r_+0x572>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14bd <mi2r_+0x35d>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
movslq -0x18(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
subsd  -0x60(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x70(%rbp),%eax
jge    1761 <mi2r_+0x601>
mov    -0x80(%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    1736 <mi2r_+0x5d6>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    17d6 <mi2r_+0x676>
mov    -0x90(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xa0(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    177d <mi2r_+0x61d>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi2r_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %r9,0xd0(%rsp)
mov    %r8,0xa8(%rsp)
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %rdi,0x10(%rsp)
lea    0x1(%rbp),%r15d
movslq %r15d,%r14
lea    0x0(,%r14,8),%rdi
call   1070 <malloc@plt>
mov    %rbp,0x78(%rsp)
test   %ebp,%ebp
jle    12c2 <mi2r_+0x162>
mov    %r15d,%ecx
lea    -0x1(%rcx),%r9
mov    $0x1,%edx
cmp    $0x2,%r9
jb     128b <mi2r_+0x12b>
mov    %r9,%r8
and    $0xfffffffffffffffe,%r8
lea    -0x2(%r8),%rsi
mov    %rsi,%rdx
shr    %rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     18bc <mi2r_+0x75c>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xe1e(%rip),%xmm0
mov    $0x1,%edi
movapd 0xe21(%rip),%xmm1
movdqa 0xe29(%rip),%xmm2
movdqa 0xe31(%rip),%xmm3
nop
movupd (%rbx,%rdi,8),%xmm4
cvtdq2pd %xmm0,%xmm5
movapd %xmm1,%xmm6
divpd  %xmm5,%xmm6
subpd  %xmm6,%xmm4
movupd %xmm4,(%rax,%rdi,8)
movdqa %xmm0,%xmm4
paddd  %xmm2,%xmm4
movupd 0x10(%rbx,%rdi,8),%xmm5
cvtdq2pd %xmm4,%xmm4
movapd %xmm1,%xmm6
divpd  %xmm4,%xmm6
subpd  %xmm6,%xmm5
movupd %xmm5,0x10(%rax,%rdi,8)
paddd  %xmm3,%xmm0
add    $0x4,%rdi
add    $0xfffffffffffffffe,%rsi
jne    1210 <mi2r_+0xb0>
cvtdq2pd %xmm0,%xmm0
test   $0x1,%dl
je     127f <mi2r_+0x11f>
movupd (%rbx,%rdi,8),%xmm1
movapd 0xdde(%rip),%xmm2
divpd  %xmm0,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm2,(%rax,%rdi,8)
cmp    %r8,%r9
je     12c2 <mi2r_+0x162>
or     $0x1,%r9
mov    %r9,%rdx
movsd  0xddd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
addsd  (%rbx,%rdx,8),%xmm2
movsd  %xmm2,(%rax,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    12a0 <mi2r_+0x140>
mov    %r15d,0x20(%rsp)
mov    %rbx,0xb0(%rsp)
mov    %rax,0xd8(%rsp)
shl    $0x2,%r14
mov    %r14,%rdi
call   1070 <malloc@plt>
mov    %rax,%r14
xorps  %xmm2,%xmm2
cvtsi2sd %r12d,%xmm2
mov    $0x1,%eax
movsd  0xd7d(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
mov    %eax,%r15d
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
lea    (%r15,%r15,1),%eax
ucomisd %xmm1,%xmm2
ja     1300 <mi2r_+0x1a0>
movsd  %xmm2,0xc8(%rsp)
mov    %r15d,%eax
shr    $0x2,%eax
mov    %rax,0x30(%rsp)
mov    %r12,0x8(%rsp)
movslq %r12d,%rax
lea    -0x10(,%rax,4),%rbx
ff
mov    %rax,0xc0(%rsp)
lea    0x0(,%rax,4),%rbp
mov    %rbx,%rdi
movq   %xmm3,0x28(%rsp)
call   1070 <malloc@plt>
mov    %rax,0x70(%rsp)
mov    %rbp,%rdi
call   1070 <malloc@plt>
mov    %rax,0x68(%rsp)
mov    %rbx,%rdi
call   1070 <malloc@plt>
mov    %rax,0x60(%rsp)
mov    %rbx,%rdi
call   1070 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %rbp,0x80(%rsp)
mov    %rbp,%rdi
call   1070 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    %rbx,%rdi
call   1070 <malloc@plt>
mov    %rax,0x48(%rsp)
movsd  0xcc8(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
movsd  %xmm0,0xf0(%rsp)
mov    %r15d,%ebx
lea    0x0(,%rbx,8),%rdi
call   1070 <malloc@plt>
mov    %rax,%r13
shl    $0x2,%rbx
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovae %r15d,%ebp
xor    %r12d,%r12d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1070 <malloc@plt>
mov    %rax,0x0(%r13,%r12,8)
add    $0x1,%r12
cmp    %r12,%rbp
jne    13f0 <mi2r_+0x290>
mov    %rbp,0xb8(%rsp)
mov    0x8(%rsp),%r12
lea    -0x5(%r12),%eax
mov    %eax,0x1c(%rsp)
mov    0x80(%rsp),%rdi
call   1070 <malloc@plt>
mov    %rax,%rbp
sub    $0x8,%rsp
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
mov    %rbp,0xa8(%rsp)
push   %rbp
mov    %r13,0x38(%rsp)
push   %r13
push   0x48(%rsp)
call   1080 <make_box2@plt>
add    $0x20,%rsp
mov    (%rbx),%rdi
mov    %rbx,%rbp
mov    0xa8(%rsp),%r13
movsd  0x0(%r13),%xmm0
mov    %r12d,%esi
mov    0x1c(%rsp),%ebx
mov    %ebx,%edx
mov    0x70(%rsp),%rcx
mov    0x68(%rsp),%r8
mov    0x60(%rsp),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
mov    0x8(%rbp),%rdi
movsd  0x8(%r13),%xmm0
mov    %r12d,%esi
mov    %ebx,%edx
mov    0x58(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0x48(%rsp),%r9
mov    $0x1,%al
call   1040 <make_box1@plt>
test   %r12d,%r12d
jle    17d8 <mi2r_+0x678>
mov    %r12d,%eax
mov    %rax,0xe0(%rsp)
mov    0x20(%rsp),%eax
lea    -0x1(%rax),%r12
add    $0xfffffffffffffffe,%rax
mov    %rax,0x20(%rsp)
mov    %r12,%rax
mov    %r12,0x98(%rsp)
and    $0xfffffffffffffffe,%r12
neg    %r12
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebx,%ebx
mov    %r15,0xe8(%rsp)
mov    0xa8(%rsp),%r13
jmp    15e0 <mi2r_+0x480>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm4,%xmm4
movapd %xmm4,0x80(%rsp)
mov    0x10(%rsp),%rax
mov    (%rax),%rdi
mov    %rax,%r15
movsd  0x0(%r13),%xmm0
mov    %ebx,%esi
mov    %rbx,0x30(%rsp)
mov    0x1c(%rsp),%ebx
mov    %ebx,%edx
mov    0x70(%rsp),%rcx
mov    0x68(%rsp),%r8
mov    0x60(%rsp),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
cltq
mov    0xb0(%rsp),%rbp
movsd  0x8(%rsp),%xmm0
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x8(%r15),%rdi
movsd  0x8(%r13),%xmm0
mov    0xe8(%rsp),%r15
mov    0x30(%rsp),%rsi
mov    %ebx,%edx
mov    0x30(%rsp),%rbx
movapd 0x80(%rsp),%xmm1
mov    0x58(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0x48(%rsp),%r9
mov    $0x2,%al
call   1060 <neiE1@plt>
cltq
movsd  0x8(%rsp),%xmm0
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x1,%rbx
cmp    0xe0(%rsp),%rbx
je     17e2 <mi2r_+0x682>
mov    0x10(%rsp),%rdi
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
movsd  (%rax,%rbx,8),%xmm0
movaps %xmm0,0x80(%rsp)
movsd  (%rcx,%rbx,8),%xmm0
movaps %xmm0,0x30(%rsp)
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
mov    %r15d,%r9d
movsd  0xf0(%rsp),%xmm0
mov    $0x1,%al
push   %r14
push   0xa8(%rsp)
push   0x38(%rsp)
mov    0x90(%rsp),%rbp
push   %rbp
call   1050 <neiK@plt>
add    $0x20,%rsp
xorpd  %xmm1,%xmm1
xorpd  %xmm4,%xmm4
test   %ebp,%ebp
jle    1524 <mi2r_+0x3c4>
mov    0x10(%rsp),%rax
mov    (%rax),%rax
cmpq   $0x0,0x20(%rsp)
je     1770 <mi2r_+0x610>
xorpd  %xmm1,%xmm1
mov    $0x1,%ecx
movapd 0x9ec(%rip),%xmm2
movapd 0x30(%rsp),%xmm3
movapd 0x80(%rsp),%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq (%r14,%rcx,4),%rdx
movapd %xmm4,%xmm0
subsd  (%rax,%rdx,8),%xmm0
andpd  %xmm2,%xmm0
maxsd  %xmm1,%xmm0
movslq 0x4(%r14,%rcx,4),%rdx
movapd %xmm4,%xmm1
subsd  (%rax,%rdx,8),%xmm1
andpd  %xmm2,%xmm1
maxsd  %xmm0,%xmm1
lea    (%r12,%rcx,1),%rdx
add    $0x2,%rdx
add    $0x2,%rcx
cmp    $0x1,%rdx
jne    1690 <mi2r_+0x530>
testb  $0x1,0x98(%rsp)
01
je     16f0 <mi2r_+0x590>
movslq (%r14,%rcx,4),%rcx
subsd  (%rax,%rcx,8),%xmm4
andpd  0x978(%rip),%xmm4
maxsd  %xmm1,%xmm4
movapd %xmm4,%xmm1
cmpl   $0x0,0x78(%rsp)
jle    1520 <mi2r_+0x3c0>
mov    0x10(%rsp),%rax
mov    0x8(%rax),%rax
cmpq   $0x0,0x20(%rsp)
je     17a3 <mi2r_+0x643>
xorpd  %xmm4,%xmm4
mov    $0x1,%ecx
nopl   0x0(%rax)
movslq (%r14,%rcx,4),%rdx
movapd %xmm3,%xmm0
subsd  (%rax,%rdx,8),%xmm0
andpd  %xmm2,%xmm0
maxsd  %xmm4,%xmm0
movslq 0x4(%r14,%rcx,4),%rdx
movapd %xmm3,%xmm4
subsd  (%rax,%rdx,8),%xmm4
andpd  %xmm2,%xmm4
maxsd  %xmm0,%xmm4
lea    (%r12,%rcx,1),%rdx
add    $0x2,%rdx
add    $0x2,%rcx
cmp    $0x1,%rdx
jne    1720 <mi2r_+0x5c0>
testb  $0x1,0x98(%rsp)
01
je     1524 <mi2r_+0x3c4>
jmp    17ba <mi2r_+0x65a>
nopl   (%rax)
xorpd  %xmm1,%xmm1
mov    $0x1,%ecx
movapd 0x8df(%rip),%xmm2
movapd 0x30(%rsp),%xmm3
movapd 0x80(%rsp),%xmm4
testb  $0x1,0x98(%rsp)
01
jne    16d7 <mi2r_+0x577>
jmp    16f0 <mi2r_+0x590>
xorpd  %xmm4,%xmm4
mov    $0x1,%ecx
testb  $0x1,0x98(%rsp)
01
je     1524 <mi2r_+0x3c4>
movslq (%r14,%rcx,4),%rcx
subsd  (%rax,%rcx,8),%xmm3
andpd  0x895(%rip),%xmm3
maxsd  %xmm4,%xmm3
movapd %xmm3,%xmm4
jmp    1524 <mi2r_+0x3c4>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm1
divsd  0xc8(%rsp),%xmm1
mov    0xb0(%rsp),%rax
mov    0xc0(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq 0x78(%rsp),%rax
mov    0xd8(%rsp),%r15
addsd  (%r15,%rax,8),%xmm0
subsd  %xmm1,%xmm0
mov    0xd0(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %r14,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    0x28(%rsp),%r14
mov    0xb8(%rsp),%rbp
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1840 <mi2r_+0x6e0>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0xa0(%rsp),%rdi
call   1030 <free@plt>
mov    0x70(%rsp),%rdi
call   1030 <free@plt>
mov    0x68(%rsp),%rdi
call   1030 <free@plt>
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    0x58(%rsp),%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
movapd 0x73c(%rip),%xmm0
mov    $0x1,%edi
test   $0x1,%dl
jne    1265 <mi2r_+0x105>
jmp    127f <mi2r_+0x11f>

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

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