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    L119
  lea    -0x1(%rax),%edx
  pxor   %xmm0,%xmm0
  mov    %esi,%r12d
  mov    %rax,0x50(%rsp)
  cvtsi2sd %edx,%xmm0
  lea    0x1(%rsi),%edx
  shr    $0x1f,%r12d
  movslq %r8d,%rax
  movsd  D44(%rip),%xmm1
  mov    %edx,%r14d
  add    %esi,%r12d
  xor    %ebp,%ebp
  shr    $0x1f,%r14d
  sar    %r12d
  lea    (%rdi,%rax,8),%rax
  add    %edx,%r14d
  lea    -0x1(%rsi),%edx
  and    $0x1,%esi
  mov    %r12d,0x64(%rsp)
  divsd  %xmm0,%xmm1
  mov    %edx,%r13d
  mov    %esi,0x60(%rsp)
  sar    %r14d
  shr    $0x1f,%r13d
  mov    %rax,0x20(%rsp)
  add    %edx,%r13d
  sar    %r13d
  movsd  %xmm1,0x48(%rsp)
  nopl   (%rax)
L38:
  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     L95
  mov    0x40(%rsp),%eax
  mov    0x20(%rsp),%r15
  xor    %r12d,%r12d
  movq   $0x0,0x10(%rsp)
  test   %eax,%eax
  jle    L75
L35:
  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     L35
L75:
  cmpl   $0x2,0x40(%rsp)
  jle    L105
  movq   $0x0,0x18(%rsp)
  mov    0x20(%rsp),%r15
  xor    %r12d,%r12d
  nopl   (%rax)
L87:
  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     L87
L28:
  movsd  0x8(%rsp),%xmm0
  call   <sin@plt>
  mov    %rax,%rdi
  call   <log_conv@plt>
  movsd  0x18(%rsp),%xmm1
  mov    D2(%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  D66(%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
L41:
  mulsd  D69(%rip),%xmm1
  movsd  D66(%rip),%xmm0
  divsd  0x38(%rsp),%xmm0
  xorpd  D29(%rip),%xmm0
  mov    0x28(%rsp),%rax
  cmpl   $0x1,0x44(%rsp)
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  jne    L47
  mov    0x68(%rsp),%rax
  addsd  (%rax),%xmm0
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax,%rbp,8)
L47:
  add    $0x1,%rbp
  cmp    %rbp,0x50(%rsp)
  jne    L38
L119:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L95:
  cmpl   $0x1,0x40(%rsp)
  jle    L129
  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)
L82:
  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     L82
  mov    0x58(%rsp),%rbp
L17:
  movsd  D63(%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    D2(%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    L41
  nopl   0x0(%rax)
L105:
  movq   $0x0,0x18(%rsp)
  jmp    L28
  cs nopw 0x0(%rax,%rax,1)
L129:
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x10(%rsp)
  jmp    L17
```

tool_calls: name: parse_data
arguments: data_label: D44
type: f64
name: parse_data
arguments: data_label: D2
type: f64
name: parse_data
arguments: data_label: D66
type: f64
name: parse_data
arguments: data_label: D69
type: f32[2]
name: parse_data
arguments: data_label: D29
type: f32[4]
name: parse_data
arguments: data_label: D63
type: f64

tool: D44: 3.141592653589793

tool: D2: 2

tool: D66: 1

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

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

tool: D63: 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];
  }
}
```