user: What would the C source look like for the assembly code provided here:

```asm
<nj_sum_of_branch_lengths>:
  endbr64
  push   %r15
  movslq %ecx,%rcx
  movd   %edx,%xmm0
  mov    %edx,%r15d
  push   %r14
  movd   %ecx,%xmm4
  mov    %r8d,%r14d
  push   %r13
  punpckldq %xmm4,%xmm0
  mov    %rcx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x58,%rsp
  movsd  D44(%rip),%xmm3
  mov    0x90(%rsp),%rax
  mov    %r9,0x10(%rsp)
  xor    %r9d,%r9d
  mov    %rax,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movslq %edx,%rax
  movq   %xmm0,0x28(%rsp)
  mov    (%rdi,%rax,8),%rax
  mulsd  (%rax,%rcx,8),%xmm3
  movsd  %xmm3,0x8(%rsp)
  nopl   (%rax)
L80:
  movslq %r9d,%rdx
  movq   $0x0,0x30(%rsp,%rdx,8)
  test   %r14d,%r14d
  jle    L35
  movslq %r14d,%rbp
  xor    %eax,%eax
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L145:
  mov    (%rbx,%rax,4),%r10d
  test   %r10d,%r10d
  je     L20
  cmp    %eax,%r15d
  je     L20
  cmp    %eax,%r13d
  je     L20
  movslq 0x28(%rsp,%rdx,4),%rsi
  add    $0x1,%ecx
  mov    (%r12,%rsi,8),%rsi
  movsd  (%rsi,%rax,8),%xmm0
  addsd  0x30(%rsp,%rdx,8),%xmm0
  movsd  %xmm0,0x30(%rsp,%rdx,8)
L20:
  add    $0x1,%rax
  cmp    %rax,%rbp
  jne    L145
  test   %ecx,%ecx
  je     L179
  mov    %r9d,%ebp
  mov    %r14d,%eax
  add    $0x1,%r9d
L225:
  pxor   %xmm1,%xmm1
  movslq %ebp,%rdx
  cvtsi2sd %ecx,%xmm1
  movsd  0x30(%rsp,%rdx,8),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x30(%rsp,%rdx,8)
  cmp    $0x1,%r9d
  je     L80
  movsd  0x30(%rsp),%xmm2
  mov    0x10(%rsp),%rdi
  movsd  0x38(%rsp),%xmm0
  movsd  %xmm2,(%rdi)
  movapd %xmm2,%xmm1
  mov    0x18(%rsp),%rdi
  addsd  %xmm0,%xmm1
  mulsd  D44(%rip),%xmm1
  addsd  0x8(%rsp),%xmm1
  movsd  %xmm0,(%rdi)
  test   %r14d,%r14d
  jle    L102
  mov    $0x1,%ecx
  xor    %esi,%esi
  pxor   %xmm0,%xmm0
  mov    -0x4(%rbx,%rcx,4),%edi
  test   %edi,%edi
  je     L61
  nopl   0x0(%rax,%rax,1)
L162:
  lea    -0x1(%rcx),%edx
  cmp    %r15d,%edx
  je     L61
  cmp    %eax,%r13d
  je     L61
  cmp    %ecx,%r14d
  jle    L173
  mov    %rcx,%rax
  nopl   (%rax)
L24:
  mov    (%rbx,%rax,4),%edx
  test   %edx,%edx
  je     L148
  cmp    %eax,%r15d
  je     L148
  cmp    %eax,%r13d
  je     L148
  mov    -0x8(%r12,%rcx,8),%rdx
  add    $0x1,%esi
  addsd  (%rdx,%rax,8),%xmm0
L148:
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L24
  mov    %r14d,%eax
L199:
  add    $0x1,%rcx
  mov    -0x4(%rbx,%rcx,4),%edi
  test   %edi,%edi
  jne    L162
L61:
  cmp    %ecx,%r14d
  jg     L199
L173:
  pxor   %xmm2,%xmm2
  cvtsi2sd %esi,%xmm2
L205:
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L165
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L179:
  mov    %r13d,%edx
  mov    %r15d,%esi
  lea    D56(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D3(%rip),%rdi
  call   <puts@plt>
  xor    %edx,%edx
  mov    %r12,(%rsp)
  mov    %rbx,%r12
  mov    %rbp,%rbx
  mov    %rdx,%rbp
  nopl   (%rax)
L14:
  mov    (%r12,%rbp,4),%r8d
  mov    %ebp,%esi
  test   %r8d,%r8d
  je     L221
  lea    D38(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L221:
  add    $0x1,%rbp
  cmp    %rbp,%rbx
  jne    L14
  mov    %r12,%rbx
  mov    (%rsp),%r12
  lea    0x1(%r14),%r9d
  mov    %r14d,%ebp
L210:
  mov    $0xa,%edi
  mov    %r9d,(%rsp)
  call   <putchar@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    (%rsp),%r9d
  mov    %ebp,%eax
  xor    %ecx,%ecx
  jmp    L225
  nopl   (%rax)
L35:
  mov    %r13d,%edx
  mov    %r15d,%esi
  lea    D56(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D3(%rip),%rdi
  xor    %ebp,%ebp
  call   <puts@plt>
  mov    $0x1,%r9d
  jmp    L210
L102:
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm0
  jmp    L205
L165:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D44
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D56
type_guessed: string
name: disassemble_data
arguments: tag: D3
type_guessed: string
name: disassemble_data
arguments: tag: D38
type_guessed: string

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

tool: D56: ** %d %d 


tool: D3: available:  

tool: D38: %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;
}
```