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

```asm
<calc_prob_dp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    0xb0(%rsp),%rax
  mov    %rdx,0x48(%rsp)
  mov    0xc0(%rsp),%edx
  mov    %ecx,0x54(%rsp)
  mov    %rax,0x68(%rsp)
  mov    0xc8(%rsp),%ecx
  mov    %edx,0x58(%rsp)
  mov    0xb8(%rsp),%eax
  mov    0xd0(%rsp),%rdx
  mov    %rdi,0x40(%rsp)
  mov    %esi,0x50(%rsp)
  mov    %r8d,0x20(%rsp)
  mov    %r9,0x38(%rsp)
  mov    %eax,0x24(%rsp)
  mov    %ecx,0x5c(%rsp)
  mov    %rdx,0x60(%rsp)
  test   %eax,%eax
  je     L54
  js     L7
  movslq 0x50(%rsp),%rax
  pxor   %xmm2,%xmm2
  xor    %ebx,%ebx
  movq   $0x0,0x10(%rsp)
  movsd  %xmm2,0x18(%rsp)
  lea    0x0(,%rax,8),%r14
  nopl   0x0(%rax)
L17:
  mov    0x50(%rsp),%eax
  sub    %ebx,%eax
  mov    %eax,0xc(%rsp)
  mov    0x10(%rsp),%rax
  cmp    %eax,0x24(%rsp)
  jle    L1
  mov    0x38(%rsp),%rcx
  mov    (%rcx,%rax,4),%r13d
  sub    %ebx,%r13d
  lea    0x1(%r13),%eax
  mov    %eax,0xc(%rsp)
L1:
  movslq 0xc(%rsp),%rbp
  mov    0x20(%rsp),%esi
  movslq %ebx,%rbx
  mov    %ebp,%eax
  mov    %esi,%edx
  lea    0x0(,%rbp,8),%r12d
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  sub    %eax,%edx
  add    %esi,%eax
  mov    %eax,0x2c(%rsp)
  lea    0x0(%rbp,%rbp,4),%eax
  lea    0x0(%rbp,%rax,4),%edi
  mov    %edx,0x28(%rsp)
  shl    $0x3,%rbp
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x30(%rsp)
  mov    %rax,%r13
  mov    0x40(%rsp),%rax
  lea    (%rax,%rbx,8),%r15
  mov    $0x15,%ebx
  xchg   %ax,%ax
L22:
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    %r12d,%edx
  add    %rbp,%r13
  call   <memcpy@plt>
  add    %r14,%r15
  sub    $0x1,%ebx
  jne    L22
  push   0x60(%rsp)
  mov    0x64(%rsp),%eax
  push   %rax
  mov    0x68(%rsp),%eax
  push   %rax
  mov    0x44(%rsp),%eax
  push   %rax
  mov    0x40(%rsp),%r15d
  mov    0x2c(%rsp),%ebx
  mov    0x50(%rsp),%rbp
  mov    0x48(%rsp),%r9d
  mov    0x74(%rsp),%ecx
  mov    %r15d,%r8d
  mov    0x68(%rsp),%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <calc_prob_region_dp@plt>
  addsd  0x38(%rsp),%xmm0
  mov    %rbp,%rdi
  movsd  %xmm0,0x38(%rsp)
  add    $0x20,%rsp
  call   <free@plt>
  mov    0x10(%rsp),%rax
  mov    0x68(%rsp),%rcx
  add    (%rcx,%rax,4),%ebx
  mov    0x38(%rsp),%rcx
  add    %ebx,%r15d
  mov    (%rcx,%rax,4),%ecx
  add    $0x1,%rax
  mov    %r15d,0x20(%rsp)
  mov    %rax,0x10(%rsp)
  mov    %ecx,0xc(%rsp)
  lea    0x1(%rcx),%ebx
  cmp    %eax,0x24(%rsp)
  jge    L17
L58:
  movsd  0x18(%rsp),%xmm0
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L54:
  mov    0x50(%rsp),%esi
  mov    0x60(%rsp),%rcx
  mov    0x58(%rsp),%edx
  mov    0x40(%rsp),%rdi
  mov    %rcx,0xc8(%rsp)
  mov    %esi,%eax
  mov    0x5c(%rsp),%ecx
  shr    $0x1f,%eax
  mov    %edx,0xb8(%rsp)
  mov    %ecx,0xc0(%rsp)
  add    %esi,%eax
  mov    0x20(%rsp),%ecx
  sar    %eax
  neg    %eax
  mov    %ecx,%edx
  mov    %ecx,%r8d
  sub    %eax,%edx
  lea    (%rax,%rcx,1),%r9d
  mov    0x54(%rsp),%ecx
  mov    %edx,0xb0(%rsp)
  mov    0x48(%rsp),%rdx
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <calc_prob_region_dp@plt>
L7:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x18(%rsp)
  jmp    L58
```

assistant: ```c
double calc_prob_dp(const double *matrix, int read_length, const char *seq, int seq_length, int pos, int *splice_pos, int *splice_offset, int n_splice, int gap_op, int gap_ex, int *seqnt_map) {
  int start = pos - (read_length / 2);
  int end = pos + (read_length / 2);
  int i, j;
  double probability = 0;
  if (n_splice == 0) {
    probability = calc_prob_region_dp(matrix, read_length, seq, seq_length, pos, start, end, gap_op, gap_ex, seqnt_map);
  } else {
    int r_pos = 0;
    int g_pos = pos;
    for (i = 0; i <= n_splice; i++) {
      int r_len = (i < n_splice) ? splice_pos[i] - r_pos + 1 : read_length - r_pos;
      int n = r_len / 2;
      start = g_pos - n;
      end = g_pos + n;
      double *submatrix = malloc(21 * r_len * sizeof(double));
      for (j = 0; j < 21; j++)
        memcpy(&submatrix[r_len * j], &matrix[read_length * j + r_pos], r_len * sizeof(double));
      probability += calc_prob_region_dp(submatrix, r_len, seq, seq_length, g_pos, start, end, gap_op, gap_ex, seqnt_map);
      free(submatrix);
      submatrix = NULL;
      g_pos += r_len + splice_offset[i];
      r_pos = splice_pos[i] + 1;
    }
  }
  return probability;
}
```