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

```asm
<Transpose_SemiNaive_Naive_Pml_Table>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  lea    0x8(,%rsi,8),%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %r12,(%rax)
  cmp    $0x1,%ebx
  jle    L46
  lea    0x8(%rax),%r15
  lea    -0x1(%rbx),%eax
  xor    %r13d,%r13d
  mov    %eax,(%rsp)
  jmp    L6
  nopl   (%rax)
L55:
  add    $0x8,%r15
L6:
  mov    %r13d,%edi
  mov    %ebp,%esi
  add    $0x1,%r13d
  call   <TableSize@plt>
  cltq
  lea    (%r12,%rax,8),%r12
  mov    %r12,(%r15)
  cmp    %r13d,(%rsp)
  jne    L55
L19:
  mov    (%rsp),%edi
  mov    %ebp,%esi
  call   <TableSize@plt>
  mov    0x10(%rsp),%rdi
  movslq %ebx,%rcx
  lea    0x0(,%rcx,8),%rsi
  movslq %eax,%rdx
  mov    -0x8(%rdi,%rsi,1),%rax
  lea    (%rax,%rdx,8),%rax
  mov    %rax,(%rdi,%rcx,8)
  lea    0x1(%rbx),%eax
  cmp    %eax,%ebp
  jle    L122
  mov    %ebp,%edx
  mov    0x10(%rsp),%r9
  mov    %ebp,%edi
  sub    %ebx,%edx
  sub    %ebx,%edi
  imul   %ebp,%edx
  lea    (%rsi,%r9,1),%rax
  mov    %ebp,%esi
  sub    $0x2,%edi
  neg    %esi
  lea    0x1(%rcx,%rdi,1),%rcx
  add    %esi,%esi
  lea    (%r9,%rcx,8),%rdi
  add    %edx,%edx
  movslq %esi,%rsi
  movslq %edx,%rdx
  shl    $0x3,%rsi
  shl    $0x3,%rdx
L155:
  mov    (%rax),%rcx
  add    $0x8,%rax
  add    %rdx,%rcx
  add    %rsi,%rdx
  mov    %rcx,(%rax)
  cmp    %rax,%rdi
  jne    L155
L122:
  test   %ebx,%ebx
  jle    L76
  lea    -0x1(%rbp),%eax
  mov    0x18(%rsp),%r13
  xor    %r15d,%r15d
  mov    %eax,0xc(%rsp)
  mov    0x10(%rsp),%rax
  mov    %rax,%r12
  sub    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L144:
  mov    0x0(%r13,%r12,1),%rdx
  mov    (%r12),%rcx
  mov    %r15d,%esi
  mov    %ebp,%edi
  call   <Transpose_CosPmlTableGen@plt>
  cmp    0xc(%rsp),%r15d
  je     L85
  mov    (%r12),%rdx
  mov    %ebp,%esi
  mov    %r15d,%edi
  mov    %rdx,(%rsp)
  call   <TableSize@plt>
  mov    (%rsp),%rdx
  cltq
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x8(%r12)
L85:
  add    $0x1,%r15d
  add    $0x8,%r12
  cmp    %r15d,%ebx
  jne    L144
L76:
  cmp    %ebx,%ebp
  jle    L21
L152:
  mov    0x10(%rsp),%rcx
  movslq %ebx,%rax
  lea    (%rcx,%rax,8),%r13
  nopl   0x0(%rax,%rax,1)
L73:
  mov    0x0(%r13),%rdx
  mov    %ebx,%esi
  mov    %r14,%rcx
  mov    %ebp,%edi
  add    $0x1,%ebx
  add    $0x8,%r13
  call   <PmlTableGen@plt>
  cmp    %ebx,%ebp
  jne    L73
L21:
  mov    0x10(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L46:
  test   %ebx,%ebx
  jne    L38
  cmp    $0x1,%ebp
  jle    L76
  mov    %ebp,%ecx
  mov    %ebp,%esi
  mov    0x10(%rsp),%rdx
  lea    -0x1(%rbp),%edi
  imul   %ebp,%ecx
  neg    %esi
  add    %esi,%esi
  lea    0x8(%rdx),%rax
  lea    (%rdx,%rdi,8),%rdi
  movslq %esi,%rsi
  add    %ecx,%ecx
  shl    $0x3,%rsi
  movslq %ecx,%rcx
  shl    $0x3,%rcx
  jmp    L31
  cs nopw 0x0(%rax,%rax,1)
L159:
  add    $0x8,%rax
L31:
  add    %rcx,%r12
  add    %rsi,%rcx
  mov    %r12,(%rax)
  cmp    %rdi,%rax
  jne    L159
  jmp    L152
L38:
  lea    -0x1(%rbx),%eax
  mov    %eax,(%rsp)
  jmp    L19
```

assistant: ```c
double **Transpose_SemiNaive_Naive_Pml_Table(double **seminaive_naive_pml_table, int bw, int m, double *resultspace, double *workspace) {
  int i, lastspace;
  double **trans_seminaive_naive_pml_table;
  trans_seminaive_naive_pml_table = (double **)malloc(sizeof(double *) * (bw + 1));
  trans_seminaive_naive_pml_table[0] = resultspace;
  for (i = 1; i < m; i++) {
    trans_seminaive_naive_pml_table[i] = trans_seminaive_naive_pml_table[i - 1] + TableSize(i - 1, bw);
  }
  if (m == 0) {
    lastspace = 0;
    for (i = m + 1; i < bw; i++) {
      trans_seminaive_naive_pml_table[i] = trans_seminaive_naive_pml_table[i - 1] + (2 * bw * (bw - (i - 1)));
    }
  } else {
    lastspace = TableSize(m - 1, bw);
    trans_seminaive_naive_pml_table[m] = trans_seminaive_naive_pml_table[m - 1] + lastspace;
    for (i = m + 1; i < bw; i++) {
      trans_seminaive_naive_pml_table[i] = trans_seminaive_naive_pml_table[i - 1] + (2 * bw * (bw - (i - 1)));
    }
  }
  for (i = 0; i < m; i++) {
    Transpose_CosPmlTableGen(bw, i, seminaive_naive_pml_table[i], trans_seminaive_naive_pml_table[i]);
    if (i != (bw - 1)) {
      trans_seminaive_naive_pml_table[i + 1] = trans_seminaive_naive_pml_table[i] + TableSize(i, bw);
    }
  }
  for (i = m; i < bw; i++) {
    PmlTableGen(bw, i, trans_seminaive_naive_pml_table[i], workspace);
  }
  return trans_seminaive_naive_pml_table;
}
```