user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_tram_discrete_log_likelihood_lower_bound>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8d,-0x64(%rbp)
  mov    %r9d,-0x68(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L25
L144:
  mov    -0x34(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  lea    (%rcx,%rax,1),%rdi
  mov    -0x8(%rbp),%rcx
  mov    -0x68(%rbp),%eax
  mov    %rcx,%r9
  mov    0x10(%rbp),%r8
  mov    %eax,%ecx
  call   <_tram_estimate_transition_matrix@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L67
L5:
  movl   $0x0,-0x2c(%rbp)
  jmp    L34
L40:
  mov    -0x30(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L114
  mov    -0x30(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jne    L46
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x1c(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,-0x70(%rbp)
  mov    -0x30(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x70(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L146
L46:
  mov    -0x30(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  imul   -0x1c(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L146
L114:
  nop
L146:
  addl   $0x1,-0x2c(%rbp)
L34:
  mov    -0x2c(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  jl     L40
  addl   $0x1,-0x30(%rbp)
L67:
  mov    -0x30(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  jl     L5
  addl   $0x1,-0x34(%rbp)
L25:
  mov    -0x34(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L144
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L22
L81:
  mov    -0x34(%rbp),%eax
  imul   -0x68(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L120
L100:
  mov    -0x28(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L47
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L47:
  addl   $0x1,-0x30(%rbp)
L120:
  mov    -0x30(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  jl     L100
  addl   $0x1,-0x34(%rbp)
L22:
  mov    -0x34(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L81
  movsd  -0x18(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double _tram_discrete_log_likelihood_lower_bound(double *log_lagrangian_mult, double *biased_conf_energies, int *count_matrices, int *state_counts, int n_therm_states, int n_conf_states, double *scratch_M, double *scratch_MM) {
  double a, b;
  int K, i, j;
  int KM, KMM, Ki;
  int CKij;
  double *T_ij;
  a = 0;
  T_ij = scratch_MM;
  for (K = 0; K < n_therm_states; ++K) {
    KM = K * n_conf_states;
    KMM = KM * n_conf_states;
    _tram_estimate_transition_matrix(&log_lagrangian_mult[KM], &biased_conf_energies[KM], &count_matrices[KMM], n_conf_states, scratch_M, T_ij);
    for (i = 0; i < n_conf_states; ++i) {
      for (j = 0; j < n_conf_states; ++j) {
        CKij = count_matrices[KMM + i * n_conf_states + j];
        if (0 == CKij)
          continue;
        if (i == j) {
          a += ((double)CKij + 0) * log(T_ij[i * n_conf_states + j]);
        } else {
          a += CKij * log(T_ij[i * n_conf_states + j]);
        }
      }
    }
  }
  b = 0;
  for (K = 0; K < n_therm_states; ++K) {
    KM = K * n_conf_states;
    for (i = 0; i < n_conf_states; ++i) {
      Ki = KM + i;
      if (state_counts[Ki] > 0)
        b += (state_counts[Ki] + 0) * biased_conf_energies[Ki];
    }
  }
  return a + b;
}
```