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

```asm
<_dtram_estimate_transition_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x28(%rsp)
  mov    %r8d,0x14(%rsp)
  mov    %r9,0x38(%rsp)
  test   %r8d,%r8d
  jle    L151
  movslq %r8d,%rsi
  mov    %rdi,%r13
  mov    %r8d,%eax
  mov    %rcx,0x20(%rsp)
  lea    0x1(%r8),%edi
  shr    %eax
  mov    %rsi,0x18(%rsp)
  xor    %r15d,%r15d
  lea    0x0(,%rsi,8),%rdx
  mov    %edi,0x68(%rsp)
  mov    %r8d,%edi
  sub    $0x1,%eax
  mov    %rdx,0x48(%rsp)
  mov    0xb0(%rsp),%rdx
  and    $0xfffffffe,%edi
  mov    %rax,0x60(%rsp)
  mov    %rdx,0x40(%rsp)
  lea    0x0(,%rsi,4),%rdx
  mov    %rdx,0x58(%rsp)
  mov    %edi,0x6c(%rsp)
  movl   $0x0,0x50(%rsp)
  movl   $0x0,0x54(%rsp)
  nopl   0x0(%rax)
L138:
  mov    0x40(%rsp),%r14
  xor    %r12d,%r12d
  mov    %r13,%rax
  xor    %ebp,%ebp
  mov    %r15d,%r13d
  mov    %r12,%rbx
  mov    %rax,%r12
  mov    %r14,%rdx
  mov    %r15,%r14
  mov    %rdx,%r15
  jmp    L125
  nopl   0x0(%rax)
L148:
  mov    0x28(%rsp),%rax
  movslq %r13d,%r9
  add    (%rax,%r9,4),%r8d
  mov    %r8d,0x10(%rsp)
  je     L85
  mov    0x8(%rsp),%rax
  mov    (%rsp),%rcx
  movsd  (%r12,%r14,8),%xmm1
  movsd  (%r12,%rbx,8),%xmm0
  subsd  (%rax,%rbx,8),%xmm1
  subsd  (%rax,%r14,8),%xmm0
  subsd  (%rcx,%rbx,8),%xmm1
  subsd  (%rcx,%r14,8),%xmm0
  call   <_logsumexp_pair@plt>
  mov    0x10(%rsp),%r8d
  movsd  %xmm0,0x30(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r8d,%xmm0
  call   <log@plt>
  mov    0x8(%rsp),%rax
  mov    (%rsp),%rcx
  movslq %ebp,%r8
  add    $0x1,%ebp
  subsd  (%rax,%rbx,8),%xmm0
  subsd  (%rcx,%rbx,8),%xmm0
  subsd  0x30(%rsp),%xmm0
  mov    0x38(%rsp),%rax
  movsd  %xmm0,(%rax,%r8,8)
  call   <exp@plt>
  movsd  %xmm0,(%r15)
L85:
  add    $0x1,%rbx
  add    $0x8,%r15
  add    0x14(%rsp),%r13d
  cmp    0x18(%rsp),%rbx
  je     L157
L125:
  mov    0x20(%rsp),%rax
  movq   $0x0,(%r15)
  mov    (%rax,%rbx,4),%r8d
  cmp    %r14d,%ebx
  jne    L148
  mov    D39(%rip),%rax
  movq   %rax,%xmm0
  test   %r8d,%r8d
  jne    L96
L124:
  mov    0x38(%rsp),%rax
  movslq %ebp,%r8
  add    $0x1,%ebp
  lea    (%rax,%r8,8),%r8
  movsd  %xmm0,(%r8)
  subsd  (%r12,%r14,8),%xmm0
  movsd  %xmm0,(%r8)
  call   <exp@plt>
  movsd  %xmm0,(%r15)
  jmp    L85
  nopl   (%rax)
L157:
  mov    0x38(%rsp),%rdi
  mov    %ebp,%esi
  mov    %r14,%r15
  mov    %r12,%r13
  call   <_logsumexp_sort_kahan_inplace@plt>
  call   <exp@plt>
  pxor   %xmm4,%xmm4
  ucomisd %xmm4,%xmm0
  jp     L183
  je     L61
L183:
  ucomisd D7(%rip),%xmm0
  jp     L67
  jne    L67
L39:
  mov    0x48(%rsp),%rdi
  mov    0x68(%rsp),%edx
  add    $0x1,%r15
  add    %rdi,0x40(%rsp)
  mov    0x58(%rsp),%rsi
  mov    0x14(%rsp),%edi
  add    %edx,0x54(%rsp)
  add    %edi,0x50(%rsp)
  add    %rsi,0x20(%rsp)
  cmp    0x18(%rsp),%r15
  jne    L138
L151:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L96:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r8d,%xmm0
  addsd  D19(%rip),%xmm0
  call   <log@plt>
  jmp    L124
  nopl   0x0(%rax,%rax,1)
L61:
  mov    0x40(%rsp),%rdi
  mov    0x48(%rsp),%rdx
  xor    %esi,%esi
  call   <memset@plt>
  movslq 0x54(%rsp),%rax
  mov    0xb0(%rsp),%rsi
  mov    D7(%rip),%rdi
  mov    %rdi,(%rsi,%rax,8)
  jmp    L39
  cs nopw 0x0(%rax,%rax,1)
L67:
  cmpl   $0x1,0x14(%rsp)
  je     L109
  mov    0x60(%rsp),%rax
  movapd %xmm0,%xmm2
  unpcklpd %xmm2,%xmm2
  lea    0x1(%rax),%rdx
  mov    0x40(%rsp),%rax
  shl    $0x4,%rdx
  add    %rax,%rdx
  nopl   0x0(%rax)
L20:
  movupd (%rax),%xmm1
  add    $0x10,%rax
  divpd  %xmm2,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L20
  mov    0x6c(%rsp),%eax
  mov    0x14(%rsp),%edi
  cmp    %edi,%eax
  je     L39
L33:
  mov    0xb0(%rsp),%rsi
  add    0x50(%rsp),%eax
  cltq
  lea    (%rsi,%rax,8),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  jmp    L39
L109:
  xor    %eax,%eax
  jmp    L33
```

tool_calls: name: unpack_data
arguments: data_tag: D39
data_type: byte[8]
name: unpack_data
arguments: data_tag: D7
data_type: f64
name: unpack_data
arguments: data_tag: D19
data_type: byte[8]

tool: {"D39": [0x5b,0xaa,0xa2,0x2a,0x9e,0x06,0x37,0xc0]}

tool: D7: 1

tool: {"D19": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

assistant: ```c
extern void _dtram_estimate_transition_matrix(double *log_lagrangian_mult, double *bias_energies, double *conf_energies, int *count_matrix, int n_conf_states, double *scratch_M, double *transition_matrix) {
  int i, j, o;
  int ij, ji;
  int C;
  double divisor, sum;
  for (i = 0; i < n_conf_states; ++i) {
    o = 0;
    for (j = 0; j < n_conf_states; ++j) {
      ij = i * n_conf_states + j;
      transition_matrix[ij] = 0.0;
      if (i == j) {
        scratch_M[o] = (0 == count_matrix[ij]) ? -23.025850929940457 : log(1.0E-10 + (double)count_matrix[ij]);
        scratch_M[o] -= log_lagrangian_mult[i];
        transition_matrix[ij] = exp(scratch_M[o++]);
        continue;
      }
      ji = j * n_conf_states + i;
      C = count_matrix[ij] + count_matrix[ji];
      if (0 == C)
        continue;
      divisor = _logsumexp_pair(log_lagrangian_mult[j] - conf_energies[i] - bias_energies[i], log_lagrangian_mult[i] - conf_energies[j] - bias_energies[j]);
      scratch_M[o] = log((double)C) - conf_energies[j] - bias_energies[j] - divisor;
      transition_matrix[ij] = exp(scratch_M[o++]);
    }
    sum = exp(_logsumexp_sort_kahan_inplace(scratch_M, o));
    if (0.0 == sum) {
      for (j = 0; j < n_conf_states; ++j)
        transition_matrix[i * n_conf_states + j] = 0.0;
      transition_matrix[i * n_conf_states + i] = 1.0;
    } else if (1.0 != sum) {
      for (j = 0; j < n_conf_states; ++j)
        transition_matrix[i * n_conf_states + j] /= sum;
    }
  }
}
```