user: 请从给定的汇编指令推导出C源代码：

```asm
<core_site_likelihood_derivatives>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %rcx,-0x68(%rbp)
  mov    %r8,-0x70(%rbp)
  mov    %r9,-0x78(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    0x28(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x90(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x98(%rbp),%rax
  lea    0x10(%rax),%rdx
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rax),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x0,-0x50(%rbp)
  jmp    L21
L24:
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L52
L77:
  movsd  -0x20(%rbp),%xmm1
  mov    -0x4c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm1
  mov    -0x4c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm1
  mov    -0x4c(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addq   $0x20,-0x40(%rbp)
  addl   $0x1,-0x4c(%rbp)
L52:
  mov    -0x4c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jb     L77
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L38
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  je     L47
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  jmp    L11
L47:
  pxor   %xmm0,%xmm0
L11:
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L38:
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  -0x20(%rbp),%xmm2
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x98(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  movsd  -0x18(%rbp),%xmm2
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  movsd  -0x10(%rbp),%xmm2
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%eax
  shl    $0x3,%rax
  add    %rax,-0x48(%rbp)
  addl   $0x1,-0x50(%rbp)
L21:
  mov    -0x50(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jb     L24
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L51
  call   <__stack_chk_fail@plt>
L51:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D8
type_infered: f64

tool: D8: 1

assistant: ```c
void core_site_likelihood_derivatives(unsigned int states, unsigned int states_padded, unsigned int rate_cats, const double *rate_weights, const int *invariant, const double *prop_invar, double *const *freqs, const double *sumtable, const double *diagptable, double *site_lk) {
  unsigned int i, j;
  double inv_site_lk = 0.0;
  double cat_sitelk[3];
  const double *sum = sumtable;
  const double *diagp = diagptable;
  const double *t_freqs;
  double t_prop_invar;
  site_lk[0] = site_lk[1] = site_lk[2] = 0;
  for (i = 0; i < rate_cats; ++i) {
    t_freqs = freqs[i];
    cat_sitelk[0] = cat_sitelk[1] = cat_sitelk[2] = 0;
    for (j = 0; j < states; ++j) {
      cat_sitelk[0] += sum[j] * diagp[0];
      cat_sitelk[1] += sum[j] * diagp[1];
      cat_sitelk[2] += sum[j] * diagp[2];
      diagp += 4;
    }
    t_prop_invar = prop_invar[i];
    if (t_prop_invar > 0) {
      inv_site_lk = (invariant[0] == -1) ? 0 : t_freqs[invariant[0]] * t_prop_invar;
      cat_sitelk[0] = cat_sitelk[0] * (1. - t_prop_invar) + inv_site_lk;
      cat_sitelk[1] = cat_sitelk[1] * (1. - t_prop_invar);
      cat_sitelk[2] = cat_sitelk[2] * (1. - t_prop_invar);
    }
    site_lk[0] += cat_sitelk[0] * rate_weights[i];
    site_lk[1] += cat_sitelk[1] * rate_weights[i];
    site_lk[2] += cat_sitelk[2] * rate_weights[i];
    sum += states_padded;
  }
}
```