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

```asm
<lfr_filter_calculate_s16>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  movsd  %xmm0,-0x88(%rbp)
  movsd  %xmm1,-0x90(%rbp)
  movsd  %xmm2,-0x98(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  jne    L2
  mov    $0x0,%eax
  call   <abort@plt>
L2:
  cmpl   $0x8,-0x7c(%rbp)
  jg     L114
  movsd  D39(%rip),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  jmp    L39
L114:
  movsd  D64(%rip),%xmm0
  movsd  %xmm0,-0x48(%rbp)
L39:
  movsd  -0x90(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x98(%rbp),%rax
  movq   %rax,%xmm0
  call   <bessel_i0@plt>
  movapd %xmm0,%xmm1
  movsd  -0xa0(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x90(%rbp),%xmm1
  movsd  D77(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L101
L77:
  mov    -0x7c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x68(%rbp),%xmm0
  mulsd  -0x88(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L37
L24:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x64(%rbp),%xmm0
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x7c(%rbp),%eax
  sub    $0x2,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D76(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  D18(%rip),%xmm0
  comisd -0x8(%rbp),%xmm0
  jae    L0
  movsd  -0x8(%rbp),%xmm0
  movsd  D11(%rip),%xmm1
  comisd %xmm1,%xmm0
  jb     L88
L0:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  jmp    L35
L88:
  movsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D11(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm3
  mulsd  -0x98(%rbp),%xmm3
  movq   %xmm3,%rax
  movq   %rax,%xmm0
  call   <bessel_i0@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm4
  mulsd  -0x38(%rbp),%xmm4
  movsd  %xmm4,-0xa0(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sinc@plt>
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
L35:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x50(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  addl   $0x1,-0x64(%rbp)
L37:
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L24
  movsd  -0x48(%rbp),%xmm0
  divsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L34
L64:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x68(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  cvttsd2si %xmm0,%edx
  mov    %dx,(%rax)
  addl   $0x1,-0x64(%rbp)
L34:
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L64
  addl   $0x1,-0x68(%rbp)
L101:
  mov    -0x68(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L77
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D39
type_infered: f32[2]
name: unpack_data
arguments: data_tag: D64
type_infered: f32[2]
name: unpack_data
arguments: data_tag: D77
type_infered: byte[8]
name: unpack_data
arguments: data_tag: D76
type_infered: f64
name: unpack_data
arguments: data_tag: D18
type_infered: f32[2]
name: unpack_data
arguments: data_tag: D11
type_infered: f64
name: unpack_data
arguments: data_tag: D37
type_infered: f64

tool: {"D39": [0.0,6.9613037109375]}

tool: {"D64": [0.0,6.999969482421875]}

tool: {"D77": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D76: 2

tool: {"D18": [0.0,-1.875]}

tool: D11: 1

tool: D37: 0.5

assistant: ```c
void lfr_filter_calculate_s16(short *data, int nsamp, int nfilt, double offset, double cutoff, double beta) {
  double x, x0, t, y, z, xscale, yscale, err;
  int i, j;
  double *a, sum, fac, scale;
  a = malloc(nsamp * sizeof(double));
  if (!a)
    abort();
  if (nsamp <= 8)
    scale = 31500;
  else
    scale = 32767;
  yscale = 2.0 * cutoff / bessel_i0(beta);
  xscale = (8.0 * atan(1.0)) * cutoff;
  for (i = 0; i < nfilt; ++i) {
    x0 = (nsamp - 1) / 2 + offset * i;
    sum = 0.0;
    for (j = 0; j < nsamp; ++j) {
      x = j - x0;
      t = x * (2.0 / (nsamp - 2));
      if (t <= -1.0 || t >= 1.0) {
        y = 0.0;
      } else {
        y = yscale * bessel_i0(beta * sqrt(1.0 - t * t)) * sinc(xscale * x);
      }
      a[j] = y;
      sum += y;
    }
    fac = scale / sum;
    err = 0.0;
    for (j = 0; j < nsamp; ++j) {
      y = a[j] * fac + err;
      z = floor(y + 0.5);
      err = z - y;
      data[i * nsamp + j] = (short)z;
    }
  }
  free(a);
}
```