user: 请从给定的汇编指令推导出C源代码:

```asm
<setresamp>:
  endbr64
  push   %r12
  mov    $0x80,%esi
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x240,%rsp
  lea    0x30(%rsp),%rbp
  movss  %xmm1,0x10(%rsp)
  movss  %xmm0,0xc(%rsp)
  mov    %rbp,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x238(%rsp)
  xor    %eax,%eax
  call   <blackman@plt>
  movss  0x10(%rsp),%xmm1
  pxor   %xmm3,%xmm3
  movsd  D12(%rip),%xmm2
  mulss  D0(%rip),%xmm1
  divss  0xc(%rsp),%xmm1
  cvtss2sd %xmm1,%xmm3
  divsd  %xmm3,%xmm2
  movl   $0x0,0xc(%rsp)
  movsd  %xmm3,0x28(%rsp)
  movsd  %xmm2,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L26:
  pxor   %xmm1,%xmm1
  movss  D17(%rip),%xmm0
  movsd  0x28(%rsp),%xmm6
  cvtsi2ss %r12d,%xmm1
  mulss  0x0(%rbp,%r12,4),%xmm0
  cvtss2sd %xmm1,%xmm1
  subsd  D32(%rip),%xmm1
  cvtss2sd %xmm0,%xmm0
  mulsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm6
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm6,%xmm0
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm1
  cvtsi2sd %eax,%xmm0
  mulsd  D12(%rip),%xmm1
  mulsd  0x10(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  addsd  D76(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  mov    %ax,(%rbx,%r12,2)
  cwtl
  add    $0x1,%r12
  cvtsi2ss %eax,%xmm0
  addss  0xc(%rsp),%xmm0
  movss  %xmm0,0xc(%rsp)
  cmp    $0x40,%r12
  jne    L26
  addss  %xmm0,%xmm0
  movss  D87(%rip),%xmm4
  movss  D72(%rip),%xmm2
  mulss  %xmm4,%xmm0
  comiss %xmm2,%xmm0
  jbe    L32
  movsd  D13(%rip),%xmm3
  divss  %xmm0,%xmm2
  lea    0x80(%rbx),%rdx
  pxor   %xmm0,%xmm0
  nopl   (%rax)
L1:
  movswl (%rbx),%eax
  pxor   %xmm1,%xmm1
  add    $0x2,%rbx
  cvtsi2ss %eax,%xmm1
  mulss  %xmm2,%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm3,%xmm1
  cvttsd2si %xmm1,%eax
  pxor   %xmm1,%xmm1
  mov    %ax,-0x2(%rbx)
  cwtl
  cvtsi2ss %eax,%xmm1
  addss  %xmm1,%xmm0
  cmp    %rbx,%rdx
  jne    L1
  addss  %xmm0,%xmm0
  mulss  %xmm4,%xmm0
L32:
  mov    0x238(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x240,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D12
type_infered: byte[8]
name: unpack_data
arguments: data_tag: D0
type_infered: byte[4]
name: unpack_data
arguments: data_tag: D17
type_infered: byte[4]
name: unpack_data
arguments: data_tag: D32
type_infered: f64
name: unpack_data
arguments: data_tag: D76
type_infered: byte[8]
name: unpack_data
arguments: data_tag: D87
type_infered: byte[4]
name: unpack_data
arguments: data_tag: D72
type_infered: byte[4]
name: unpack_data
arguments: data_tag: D13
type_infered: f64

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

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

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

tool: D32: 63.5

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

tool: {"D87": [0x00,0x00,0x80,0x39]}

tool: {"D72": [0x00,0x00,0x80,0x3f]}

tool: D13: 0.499999

assistant: ```c
float setresamp(short *resampcoeffs, float freq_in, float BW) {
  int pi = 3.14159265359;
  int length = 128;
  float window[128];
  float resampgain;
  float gaintemp;
  double wp, ws, wc;
  int n;
  blackman(window, length);
  wc = pi * (float)BW / (float)freq_in;
  resampgain = 0;
  for (n = 0; n < 64; n++) {
    resampcoeffs[n] = (short)(2047 * window[n] * (pi / wc) * sin(wc * ((float)n - 63.5)) / (pi * ((float)n - 63.5)) + .49999);
    resampgain = resampgain + resampcoeffs[n];
  }
  resampgain = 2 * resampgain / 4096;
  if (resampgain > 1) {
    gaintemp = resampgain;
    resampgain = 0;
    for (n = 0; n < 64; n++) {
      resampcoeffs[n] = (short)((1 / gaintemp) * (float)resampcoeffs[n] + 0.499999);
      resampgain = resampgain + resampcoeffs[n];
    }
    resampgain = 2 * resampgain;
    resampgain = resampgain / 4096;
  }
  return resampgain;
}
```