user: Translate the below assembly code into C programming language:

```asm
<_dtram_estimate_transition_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8d,-0x64(%rbp)
  mov    %r9,-0x70(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L143
L117:
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L144
L60:
  mov    -0x38(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jne    L181
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L52
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D29(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  jmp    L2
L52:
  mov    D33(%rip),%rax
L2:
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x70(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x10(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  jmp    L163
L181:
  mov    -0x34(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x60(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L17
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movapd %xmm2,%xmm1
  movq   %rax,%xmm0
  call   <_logsumexp_pair@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x24(%rbp),%xmm3
  movq   %xmm3,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  mov    -0x34(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x58(%rbp),%rdx
  add    %rcx,%rdx
  movsd  (%rdx),%xmm1
  movq   %rax,%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x10(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  jmp    L163
L17:
  nop
L163:
  addl   $0x1,-0x34(%rbp)
L144:
  mov    -0x34(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L60
  mov    -0x30(%rbp),%edx
  mov    -0x70(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <_logsumexp_sort_kahan_inplace@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L51
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jne    L51
  movl   $0x0,-0x34(%rbp)
  jmp    L152
L87:
  mov    -0x38(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
L152:
  mov    -0x34(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L87
  mov    -0x38(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  D48(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L26
L51:
  movsd  D48(%rip),%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L94
  movsd  D48(%rip),%xmm0
  ucomisd -0x20(%rbp),%xmm0
  je     L26
L94:
  movl   $0x0,-0x34(%rbp)
  jmp    L84
L13:
  mov    -0x38(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
L84:
  mov    -0x34(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L13
L26:
  addl   $0x1,-0x38(%rbp)
L143:
  mov    -0x38(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L117
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D29
type: byte[8]
name: read_data
arguments: data_label: D33
type: byte[8]
name: read_data
arguments: data_label: D48
type: f64

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

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

tool: D48: 1

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;
    }
  }
}
```