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

```asm
<mgclsp2sp>:
  endbr64
  push   %r15
  movslq %ecx,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x68(%rsp)
  mov    %esi,0x40(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %r8d,0x44(%rsp)
  movsd  %xmm0,0x30(%rsp)
  movsd  %xmm1,0x38(%rsp)
  test   %eax,%eax
  jle    L26
  lea    -0x1(%rax),%edx
  pxor   %xmm0,%xmm0
  mov    %esi,%r12d
  mov    %rax,0x50(%rsp)
  cvtsi2sd %edx,%xmm0
  movsd  D55(%rip),%xmm1
  mov    %esi,%ecx
  xor    %ebp,%ebp
  lea    0x1(%rsi),%edx
  shr    $0x1f,%r12d
  movslq %r8d,%rax
  and    $0x1,%ecx
  mov    %edx,%r14d
  add    %esi,%r12d
  lea    (%rdi,%rax,8),%rax
  mov    %ecx,0x60(%rsp)
  shr    $0x1f,%r14d
  sar    %r12d
  mov    %rax,0x20(%rsp)
  divsd  %xmm0,%xmm1
  add    %edx,%r14d
  lea    -0x1(%rsi),%edx
  mov    %r12d,0x64(%rsp)
  mov    %edx,%r13d
  sar    %r14d
  shr    $0x1f,%r13d
  add    %edx,%r13d
  sar    %r13d
  movsd  %xmm1,0x48(%rsp)
  nopw   0x0(%rax,%rax,1)
L106:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  mulsd  0x48(%rsp),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  0x30(%rsp),%xmm0
  call   <mel_conv@plt>
  mov    0x60(%rsp),%edx
  movsd  %xmm0,0x8(%rsp)
  test   %edx,%edx
  je     L43
  mov    0x40(%rsp),%eax
  mov    0x20(%rsp),%r15
  xor    %r12d,%r12d
  movq   $0x0,0x10(%rsp)
  test   %eax,%eax
  jle    L87
  nopl   0x0(%rax,%rax,1)
L63:
  movsd  0x8(%rsp),%xmm0
  add    $0x1,%r12d
  add    $0x10,%r15
  call   <cos@plt>
  movsd  -0x10(%r15),%xmm0
  mov    %rax,%rbx
  call   <cos@plt>
  mov    %rbx,%rdi
  sub    %rax,%rdi
  call   <log_conv@plt>
  addsd  %xmm0,%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  cmp    %r14d,%r12d
  jl     L63
L87:
  cmpl   $0x2,0x40(%rsp)
  jle    L6
  movq   $0x0,0x18(%rsp)
  mov    0x20(%rsp),%r15
  xor    %r12d,%r12d
  nopl   (%rax)
L37:
  movsd  0x8(%rsp),%xmm0
  add    $0x1,%r12d
  add    $0x10,%r15
  call   <cos@plt>
  movsd  -0x8(%r15),%xmm0
  mov    %rax,%rbx
  call   <cos@plt>
  sub    %rax,%rbx
  mov    %rbx,%rdi
  call   <log_conv@plt>
  addsd  %xmm0,%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  cmp    %r13d,%r12d
  jl     L37
L58:
  movsd  0x8(%rsp),%xmm0
  call   <sin@plt>
  mov    %rax,%rdi
  call   <log_conv@plt>
  movsd  0x18(%rsp),%xmm1
  mov    D30(%rip),%rax
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  movsd  %xmm1,0x18(%rsp)
  call   <log@plt>
  pxor   %xmm2,%xmm2
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm1
  cvtsi2sd %eax,%xmm2
  cvtsi2sdl 0x40(%rsp),%xmm0
  subsd  D14(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rsp)
  movsd  0x10(%rsp),%xmm0
  call   <log_add@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  0x8(%rsp),%xmm1
L0:
  mulsd  D43(%rip),%xmm1
  movsd  D14(%rip),%xmm0
  divsd  0x38(%rsp),%xmm0
  xorpd  D11(%rip),%xmm0
  mov    0x28(%rsp),%rax
  cmpl   $0x1,0x44(%rsp)
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  jne    L30
  mov    0x68(%rsp),%rax
  addsd  (%rax),%xmm0
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax,%rbp,8)
L30:
  add    $0x1,%rbp
  cmp    %rbp,0x50(%rsp)
  jne    L106
L26:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L43:
  cmpl   $0x1,0x40(%rsp)
  jle    L25
  xor    %r12d,%r12d
  mov    %rbp,0x58(%rsp)
  mov    0x20(%rsp),%r15
  movq   $0x0,0x18(%rsp)
  mov    %r12d,%ebp
  mov    0x64(%rsp),%r12d
  movq   $0x0,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L24:
  movsd  0x8(%rsp),%xmm0
  add    $0x1,%ebp
  add    $0x10,%r15
  call   <cos@plt>
  movsd  -0x10(%r15),%xmm0
  mov    %rax,%rbx
  call   <cos@plt>
  sub    %rax,%rbx
  mov    %rbx,%rdi
  call   <log_conv@plt>
  addsd  %xmm0,%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  0x8(%rsp),%xmm0
  call   <cos@plt>
  movsd  -0x8(%r15),%xmm0
  mov    %rax,%rbx
  call   <cos@plt>
  sub    %rax,%rbx
  mov    %rbx,%rdi
  call   <log_conv@plt>
  addsd  %xmm0,%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  cmp    %r12d,%ebp
  jl     L24
  mov    0x58(%rsp),%rbp
L77:
  movsd  D1(%rip),%xmm1
  mulsd  0x8(%rsp),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <cos@plt>
  mov    %rax,%rdi
  call   <log_conv@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm2
  movapd %xmm1,%xmm0
  movsd  %xmm2,0x10(%rsp)
  call   <sin@plt>
  mov    %rax,%rdi
  call   <log_conv@plt>
  movsd  0x18(%rsp),%xmm1
  mov    D30(%rip),%rax
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movq   %rax,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <log@plt>
  movsd  0x10(%rsp),%xmm2
  imul   0x40(%rsp),%eax
  movsd  0x8(%rsp),%xmm1
  movapd %xmm2,%xmm0
  mov    %eax,%ebx
  call   <log_add@plt>
  pxor   %xmm1,%xmm1
  add    %eax,%ebx
  cvtsi2sd %ebx,%xmm1
  jmp    L0
  nopl   0x0(%rax)
L6:
  movq   $0x0,0x18(%rsp)
  jmp    L58
  cs nopw 0x0(%rax,%rax,1)
L25:
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x10(%rsp)
  jmp    L77
```

tool_calls: name: read_data
arguments: label: D55
data_type: f64
name: read_data
arguments: label: D30
data_type: f64
name: read_data
arguments: label: D14
data_type: f64
name: read_data
arguments: label: D43
data_type: f32[2]
name: read_data
arguments: label: D11
data_type: f32[4]
name: read_data
arguments: label: D1
data_type: f64

tool: D55: 3.141592653589793

tool: D30: 2

tool: D14: 1

tool: {"D43": [0.0,-1.75]}

tool: {"D11": [0.0,-0.0,0.0,0.0]}

tool: D1: 0.5

assistant: ```c
void mgclsp2sp(double a, double g, double *lsp, const int m, double *x, const int l, const int gain) {
  int i, p;
  double w, eq1, eq2, ap = 0.0;
  for (p = 0; p < l; p++) {
    eq1 = 0.0;
    eq2 = 0.0;
    w = mel_conv(a, p * (3.1415926535897932384626433832795 / (l - 1)));
    if (m % 2 == 0) {
      for (i = 0; i < m / 2; i++) {
        eq1 += 2.0 * log_conv(cos(w) - cos(lsp[2 * i + gain]));
        eq2 += 2.0 * log_conv(cos(w) - cos(lsp[2 * i + 1 + gain]));
      }
      eq1 += 2.0 * log_conv(cos(w / 2.0));
      eq2 += 2.0 * log_conv(sin(w / 2.0));
      ap = m * log(2.0) + log_add(eq1, eq2);
    } else {
      for (i = 0; i < (m + 1) / 2; i++)
        eq1 += 2.0 * log_conv(cos(w) - cos(lsp[2 * i + gain]));
      for (i = 0; i < (m - 1) / 2; i++)
        eq2 += 2.0 * log_conv(cos(w) - cos(lsp[2 * i + 1 + gain]));
      eq2 += 2.0 * log_conv(sin(w));
      ap = (m - 1.0) * log(2.0) + log_add(eq1, eq2);
    }
    x[p] = -0.5 * ap;
    x[p] *= -(1.0 / g);
    if (gain == 1)
      x[p] += lsp[0];
  }
}
```