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

```asm
<setresamp>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x440,%rsp
  mov    %rdi,%rbx
  movss  %xmm0,0xc(%rsp)
  movss  %xmm1,0x10(%rsp)
  movss  %xmm2,0x18(%rsp)
  mov    %esi,%ebp
  mov    %edx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x438(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rdi
  mov    $0x100,%esi
  call   <blackman@plt>
  test   %r12d,%r12d
  je     L6
  movw   $0x400,(%rbx)
  lea    0x2(%rbx),%rax
  lea    0x200(%rbx),%rdx
L5:
  movw   $0x0,(%rax)
  add    $0x2,%rax
  cmp    %rdx,%rax
  jne    L5
  movss  D58(%rip),%xmm0
  jmp    L13
L6:
  movss  D35(%rip),%xmm0
  movss  0x10(%rsp),%xmm1
  mulss  %xmm0,%xmm1
  movss  0xc(%rsp),%xmm2
  divss  %xmm2,%xmm1
  cvtss2sd %xmm1,%xmm1
  mulss  0x18(%rsp),%xmm0
  divss  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x28(%rsp)
  movsd  D33(%rip),%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x20(%rsp)
  movslq %ebp,%rbp
  lea    (%rbx,%rbp,2),%rbp
  mov    $0x0,%ebx
  pxor   %xmm2,%xmm2
  movss  %xmm2,0xc(%rsp)
L3:
  movss  D21(%rip),%xmm0
  mulss  0x30(%rsp,%rbx,4),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2ss %ebx,%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  D37(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  mulsd  0x28(%rsp),%xmm0
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  D33(%rip),%xmm1
  mulsd  0x18(%rsp),%xmm1
  divsd  %xmm1,%xmm0
  addsd  D75(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %ax,0x0(%rbp,%rbx,4)
  cwtl
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  addss  0xc(%rsp),%xmm0
  movss  %xmm0,0xc(%rsp)
  add    $0x1,%rbx
  cmp    $0x80,%rbx
  jne    L3
  addss  %xmm0,%xmm0
  mulss  D9(%rip),%xmm0
L13:
  mov    0x438(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x440,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D58
datatype: f32
name: read_data
arguments: data_label: D35
datatype: byte[4]
name: read_data
arguments: data_label: D33
datatype: byte[8]
name: read_data
arguments: data_label: D21
datatype: byte[4]
name: read_data
arguments: data_label: D37
datatype: f64
name: read_data
arguments: data_label: D75
datatype: byte[8]
name: read_data
arguments: data_label: D9
datatype: byte[4]

tool: D58: 0.3125

tool: {"D35": [0x00,0x00,0x40,0x40]}

tool: {"D33": [0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40]}

tool: {"D21": [0x00,0xe0,0xff,0x44]}

tool: D37: 127.5

tool: {"D75": [0x39,0xee,0x94,0x0e,0xd6,0xff,0xdf,0x3f]}

tool: {"D9": [0x00,0x00,0x00,0x38]}

assistant: ```c
float setresamp(short *resampcoeffs, float freq_in, float Fpass, float Fstop, int filtnum, int bypass) {
  int pi = 3.14159265359;
  int length = 256;
  float window[256];
  float resampgain;
  double wp, ws, wc;
  int n;
  blackman(window, length);
  wp = pi * (float)Fpass / (float)freq_in;
  ws = pi * (float)Fstop / (float)freq_in;
  wc = (wp + ws);
  resampgain = 0;
  if (bypass) {
    resampcoeffs[0] = 1024;
    for (n = 1; n < 256; n++) {
      resampcoeffs[n] = 0;
    }
    resampgain = 0.3125;
  } else {
    for (n = 0; n < 128; n++) {
      resampcoeffs[2 * n + filtnum] = (short)(2047 * window[n] * (pi / wc) * sin(wc * ((float)n - 127.5)) / (pi * ((float)n - 127.5)) + .49999);
      resampgain = resampgain + resampcoeffs[2 * n + filtnum];
    }
    resampgain = 2 * resampgain / 32768;
  }
  return resampgain;
}
```