user: 请将以下的汇编代码转换成C语言代码:

```asm
<D7Dist_pass>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x168,%rsp
  movsd  D0(%rip),%xmm1
  mov    %rdi,0x20(%rsp)
  lea    0x60(%rsp),%r14
  mov    %rsi,%r15
  mov    %rdi,%rbx
  lea    0x560(%rsp),%r9
  lea    0x160(%rsp),%rcx
  mulsd  %xmm0,%xmm1
  mov    %r14,%rdx
  lea    0xc0(%rsp),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x1158(%rsp)
  xor    %eax,%eax
  lea    0x58(%rsp),%rax
  mov    %r9,0x8(%rsp)
  mov    %rcx,0x18(%rsp)
  movsd  %xmm0,0x30(%rsp)
  push   %rax
  movapd %xmm1,%xmm0
  lea    0x768(%rsp),%rax
  push   %rax
  lea    0x370(%rsp),%r8
  movsd  %xmm1,0x38(%rsp)
  lea    0xa0(%rsp),%r13
  call   <d7bdmaps@plt>
  lea    0x6c(%rsp),%rax
  mov    %r13,%rdx
  mov    %r15,%rdi
  lea    0xd70(%rsp),%r9
  lea    0x970(%rsp),%rcx
  mov    %r9,0x10(%rsp)
  lea    0x120(%rsp),%rsi
  mov    %rcx,0x20(%rsp)
  push   %rax
  lea    0xf78(%rsp),%rax
  push   %rax
  movsd  0x48(%rsp),%xmm1
  movapd %xmm1,%xmm0
  lea    0xb80(%rsp),%r8
  movsd  %xmm1,0x58(%rsp)
  call   <d7bdmaps@plt>
  add    $0x20,%rsp
  mov    %rbx,%rdi
  call   <d7minbddist@plt>
  mov    %r15,%rdi
  movsd  %xmm0,0x28(%rsp)
  call   <d7minbddist@plt>
  movsd  0x28(%rsp),%xmm3
  movsd  0x30(%rsp),%xmm2
  addsd  %xmm0,%xmm3
  movapd %xmm2,%xmm0
  comisd %xmm2,%xmm3
  ja     L224
  movsd  0x38(%rsp),%xmm1
  mov    0x58(%rsp),%eax
  comisd %xmm3,%xmm1
  mov    %eax,%ecx
  jbe    L99
  test   %eax,%eax
  jle    L235
  xor    %ebx,%ebx
  jmp    L326
  nopw   0x0(%rax,%rax,1)
L295:
  add    $0x1,%rbx
  mov    %ecx,%eax
  cmp    %ebx,%ecx
  jle    L187
L326:
  movslq (%r14,%rbx,4),%rax
  lea    -0x6(%rax),%edx
  and    $0xfffffffd,%edx
  je     L295
  cmp    $0x2,%eax
  jle    L295
  movsd  0xc0(%rsp,%rax,8),%xmm3
  comisd %xmm3,%xmm1
  jbe    L295
  lea    0x0(,%rax,8),%rdx
  mov    %r15,%rdi
  movsd  %xmm1,0x38(%rsp)
  sub    %rax,%rdx
  mov    0x8(%rsp),%rax
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm3,0x28(%rsp)
  lea    (%rax,%rdx,8),%rbp
  mov    %rbp,%rsi
  call   <d71234distsq@plt>
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm3
  mov    0x58(%rsp),%ecx
  movsd  0x30(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm1
  addsd  %xmm3,%xmm0
  comisd %xmm2,%xmm0
  ja     L295
  mov    %rbp,%rsi
  mov    %r15,%rdi
  movsd  %xmm1,0x30(%rsp)
  add    $0x1,%rbx
  call   <d71234distsq@plt>
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm3
  mov    0x58(%rsp),%ecx
  movapd %xmm0,%xmm2
  movsd  0x30(%rsp),%xmm1
  addsd  %xmm3,%xmm2
  mov    %ecx,%eax
  cmp    %ebx,%ecx
  jg     L326
  nopl   0x0(%rax,%rax,1)
L187:
  mov    0x5c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L108
L342:
  mov    0x20(%rsp),%rbp
  xor    %ebx,%ebx
  jmp    L146
  nopl   (%rax)
L201:
  add    $0x1,%rbx
  cmp    %ebx,0x5c(%rsp)
  jle    L250
L146:
  movslq 0x0(%r13,%rbx,4),%rax
  lea    -0x6(%rax),%edx
  and    $0xfffffffd,%edx
  je     L201
  cmp    $0x2,%eax
  jle    L201
  movsd  0x110(%rsp,%rax,8),%xmm3
  comisd %xmm3,%xmm1
  jbe    L201
  lea    0x0(,%rax,8),%rdx
  mov    %rbp,%rdi
  movsd  %xmm1,0x38(%rsp)
  sub    %rax,%rdx
  mov    (%rsp),%rax
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm3,0x28(%rsp)
  lea    (%rax,%rdx,8),%r12
  mov    %r12,%rsi
  call   <d71234distsq@plt>
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm3
  movsd  0x30(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm1
  addsd  %xmm3,%xmm0
  comisd %xmm2,%xmm0
  ja     L201
  mov    %r12,%rsi
  mov    %rbp,%rdi
  movsd  %xmm1,0x30(%rsp)
  add    $0x1,%rbx
  call   <d71234distsq@plt>
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm3
  movsd  0x30(%rsp),%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm3,%xmm2
  cmp    %ebx,0x5c(%rsp)
  jg     L146
  nopl   0x0(%rax,%rax,1)
L250:
  movsd  D0(%rip),%xmm1
  mov    0x58(%rsp),%eax
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm1
L99:
  test   %eax,%eax
  jle    L224
  mov    %r15,%rsi
  xor    %ebp,%ebp
  mov    %r14,%r15
  mov    %r13,%r14
  jmp    L62
  nopl   0x0(%rax)
L119:
  add    $0x1,%rbp
  cmp    %ebp,0x58(%rsp)
  jle    L224
L62:
  mov    (%r15,%rbp,4),%r12d
  lea    -0x6(%r12),%eax
  and    $0xfffffffd,%eax
  je     L119
  cmp    $0x2,%r12d
  jle    L119
  movslq %r12d,%rax
  comisd 0xc0(%rsp,%rax,8),%xmm1
  jbe    L119
  mov    0x5c(%rsp),%edx
  test   %edx,%edx
  jle    L119
  lea    0x0(,%rax,8),%r13
  mov    %r12d,0x38(%rsp)
  xor    %ebx,%ebx
  sub    %rax,%r13
  mov    (%rsp),%rax
  mov    %rbp,0x40(%rsp)
  shl    $0x3,%r13
  mov    %r15,0x48(%rsp)
  lea    (%rax,%r13,1),%r9
  mov    0x10(%rsp),%rax
  mov    %r9,%r12
  lea    (%rax,%r13,1),%r8
  mov    0x8(%rsp),%rax
  mov    %r8,%rbp
  add    %r13,%rax
  add    0x18(%rsp),%r13
  mov    %rax,%r15
  jmp    L237
  nopl   0x0(%rax)
L155:
  add    $0x1,%rbx
  cmp    %ebx,0x5c(%rsp)
  jle    L216
L237:
  mov    (%r14,%rbx,4),%ecx
  lea    -0x6(%rcx),%edi
  and    $0xfffffffd,%edi
  je     L155
  cmp    $0x2,%ecx
  jle    L155
  movslq %ecx,%r9
  comisd 0x110(%rsp,%r9,8),%xmm1
  jbe    L155
  movsd  %xmm1,0x30(%rsp)
  mov    %rbp,%r8
  mov    %r13,%rdx
  add    $0x1,%rbx
  lea    0x0(,%r9,8),%rdi
  push   %rcx
  mov    0x10(%rsp),%rax
  sub    %r9,%rdi
  mov    %r12,%r9
  shl    $0x3,%rdi
  lea    (%rax,%rdi,1),%rcx
  push   %rcx
  mov    0x28(%rsp),%rax
  lea    (%rax,%rdi,1),%rcx
  push   %rcx
  mov    0x18(%rsp),%rax
  lea    (%rax,%rdi,1),%rcx
  push   %rcx
  add    0x30(%rsp),%rdi
  mov    %r15,%rcx
  push   %rdi
  mov    0x60(%rsp),%eax
  push   %rax
  mov    0x50(%rsp),%rdi
  mov    %rsi,0x58(%rsp)
  call   <D7Dist_2bds_rev@plt>
  add    $0x30,%rsp
  movsd  0x30(%rsp),%xmm1
  mov    0x28(%rsp),%rsi
  cmp    %ebx,0x5c(%rsp)
  jg     L237
  nopl   (%rax)
L216:
  mov    0x40(%rsp),%rbp
  mov    0x48(%rsp),%r15
  add    $0x1,%rbp
  cmp    %ebp,0x58(%rsp)
  jg     L62
  nopl   0x0(%rax,%rax,1)
L224:
  mov    0x1158(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L297
  add    $0x1168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L235:
  mov    0x5c(%rsp),%eax
  test   %eax,%eax
  jg     L342
  jmp    L224
L108:
  movsd  D0(%rip),%xmm1
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm1
  jmp    L99
L297:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D0
data_type: f64

tool: D0: 0.999995

assistant: ```c
double D7Dist_pass(double gvec1[7], double gvec2[7], double dist) {
  double dists1[9];
  double pgs1[9][7], rgs1[9][7], mpgs1[9][7], mvecs1[9][7];
  double dists2[9];
  double pgs2[9][7], rgs2[9][7], mpgs2[9][7], mvecs2[9][7];
  int iord1[9], iord2[9];
  double mindists1;
  double mindists2;
  int jx1, jx2;
  int j1, j2;
  int ngood1, ngood2;
  double maxdist;
  maxdist = 0.999995 * dist;
  d7bdmaps(gvec1, dists1, iord1, pgs1, rgs1, mpgs1, mvecs1, maxdist, &ngood1);
  d7bdmaps(gvec2, dists2, iord2, pgs2, rgs2, mpgs2, mvecs2, maxdist, &ngood2);
  mindists1 = d7minbddist(gvec1);
  mindists2 = d7minbddist(gvec2);
  if (mindists1 + mindists2 > dist)
    return dist;
  if (mindists1 + mindists2 < maxdist) {
    for (jx1 = 0; jx1 < ngood1; jx1++) {
      double d1;
      j1 = iord1[jx1];
      if (j1 < 3 || j1 == 6 || j1 == 8)
        continue;
      d1 = dists1[j1];
      if (d1 < maxdist) {
        dist = (((dist) < (sqrt(d71234distsq(gvec2, mpgs1[j1])) + d1)) ? (dist) : (sqrt(d71234distsq(gvec2, mpgs1[j1])) + d1));
      }
    }
    for (jx2 = 0; jx2 < ngood2; jx2++) {
      double d2;
      j2 = iord2[jx2];
      if (j2 < 3 || j2 == 6 || j2 == 8)
        continue;
      d2 = dists2[j2];
      if (d2 < maxdist) {
        dist = (((dist) < ((sqrt(d71234distsq(gvec1, mpgs2[j2])) + d2))) ? (dist) : ((sqrt(d71234distsq(gvec1, mpgs2[j2])) + d2)));
      }
    }
  }
  maxdist = 0.999995 * dist;
  for (jx1 = 0; jx1 < ngood1; jx1++) {
    double d1;
    j1 = iord1[jx1];
    if (j1 < 3 || j1 == 6 || j1 == 8)
      continue;
    d1 = dists1[j1];
    if (d1 < maxdist) {
      for (jx2 = 0; jx2 < ngood2; jx2++) {
        double d2;
        j2 = iord2[jx2];
        if (j2 < 3 || j2 == 6 || j2 == 8)
          continue;
        d2 = dists2[j2];
        if (d2 < maxdist) {
          dist = D7Dist_2bds_rev(gvec1, gvec2, pgs1[j1], mpgs1[j1], pgs2[j1], mpgs2[j1], j1, pgs2[j2], mpgs2[j2], pgs1[j2], mpgs1[j2], j2, dist);
        }
      }
    }
  }
  return dist;
}
```