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

```asm
<melweights>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r13d
  movss  %xmm0,0x24(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,(%rsp)
  mov    %r8,%r15
  mov    %esi,%eax
  shr    $0x1f,%eax
  lea    (%rax,%rsi,1),%eax
  sar    %eax
  pxor   %xmm6,%xmm6
  cvtsi2ss %eax,%xmm6
  movss  %xmm6,0x8(%rsp)
  movaps %xmm6,%xmm0
  call   <hz2mel@plt>
  movaps %xmm0,%xmm1
  mov    (%r15),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  divss  %xmm0,%xmm1
  movss  %xmm1,0x20(%rsp)
  movslq %r13d,%rax
  mov    %rax,0x28(%rsp)
  lea    0x0(,%r13,4),%edi
  call   <MALLOC@plt>
  mov    %rax,0x10(%rsp)
  test   %r13d,%r13d
  jle    L12
  mov    %rax,%rbp
  mov    $0x0,%ebx
  lea    -0x1(%r13),%eax
  pxor   %xmm7,%xmm7
  cvtsi2ss %eax,%xmm7
  movss  %xmm7,0xc(%rsp)
L18:
  pxor   %xmm0,%xmm0
  cvtsi2ss %ebx,%xmm0
  mulss  0x8(%rsp),%xmm0
  divss  0xc(%rsp),%xmm0
  call   <hz2mel@plt>
  movss  %xmm0,0x0(%rbp)
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,%r13d
  jne    L18
L12:
  cmpl   $0x0,(%r15)
  jle    L38
  lea    -0x1(%r13),%eax
  mov    0x10(%rsp),%rdx
  lea    0x4(%rdx,%rax,4),%r12
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r14d
L81:
  pxor   %xmm0,%xmm0
  cvtsi2ss %r14d,%xmm0
  mulss  0x20(%rsp),%xmm0
  movss  %xmm0,0x8(%rsp)
  test   %r13d,%r13d
  jle    L32
  movslq 0xc(%rsp),%rax
  mov    0x18(%rsp),%rsi
  lea    (%rsi,%rax,4),%rbp
  mov    0x10(%rsp),%rbx
  sub    %rbx,%rbp
L11:
  movss  (%rbx),%xmm0
  subss  0x8(%rsp),%xmm0
  cvttss2si %xmm0,%edi
  movss  D17(%rip),%xmm0
  call   <pow@plt>
  mulsd  D30(%rip),%xmm0
  call   <exp@plt>
  movss  %xmm0,0x0(%rbp,%rbx,1)
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L11
L32:
  add    $0x1,%r14d
  add    %r13d,0xc(%rsp)
  cmp    %r14d,(%r15)
  jg     L81
L38:
  movss  0x24(%rsp),%xmm0
  xorps  D20(%rip),%xmm0
  divss  D16(%rip),%xmm0
  mov    $0xa,%edi
  call   <pow@plt>
  cvtsd2ss %xmm0,%xmm0
  cmpl   $0x0,(%r15)
  jle    L37
  mov    0x28(%rsp),%r8
  shl    $0x2,%r8
  mov    0x18(%rsp),%rdx
  mov    $0x0,%edi
  sub    $0x1,%r13d
L80:
  mov    $0x0,%eax
  mov    %rdx,%rsi
L30:
  mov    %eax,%ecx
  add    $0x1,%rax
  comiss -0x4(%rdx,%rax,4),%xmm0
  ja     L30
  mov    (%rsp),%rax
  mov    %ecx,(%rax,%rdi,8)
  movslq %r13d,%rax
L36:
  mov    %eax,%ecx
  sub    $0x1,%rax
  comiss 0x4(%rsi,%rax,4),%xmm0
  ja     L36
  mov    (%rsp),%rax
  mov    %ecx,0x4(%rax,%rdi,8)
  add    $0x1,%rdi
  add    %r8,%rdx
  cmp    %edi,(%r15)
  jg     L80
L37:
  mov    0x10(%rsp),%rdi
  call   <FREE@plt>
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D17
type: f32
name: extract_symbolic_data
arguments: data_label: D30
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D20
type: byte[16]
name: extract_symbolic_data
arguments: data_label: D16
type: f32

tool: D17: 2

tool: {"D30": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xbf]}

tool: {"D20": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D16: 20

assistant: ```c
void melweights(int nfreqs, int Fs, float dB, float *wts, int *indices, int *nbands) {
  float nyqmel = hz2mel(Fs / 2);
  float step_mels = nyqmel / (*nbands - 1);
  float *binmels = (float *)MALLOC(nfreqs * sizeof(float));
  for (int i = 0; i < nfreqs; i++) {
    binmels[i] = hz2mel(((float)i * (Fs / 2)) / (nfreqs - 1));
  }
  for (int i = 0; i < *nbands; i++) {
    float f_mel_mid = i * step_mels;
    for (int j = 0; j < nfreqs; j++) {
      wts[i * nfreqs + j] = exp(-0.5 * pow(binmels[j] - f_mel_mid, 2));
    }
  }
  float lin = pow(10, -dB / 20);
  for (int i = 0; i < *nbands; i++) {
    int j = 0;
    while (wts[i * nfreqs + (j++)] < lin)
      ;
    indices[i * 2] = j - 1;
    j = nfreqs - 1;
    while (wts[i * nfreqs + (j--)] < lin)
      ;
    indices[i * 2 + 1] = j + 1;
  }
  FREE(binmels);
}
```