user: 请将以下的汇编代码转换成C语言代码:

```asm
<lc_lin_fir>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  cvtsd2ss %xmm0,%xmm0
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  je     L22
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
L22:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r12d
  movsd  D33(%rip),%xmm2
  movsd  %xmm2,-0x30(%rbp)
  movaps %xmm0,%xmm1
  addss  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  movss  %xmm1,(%rax)
  movsd  D11(%rip),%xmm4
  movsd  %xmm4,-0x38(%rbp)
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    $0x1,%ebx
  jmp    L12
L43:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movq   %rax,%xmm1
  divsd  %xmm0,%xmm1
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  cvtsd2ss %xmm1,%xmm0
  movss  %xmm0,(%rax)
  add    $0x1,%ebx
L12:
  cmp    %r12d,%ebx
  jl     L43
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x30(%rbp),%xmm3
  divsd  %xmm0,%xmm3
  movsd  %xmm3,-0x28(%rbp)
  mov    $0x0,%ebx
  jmp    L11
L8:
  mov    %r12d,%eax
  sub    %ebx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm7
  movss  %xmm7,-0x30(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  D14(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movsd  D14(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D14(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    %r12d,%eax
  sub    %ebx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mulss  -0x30(%rbp),%xmm0
  movss  %xmm0,(%rax)
  add    $0x1,%ebx
L11:
  cmp    %r12d,%ebx
  jl     L8
  mov    $0x1,%eax
  add    $0x30,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D33
data_type: byte[8]
name: read_data
arguments: tag: D11
data_type: byte[8]
name: read_data
arguments: tag: D14
data_type: f64

tool: {"D33": [0x00,0x00,0x00,0x60,0xfb,0x21,0x19,0x40]}

tool: {"D11": [0x00,0x00,0x00,0x60,0xfb,0x21,0x09,0x40]}

tool: D14: 0.5

assistant: ```c
int lc_lin_fir(fc, nf, coef)
register float fc;
float *coef;
int *nf;
{
  register int i, n;
  register double twopi, fn, c;
  if (((*nf % 2) != 1))
    *nf = *nf + 1;
  n = (*nf + 1) / 2;
  twopi = (3.1415926536f) * 2.0;
  coef[0] = (float)(2.0 * fc);
  c = (3.1415926536f);
  fn = twopi * fc;
  for (i = 1; i < n; i++)
    coef[i] = (float)(sin(i * fn) / (c * i));
  fn = twopi / (double)(*nf);
  for (i = 0; i < n; i++)
    coef[n - i - 1] *= (float)((.5 - (.5 * cos(fn * ((double)i + 0.5)))));
  return (1);
}
```