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

```asm
<nj_sum_of_branch_lengths>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %edx,-0x64(%rbp)
  mov    %ecx,-0x68(%rbp)
  mov    %r8d,-0x6c(%rbp)
  mov    %r9,-0x78(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x68(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  D45(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L174
L259:
  movl   $0x0,-0x3c(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp,%rax,8)
  movl   $0x0,-0x40(%rbp)
  jmp    L190
L22:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L98
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  je     L5
  mov    -0x40(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  je     L5
  mov    -0x44(%rbp),%eax
  cltq
  movsd  -0x20(%rbp,%rax,8),%xmm1
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x28(%rbp,%rax,4),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  movsd  %xmm0,-0x20(%rbp,%rax,8)
  addl   $0x1,-0x3c(%rbp)
  jmp    L285
L98:
  nop
  jmp    L285
L5:
  nop
L285:
  addl   $0x1,-0x40(%rbp)
L190:
  mov    -0x40(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L22
  cmpl   $0x0,-0x3c(%rbp)
  jne    L68
  mov    -0x68(%rbp),%edx
  mov    -0x64(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L57
L12:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L11
  mov    -0x44(%rbp),%eax
  mov    %eax,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L87
L11:
  nop
L87:
  addl   $0x1,-0x44(%rbp)
L57:
  mov    -0x44(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L12
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L68:
  mov    -0x44(%rbp),%eax
  cltq
  movsd  -0x20(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x3c(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  movsd  %xmm0,-0x20(%rbp,%rax,8)
  addl   $0x1,-0x44(%rbp)
L174:
  cmpl   $0x1,-0x44(%rbp)
  jle    L259
  movsd  -0x20(%rbp),%xmm1
  movsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D45(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x20(%rbp),%xmm0
  mov    -0x78(%rbp),%rax
  movsd  %xmm0,(%rax)
  movsd  -0x18(%rbp),%xmm0
  mov    -0x80(%rbp),%rax
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L94
L135:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L34
  mov    -0x44(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  je     L85
  mov    -0x40(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  je     L85
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x40(%rbp)
  jmp    L173
L165:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L217
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  je     L249
  mov    -0x40(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  je     L249
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x3c(%rbp)
  jmp    L125
L217:
  nop
  jmp    L125
L249:
  nop
L125:
  addl   $0x1,-0x40(%rbp)
L173:
  mov    -0x40(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L165
  jmp    L110
L34:
  nop
  jmp    L110
L85:
  nop
L110:
  addl   $0x1,-0x44(%rbp)
L94:
  mov    -0x44(%rbp),%eax
  cmp    -0x6c(%rbp),%eax
  jl     L135
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x3c(%rbp),%xmm1
  movsd  -0x38(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L172
  call   <__stack_chk_fail@plt>
L172:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D45
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D13
type_infered: string
name: extract_symbolic_data
arguments: data_label: D2
type_infered: string
name: extract_symbolic_data
arguments: data_label: D16
type_infered: string

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

tool: D13: ** %d %d 


tool: D2: available:  

tool: D16: %4d

assistant: ```c
double nj_sum_of_branch_lengths(double **dist_table, int *current_list, int node_ctr1, int node_ctr2, int tree_size, double *avg1_ptr, double *avg2_ptr) {
  double sum, term;
  double avg[2];
  int current_pair[2] = {node_ctr1, node_ctr2};
  int ctr1, ctr2, n;
  sum = dist_table[node_ctr1][node_ctr2] / 2;
  for (ctr1 = 0; ctr1 < 2; ctr1++) {
    n = 0;
    avg[ctr1] = 0;
    for (ctr2 = 0; ctr2 < tree_size; ctr2++) {
      if (!current_list[ctr2])
        continue;
      if (ctr2 == node_ctr1 || ctr2 == node_ctr2)
        continue;
      avg[ctr1] += dist_table[current_pair[ctr1]][ctr2];
      n++;
    }
    if (!n) {
      printf("** %d %d \n", node_ctr1, node_ctr2);
      printf("available:  \n");
      for (ctr1 = 0; ctr1 < tree_size; ctr1++) {
        if (!current_list[ctr1])
          continue;
        printf("%4d", ctr1);
      }
      printf("\n");
      exit(1);
    }
    avg[ctr1] /= n;
  }
  sum += (avg[0] + avg[1]) / 2;
  *avg1_ptr = avg[0];
  *avg2_ptr = avg[1];
  term = 0;
  n = 0;
  for (ctr1 = 0; ctr1 < tree_size; ctr1++) {
    if (!current_list[ctr1])
      continue;
    if (ctr1 == node_ctr1 || ctr2 == node_ctr2)
      continue;
    for (ctr2 = ctr1 + 1; ctr2 < tree_size; ctr2++) {
      if (!current_list[ctr2])
        continue;
      if (ctr2 == node_ctr1 || ctr2 == node_ctr2)
        continue;
      term += dist_table[ctr1][ctr2];
      n++;
    }
  }
  sum += term / n;
  return sum;
}
```