user: Translate the below assembly code into C programming language:

```asm
<DistanceREV>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  mov    %rdx,-0x60(%rbp)
  mov    %rcx,-0x68(%rbp)
  mov    %r8,-0x70(%rbp)
  mov    %r9,-0x78(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movsd  D62(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    0x18(%rbp),%rax
  movl   $0x0,(%rax)
  movl   $0x0,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L149
L97:
  movl   $0x0,-0x3c(%rbp)
  jmp    L236
L220:
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L65
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
L65:
  addl   $0x1,-0x3c(%rbp)
L236:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L220
  addl   $0x1,-0x40(%rbp)
L149:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L97
  movsd  -0x18(%rbp),%xmm0
  comisd -0x38(%rbp),%xmm0
  jbe    L211
  mov    0x18(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <zero@plt>
  pxor   %xmm0,%xmm0
  jmp    L92
L211:
  movl   $0x0,-0x40(%rbp)
  jmp    L355
L9:
  movl   $0x0,-0x3c(%rbp)
  jmp    L22
L290:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x3c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x3c(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  D72(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%edx
  mov    %edx,%ecx
  imul   -0x4c(%rbp),%ecx
  mov    -0x3c(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  addl   $0x1,-0x3c(%rbp)
L22:
  mov    -0x3c(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L290
  addl   $0x1,-0x40(%rbp)
L355:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L9
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%ebx
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <sum@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D49(%rip),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    -0x30(%rbp),%rcx
  mov    %ebx,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <abyx@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L333
L124:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <sum@plt>
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x78(%rbp),%rax
  add    %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x18(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L249
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movsd  D49(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x18(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L136
L249:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D49(%rip),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    -0x4c(%rbp),%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <abyx@plt>
L136:
  addl   $0x1,-0x40(%rbp)
L333:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L124
  mov    -0x68(%rbp),%rdi
  mov    -0x28(%rbp),%rsi
  mov    -0x60(%rbp),%rcx
  mov    -0x4c(%rbp),%edx
  mov    -0x30(%rbp),%rax
  push   -0x20(%rbp)
  push   -0x70(%rbp)
  mov    %rdi,%r9
  mov    %rsi,%r8
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <eigen@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  je     L225
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <error2@plt>
L225:
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0x70(%rbp),%rcx
  mov    -0x68(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <xtoy@plt>
  mov    -0x28(%rbp),%rcx
  mov    -0x4c(%rbp),%edx
  mov    -0x4c(%rbp),%esi
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <matinv@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L190
L29:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jb     L200
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x40(%rbp),%edx
  add    $0x1,%edx
  movq   %rax,%xmm0
  mov    %edx,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L200:
  pxor   %xmm0,%xmm0
  comisd -0x58(%rbp),%xmm0
  jb     L100
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  jmp    L19
L100:
  movsd  D84(%rip),%xmm0
  divsd  -0x58(%rbp),%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x60(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  mov    $0x1,%edx
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movq   %xmm0,%rax
L19:
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x60(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x40(%rbp)
L190:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L29
  movl   $0x0,-0x40(%rbp)
  jmp    L140
L222:
  movl   $0x0,-0x3c(%rbp)
  jmp    L76
L202:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x3c(%rbp)
L76:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L202
  addl   $0x1,-0x40(%rbp)
L140:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L222
  mov    -0x4c(%rbp),%r8d
  mov    -0x4c(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x30(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matby@plt>
  movl   $0x0,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L141
L30:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x38(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x40(%rbp)
L141:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L30
  pxor   %xmm0,%xmm0
  comisd -0x38(%rbp),%xmm0
  jb     L349
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L349:
  movl   $0x0,-0x40(%rbp)
  jmp    L145
L240:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x40(%rbp)
L145:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L240
  movl   $0x0,-0x40(%rbp)
  jmp    L62
L94:
  movl   $0x0,-0x3c(%rbp)
  jmp    L170
L356:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L241
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L230
  pxor   %xmm0,%xmm0
  jmp    L363
L230:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L363:
  mov    -0x40(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  %xmm0,(%rax)
L241:
  addl   $0x1,-0x3c(%rbp)
L170:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L356
  addl   $0x1,-0x40(%rbp)
L62:
  mov    -0x40(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L94
  movsd  -0x38(%rbp),%xmm0
L92:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D62
datatype: byte[8]
name: extract_symbolic_data
arguments: data_tag: D72
datatype: byte[8]
name: extract_symbolic_data
arguments: data_tag: D49
datatype: f64
name: extract_symbolic_data
arguments: data_tag: D5
datatype: string
name: extract_symbolic_data
arguments: data_tag: D27
datatype: string
name: extract_symbolic_data
arguments: data_tag: D84
datatype: byte[8]
name: extract_symbolic_data
arguments: data_tag: D18
datatype: string

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

tool: {"D72": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D49: 1

tool: D5: eigen jgl

tool: D27:   Root %d:%10.4f

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

tool: D18: 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);
}
```