user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<DistanceREV>:
  endbr64
  push   %r15
  mov    %esi,%eax
  push   %r14
  imul   %esi,%eax
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x98,%rsp
  mov    0xd0(%rsp),%rsi
  mov    %eax,0x50(%rsp)
  cltq
  mov    %r8,0x30(%rsp)
  lea    (%rsi,%rax,8),%rax
  mov    %r9,0x48(%rsp)
  mov    %rax,0x40(%rsp)
  mov    0xd8(%rsp),%rax
  movsd  %xmm0,0x10(%rsp)
  movl   $0x0,(%rax)
  test   %ebx,%ebx
  jle    L240
  pxor   %xmm4,%xmm4
  mov    %rcx,%r11
  mov    %rdx,%r13
  xor    %ecx,%ecx
  movsd  %xmm4,0x8(%rsp)
  movapd %xmm4,%xmm0
  xor    %r15d,%r15d
  nopl   (%rax)
L263:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L565:
  cmp    %r15d,%eax
  je     L153
  lea    (%rax,%rcx,1),%edx
  add    $0x1,%eax
  movslq %edx,%rdx
  addsd  0x0(%rbp,%rdx,8),%xmm0
  cmp    %ebx,%eax
  jne    L565
  lea    0x1(%r15),%r12d
  add    %ebx,%ecx
  cmp    %r12d,%ebx
  je     L518
L184:
  mov    %r12d,%r15d
  jmp    L263
  nopl   0x0(%rax,%rax,1)
L153:
  add    $0x1,%eax
  cmp    %eax,%ebx
  jne    L565
  lea    0x1(%r15),%r12d
  add    %ebx,%ecx
  cmp    %r12d,%ebx
  jne    L184
  nopw   0x0(%rax,%rax,1)
L518:
  movsd  D65(%rip),%xmm5
  comisd %xmm0,%xmm5
  ja     L339
  cmp    $0x1,%ebx
  je     L569
  lea    0x8(%rbp),%rax
  movslq %ebx,%rsi
  mov    %r15d,0x54(%rsp)
  mov    %ebx,%ecx
  mov    %rax,0x28(%rsp)
  lea    0x0(,%rsi,8),%rdx
  movapd D8(%rip),%xmm2
  xor    %r9d,%r9d
  mov    %rax,(%rsp)
  lea    -0x1(%r15),%eax
  movsd  D8(%rip),%xmm1
  add    $0x2,%rax
  mov    %ebx,0x18(%rsp)
  mov    %r11,0x60(%rsp)
  mov    %rsi,0x38(%rsp)
  shl    $0x4,%rsi
  mov    %rax,0x20(%rsp)
  xor    %eax,%eax
  mov    %rsi,%r8
  mov    $0x1,%esi
  mov    %r13,0x58(%rsp)
  mov    %rax,%r13
  cs nopw 0x0(%rax,%rax,1)
L87:
  movslq %ecx,%r11
  xor    %r10d,%r10d
  lea    0x0(,%rsi,8),%r14
  mov    %esi,%ebx
  lea    -0x1(%r11,%rsi,1),%r15
  lea    0x0(,%r11,8),%rax
  mov    %esi,%edi
  shl    $0x3,%r15
  test   %r12d,%r12d
  cmovs  %r9,%r10
  add    %r14,%r10
  cmp    %r10,%r15
  setl   %r15b
  xor    %r10d,%r10d
  test   %r12d,%r12d
  cmovns %r9,%r10
  add    %r14,%r10
  cmp    %rax,%r10
  setl   %r10b
  or     %r15b,%r10b
  je     L77
  cmp    $0x9,%r13d
  jbe    L77
  mov    %ebx,%r10d
  add    %rbp,%rax
  shr    %r10d
  lea    0x10(%rax),%r11
  lea    -0x1(%r10),%r14d
  mov    (%rsp),%r10
  shl    $0x4,%r14
  add    %r11,%r14
  jmp    L154
  nopl   0x0(%rax)
L269:
  add    $0x10,%r11
L154:
  movsd  (%r10),%xmm0
  movupd (%rax),%xmm6
  movhpd (%r10,%rdx,1),%xmm0
  addpd  %xmm6,%xmm0
  mulpd  %xmm2,%xmm0
  movlpd %xmm0,(%r10)
  movhpd %xmm0,(%r10,%rdx,1)
  add    %r8,%r10
  movups %xmm0,(%rax)
  mov    %r11,%rax
  cmp    %r14,%r11
  jne    L269
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ebx
  je     L167
  lea    (%rcx,%rax,1),%r10d
  imul   %r12d,%eax
  movslq %r10d,%r10
  lea    0x0(%rbp,%r10,8),%r10
  movsd  (%r10),%xmm0
  add    %edi,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  addsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  %xmm0,(%r10)
L167:
  addq   $0x8,(%rsp)
  add    $0x1,%r13
  add    0x18(%rsp),%ecx
  add    %rdx,%r9
  add    $0x1,%rsi
  cmp    0x20(%rsp),%rsi
  jne    L87
  mov    0x54(%rsp),%r15d
  mov    0x18(%rsp),%ebx
  mov    0x58(%rsp),%r13
  mov    0x60(%rsp),%r11
L291:
  mov    0x50(%rsp),%r14d
  mov    %rbp,%rdi
  mov    %r11,0x60(%rsp)
  mov    %r14d,%esi
  call   <sum@plt>
  pxor   %xmm1,%xmm1
  mov    %rbp,%rsi
  mov    %r14d,%edx
  cvtsi2sd %eax,%xmm1
  movsd  D92(%rip),%xmm0
  mov    %rbp,%r14
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <abyx@plt>
  mov    0x38(%rsp),%rax
  lea    -0x1(%rbx),%ecx
  mov    0x48(%rsp),%rsi
  mov    %ecx,0x28(%rsp)
  shl    $0x3,%rax
  mov    %rcx,0x20(%rsp)
  shl    $0x3,%rcx
  lea    0x8(%rax),%rdi
  mov    %rcx,0x78(%rsp)
  lea    0x8(%rsi,%rcx,1),%rcx
  mov    %rbp,0x80(%rsp)
  mov    %r15d,(%rsp)
  mov    %rsi,%r15
  mov    %rbp,0x48(%rsp)
  mov    %rdi,%rbp
  mov    %ebx,0x54(%rsp)
  mov    %rax,%rbx
  mov    %r13,0x58(%rsp)
  mov    %r14,%r13
  mov    %rax,0x38(%rsp)
  mov    %rsi,0x68(%rsp)
  mov    %rdi,0x70(%rsp)
  mov    %rcx,0x18(%rsp)
  jmp    L322
  nopw   0x0(%rax,%rax,1)
L81:
  subsd  %xmm0,%xmm1
  mov    0xd8(%rsp),%rax
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%r14)
  movl   $0xffffffff,(%rax)
L571:
  add    %rbx,%r13
  add    $0x8,%r15
  add    %rbp,%r14
  cmp    0x18(%rsp),%r15
  je     L335
L322:
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <sum@plt>
  pxor   %xmm0,%xmm0
  movsd  D65(%rip),%xmm4
  movsd  D92(%rip),%xmm1
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,(%r15)
  movsd  (%r14),%xmm2
  comisd %xmm2,%xmm4
  jae    L81
  divsd  %xmm0,%xmm1
  mov    %r12d,%edx
  mov    %r13,%rsi
  cvttsd2si %xmm1,%edi
  call   <abyx@plt>
  jmp    L571
L77:
  mov    0x28(%rsp),%rdi
  add    %r13,%r11
  add    %rbp,%rax
  lea    (%rdi,%r11,8),%r10
  mov    (%rsp),%rdi
  nopl   0x0(%rax,%rax,1)
L594:
  movsd  (%rax),%xmm0
  addsd  (%rdi),%xmm0
  add    $0x8,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdi)
  add    %rdx,%rdi
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%r10
  jne    L594
  jmp    L167
L335:
  mov    (%rsp),%r15d
  mov    0x54(%rsp),%ebx
  mov    %r12d,%edx
  mov    $0x1,%edi
  mov    0x60(%rsp),%r11
  mov    0x48(%rsp),%rbp
  mov    0x58(%rsp),%r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  mov    %r11,%r9
  mov    %rbp,%rsi
  mov    0xe0(%rsp),%r8
  mov    %r13,%rcx
  mov    %r11,0x10(%rsp)
  call   <eigen@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  mov    (%rsp),%r11
  jne    L304
L1:
  mov    0x30(%rsp),%r14
  mov    0x50(%rsp),%edx
  mov    %r11,%rdi
  mov    %r11,(%rsp)
  mov    %r14,%rsi
  call   <xtoy@plt>
  mov    %r14,%rdi
  mov    %r12d,%edx
  mov    %r12d,%esi
  mov    0xd0(%rsp),%rcx
  mov    $0x1,%r14d
  call   <matinv@plt>
  mov    0x20(%rsp),%rax
  movsd  0x8(%rsp),%xmm5
  mov    (%rsp),%r11
  add    $0x2,%rax
  comisd 0x10(%rsp),%xmm5
  mov    %rax,(%rsp)
  jae    L92
  mov    %ebx,0x20(%rsp)
  mov    %r13,%rbx
  mov    %r11,%r13
L276:
  movsd  -0x8(%rbx,%r14,8),%xmm0
  movsd  0x8(%rsp),%xmm5
  mov    %r14d,%esi
  comisd %xmm0,%xmm5
  jae    L105
  movsd  D15(%rip),%xmm1
  divsd  0x10(%rsp),%xmm1
  cvttsd2si %xmm1,%edi
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  mov    %eax,%r8d
  mov    $0x1,%eax
  sub    %r8d,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,-0x8(%rbx,%r14,8)
  add    $0x1,%r14
  cmp    %r14,(%rsp)
  jne    L276
L242:
  mov    %r13,%r11
  mov    %rbx,%r13
  mov    0x20(%rsp),%ebx
L60:
  mov    %ebx,%eax
  mov    %ebx,%r14d
  mov    0xd0(%rsp),%rdx
  mov    %r13,%r10
  shr    %eax
  and    $0xfffffffe,%r14d
  mov    0x78(%rsp),%rsi
  mov    %r13,0x60(%rsp)
  sub    $0x1,%eax
  mov    %r14d,0x50(%rsp)
  lea    0x8(%r11),%r9
  xor    %ecx,%ecx
  lea    0x1(%rax),%rdi
  mov    %rax,0x88(%rsp)
  mov    %r14d,%eax
  sub    %rdx,%rsi
  lea    0x0(%r13,%rax,8),%r8
  lea    0x8(%r13),%rax
  mov    %rbp,0x58(%rsp)
  mov    0x38(%rsp),%rbp
  mov    %rax,0x20(%rsp)
  mov    $0xfffffffffffffff8,%rax
  shl    $0x4,%rdi
  sub    %r11,%rax
  mov    %r12d,0x54(%rsp)
  xor    %r12d,%r12d
  mov    %rax,0x40(%rsp)
  lea    0x8(%rsi),%rax
  mov    %rdx,%rsi
  mov    %rax,0x48(%rsp)
  mov    %r15d,0x10(%rsp)
  mov    %ebx,%r15d
  nopl   0x0(%rax)
L210:
  cmp    0x20(%rsp),%rdx
  setne  %bl
  cmp    %r9,%rdx
  setne  %al
  test   %al,%bl
  je     L333
  cmpl   $0x1,0x28(%rsp)
  lea    -0x8(%r9),%rbx
  seta   (%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rsp)
  je     L333
  nop
L390:
  movupd (%rbx,%rax,1),%xmm0
  movupd 0x0(%r13,%rax,1),%xmm7
  mulpd  %xmm7,%xmm0
  movups %xmm0,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L390
  cmp    %r14d,%r15d
  je     L107
  lea    (%rcx,%r14,1),%eax
  cltq
  movsd  (%r11,%rax,8),%xmm0
  mulsd  (%r8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
L107:
  lea    0x1(%r12),%eax
  add    %rbp,%rdx
  add    %rbp,%r9
  add    %r15d,%ecx
  sub    %rbp,%r10
  cmp    0x10(%rsp),%r12d
  je     L520
  mov    %eax,%r12d
  jmp    L210
L92:
  mov    %ebx,0x10(%rsp)
  mov    %r13,%rbx
  mov    %r11,%r13
  cs nopw 0x0(%rax,%rax,1)
L64:
  movsd  -0x8(%rbx,%r14,8),%xmm0
  movsd  0x8(%rsp),%xmm4
  mov    %r14d,%esi
  comisd %xmm0,%xmm4
  jae    L528
  call   <log@plt>
  movsd  %xmm0,-0x8(%rbx,%r14,8)
  add    $0x1,%r14
  cmp    (%rsp),%r14
  jne    L64
L108:
  mov    %r13,%r11
  mov    %rbx,%r13
  mov    0x10(%rsp),%ebx
  jmp    L60
  nop
L333:
  mov    0x40(%rsp),%rax
  mov    0x48(%rsp),%rbx
  add    %r9,%rax
  add    %rdx,%rbx
L439:
  movsd  (%r11,%rax,1),%xmm0
  mulsd  (%r10,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rbx
  jne    L439
  jmp    L107
  nop
L105:
  lea    D25(%rip),%rdi
  call   <printf@plt>
  movsd  D15(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  -0x8(%rbx,%r14,8),%xmm0
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  mov    %eax,%r8d
  mov    $0x1,%eax
  sub    %r8d,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,-0x8(%rbx,%r14,8)
  add    $0x1,%r14
  cmp    (%rsp),%r14
  jne    L276
  jmp    L242
L520:
  mov    0x54(%rsp),%r12d
  mov    0x58(%rsp),%rbp
  mov    %r15d,%ebx
  mov    0x30(%rsp),%rsi
  mov    0xd0(%rsp),%rdi
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %r12d,%r9d
  mov    %r12d,%r8d
  mov    0x10(%rsp),%r15d
  call   <matby@plt>
  mov    0x68(%rsp),%rdx
  mov    0x70(%rsp),%rcx
  mov    %rbp,%rax
  mov    0x18(%rsp),%rsi
  pxor   %xmm8,%xmm8
  nopl   0x0(%rax)
L35:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rdx
  add    %rcx,%rax
  subsd  %xmm0,%xmm8
  cmp    %rsi,%rdx
  jne    L35
  movsd  0x8(%rsp),%xmm5
  comisd %xmm8,%xmm5
  jae    L186
L595:
  cmp    $0x1,%r12d
  je     L336
  mov    0x88(%rsp),%rax
  movapd %xmm8,%xmm1
  mov    0x60(%rsp),%rdx
  unpcklpd %xmm1,%xmm1
  shl    $0x4,%rax
  lea    0x10(%r13,%rax,1),%rax
  nopl   0x0(%rax,%rax,1)
L88:
  movupd (%rdx),%xmm0
  add    $0x10,%rdx
  divpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rax,%rdx
  jne    L88
  cmp    %r14d,%ebx
  je     L312
L250:
  movslq 0x50(%rsp),%rax
  lea    0x0(%r13,%rax,8),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm8,%xmm0
  movsd  %xmm0,(%rax)
L312:
  test   %r12d,%r12d
  mov    $0x1,%r8d
  movapd %xmm8,%xmm5
  movdqa D133(%rip),%xmm7
  cmovg  %ebx,%r8d
  mov    0x38(%rsp),%r11
  xor    %esi,%esi
  xor    %ecx,%ecx
  mov    0x80(%rsp),%r10
  movsd  0x8(%rsp),%xmm14
  unpcklpd %xmm5,%xmm5
  pxor   %xmm4,%xmm4
  mov    %r8d,%eax
  mov    %r8d,%edi
  pxor   %xmm3,%xmm3
  shr    $0x2,%eax
  and    $0xfffffffc,%edi
  lea    -0x1(%rax),%r9d
  add    $0x1,%r9
  shl    $0x5,%r9
  cmp    $0x3,%r12d
  jle    L548
  nopl   0x0(%rax)
L435:
  movd   %ecx,%xmm6
  movdqa D57(%rip),%xmm2
  lea    (%r9,%r10,1),%rdx
  mov    %r10,%rax
  pshufd $0x0,%xmm6,%xmm6
L208:
  movupd (%rax),%xmm10
  movupd 0x10(%rax),%xmm9
  movdqa %xmm2,%xmm0
  movdqa %xmm3,%xmm13
  pcmpeqd %xmm6,%xmm0
  add    $0x20,%rax
  paddd  %xmm7,%xmm2
  divpd  %xmm5,%xmm10
  pcmpgtd %xmm0,%xmm13
  divpd  %xmm5,%xmm9
  movapd %xmm10,%xmm1
  cmpltpd %xmm4,%xmm1
  movapd %xmm9,%xmm11
  cmpltpd %xmm4,%xmm11
  shufps $0x88,%xmm11,%xmm1
  movdqa %xmm0,%xmm11
  pcmpeqd %xmm3,%xmm11
  pand   %xmm11,%xmm1
  movdqa %xmm3,%xmm11
  pcmpgtd %xmm1,%xmm11
  movdqa %xmm1,%xmm12
  punpckldq %xmm11,%xmm12
  punpckhdq %xmm11,%xmm1
  movdqa %xmm0,%xmm11
  andnpd %xmm10,%xmm12
  andnpd %xmm9,%xmm1
  punpckldq %xmm13,%xmm11
  punpckhdq %xmm13,%xmm0
  andpd  %xmm11,%xmm10
  andnpd %xmm12,%xmm11
  andpd  %xmm0,%xmm9
  andnpd %xmm1,%xmm0
  orpd   %xmm10,%xmm11
  orpd   %xmm9,%xmm0
  movups %xmm11,-0x20(%rax)
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L208
  mov    %edi,%eax
  cmp    %r8d,%edi
  je     L331
L252:
  lea    (%rsi,%rax,1),%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm8,%xmm0
  cmp    %eax,%ecx
  je     L130
  movapd %xmm14,%xmm6
  maxsd  %xmm0,%xmm6
  movsd  %xmm6,(%rdx)
L432:
  lea    0x1(%rax),%r13d
  cmp    %r15d,%eax
  jge    L331
  lea    (%rsi,%r13,1),%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm8,%xmm0
  cmp    %r13d,%ecx
  je     L180
  movapd %xmm14,%xmm6
  maxsd  %xmm0,%xmm6
  movsd  %xmm6,(%rdx)
L54:
  add    $0x2,%eax
  cmp    %r12d,%eax
  jge    L331
  lea    (%rsi,%rax,1),%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm8,%xmm0
  cmp    %eax,%ecx
  je     L475
  movapd %xmm14,%xmm2
  maxsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
L475:
  movsd  %xmm0,(%rdx)
L331:
  lea    0x1(%rcx),%eax
  add    %ebx,%esi
  add    %r11,%r10
  cmp    %r15d,%ecx
  je     L514
  mov    %eax,%ecx
  cmp    $0x3,%r12d
  jg     L435
L548:
  xor    %eax,%eax
  jmp    L252
  xchg   %ax,%ax
L130:
  movsd  %xmm0,(%rdx)
  jmp    L432
  nopl   0x0(%rax)
L180:
  movsd  %xmm0,(%rdx)
  jmp    L54
L240:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x8(%rsp)
L339:
  mov    0xd8(%rsp),%rax
  mov    0x50(%rsp),%esi
  mov    %rbp,%rdi
  movl   $0x1,(%rax)
  call   <zero@plt>
  pxor   %xmm8,%xmm8
L514:
  add    $0x98,%rsp
  movapd %xmm8,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L528:
  lea    D25(%rip),%rdi
  call   <printf@plt>
  movsd  -0x8(%rbx,%r14,8),%xmm0
  call   <log@plt>
  movsd  %xmm0,-0x8(%rbx,%r14,8)
  add    $0x1,%r14
  cmp    %r14,(%rsp)
  jne    L64
  jmp    L108
L304:
  lea    D75(%rip),%rdi
  call   <error2@plt>
  mov    (%rsp),%r11
  jmp    L1
L186:
  lea    D67(%rip),%rdi
  movsd  %xmm8,(%rsp)
  call   <puts@plt>
  movsd  (%rsp),%xmm8
  jmp    L595
L569:
  movq   $0x1,0x38(%rsp)
  jmp    L291
L336:
  movl   $0x0,0x50(%rsp)
  jmp    L250
```

tool_calls: name: read_data
arguments: data_label: D65
data_type: byte[8]
name: read_data
arguments: data_label: D8
data_type: byte[16]
name: read_data
arguments: data_label: D92
data_type: f64
name: read_data
arguments: data_label: D15
data_type: byte[8]
name: read_data
arguments: data_label: D25
data_type: string
name: read_data
arguments: data_label: D133
data_type: byte[16]
name: read_data
arguments: data_label: D57
data_type: byte[16]
name: read_data
arguments: data_label: D75
data_type: string
name: read_data
arguments: data_label: D67
data_type: string

tool: {"D65": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

tool: {"D8": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D92: 1

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D25:   Root %d:%10.4f

tool: {"D133": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D57": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: D75: eigen jgl

tool: D67: err: DistanceREV

assistant: ```c
double DistanceREV(double Ft[], int n, double alpha, double Root[], double U[], double V[], double pi[], double space[], int *cond) {
  int i, j;
  double *Q = Ft, *T1 = space, *T2 = space + n * n, t, small = 1e-6;
  *cond = 0;
  for (i = 0, t = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (i - j)
        t += Q[i * n + j];
  if (t < small) {
    *cond = 1;
    zero(Q, n * n);
    return (0);
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < i; j++)
      Q[i * n + j] = Q[j * n + i] = (Q[i * n + j] + Q[j * n + i]) / 2;
  abyx(1. / sum(Q, n * n), Q, n * n);
  for (i = 0; i < n; i++) {
    pi[i] = sum(Q + i * n, n);
    if (Q[i * n + i] <= small) {
      Q[i * n + i] = 1 - pi[i] + Q[i * n + i];
      *cond = -1;
    } else
      abyx(1 / pi[i], Q + i * n, n);
  }
  if (eigen(1, Q, n, Root, T1, U, V, T2))
    error2("eigen jgl");
  xtoy(U, V, n * n);
  matinv(V, n, n, T1);
  for (i = 0; i < n; i++) {
    if (Root[i] <= 0) {
      printf("  Root %d:%10.4f", i + 1, Root[i]);
    }
    Root[i] = (alpha <= 0 ? log(Root[i]) : (alpha * (1 - pow(Root[i], -1 / alpha))));
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      T1[i * n + j] = U[i * n + j] * Root[j];
  matby(T1, V, Q, n, n, n);
  for (i = 0, t = 0; i < n; i++)
    t -= pi[i] * Q[i * n + i];
  if (t <= 0)
    puts("err: DistanceREV");
  for (i = 0; i < n; i++)
    Root[i] /= t;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      Q[i * n + j] /= t;
      if (i - j)
        Q[i * n + j] = ((0) > (Q[i * n + j]) ? (0) : (Q[i * n + j]));
    }
  return (t);
}
```