user: What is the c source code of the assembly code below:

```asm
<trapfilter>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x20000(%rsp),%r11
L32:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L32
  sub    $0xb0,%rsp
  mov    %rdi,-0x20088(%rbp)
  mov    %esi,-0x2008c(%rbp)
  mov    %edx,-0x20090(%rbp)
  mov    %ecx,-0x20094(%rbp)
  mov    %r8d,-0x20098(%rbp)
  mov    %r9d,-0x2009c(%rbp)
  movsd  %xmm0,-0x200a8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x2006c(%rbp)
  movl   $0x0,-0x2006c(%rbp)
  jmp    L56
L76:
  mov    -0x2006c(%rbp),%eax
  cltq
  movl   $0x0,-0x20010(%rbp,%rax,4)
  mov    -0x2006c(%rbp),%eax
  cltq
  movl   $0x0,-0x10010(%rbp,%rax,4)
  addl   $0x1,-0x2006c(%rbp)
L56:
  cmpl   $0x3fff,-0x2006c(%rbp)
  jle    L76
  movl   $0x0,-0x20074(%rbp)
  mov    -0x2008c(%rbp),%eax
  mov    %eax,-0x20068(%rbp)
  movl   $0x0,-0x20070(%rbp)
  mov    -0x2008c(%rbp),%edx
  mov    -0x20090(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20064(%rbp)
  mov    -0x2009c(%rbp),%eax
  cmp    -0x20098(%rbp),%eax
  jge    L85
  mov    -0x2009c(%rbp),%eax
  mov    %eax,-0x20098(%rbp)
L85:
  movl   $0x0,-0x20060(%rbp)
  movl   $0x0,-0x2006c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20058(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20050(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20048(%rbp)
  jmp    L36
L2:
  mov    -0x2006c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20088(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    0x10(%rbp),%eax
  mov    0x18(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x2005c(%rbp)
  mov    -0x20074(%rbp),%eax
  cltq
  mov    -0x20010(%rbp,%rax,4),%eax
  cltq
  mov    %rax,-0x20040(%rbp)
  mov    -0x20074(%rbp),%eax
  cltq
  mov    -0x2005c(%rbp),%edx
  mov    %edx,-0x20010(%rbp,%rax,4)
  addl   $0x1,-0x20074(%rbp)
  mov    -0x20074(%rbp),%eax
  cmp    -0x20068(%rbp),%eax
  jl     L81
  movl   $0x0,-0x20074(%rbp)
L81:
  mov    -0x2005c(%rbp),%eax
  cltq
  sub    -0x20040(%rbp),%rax
  mov    %rax,-0x20038(%rbp)
  mov    -0x20070(%rbp),%eax
  cltq
  mov    -0x10010(%rbp,%rax,4),%eax
  cltq
  mov    %rax,-0x20030(%rbp)
  mov    -0x20038(%rbp),%rax
  mov    %eax,%edx
  mov    -0x20070(%rbp),%eax
  cltq
  mov    %edx,-0x10010(%rbp,%rax,4)
  addl   $0x1,-0x20070(%rbp)
  mov    -0x20070(%rbp),%eax
  cmp    -0x20064(%rbp),%eax
  jl     L98
  movl   $0x0,-0x20070(%rbp)
L98:
  mov    -0x20038(%rbp),%rax
  sub    -0x20030(%rbp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x20028(%rbp)
  movsd  -0x20050(%rbp),%xmm0
  addsd  -0x20028(%rbp),%xmm0
  movsd  %xmm0,-0x20050(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x20094(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20028(%rbp),%xmm1
  movsd  -0x20050(%rbp),%xmm0
  mulsd  -0x200a8(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20020(%rbp)
  movsd  -0x20048(%rbp),%xmm0
  addsd  -0x20020(%rbp),%xmm0
  movsd  %xmm0,-0x20048(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x2008c(%rbp),%xmm1
  movsd  -0x20048(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20018(%rbp)
  movsd  -0x20018(%rbp),%xmm0
  comisd -0x20058(%rbp),%xmm0
  jbe    L10
  movsd  -0x20018(%rbp),%xmm0
  movsd  %xmm0,-0x20058(%rbp)
L10:
  mov    -0x2006c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20088(%rbp),%rax
  add    %rax,%rdx
  movsd  -0x20018(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2006c(%rbp)
L36:
  mov    -0x2006c(%rbp),%eax
  cmp    -0x20098(%rbp),%eax
  jl     L2
  movsd  -0x20058(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L34
  call   <__stack_chk_fail@plt>
L34:
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double trapfilter(int *pulse, int peaking, int gap, int M, int len, int len_in, double N, int bl, int pol) {
  int delayk_buffer[16384];
  int delayk_index;
  int shiftk;
  long datak_out;
  int delaym_buffer[16384];
  int delaym_index;
  int shiftm;
  long datam_in;
  long datam_out;
  double slowshaperout;
  int i = 0;
  for (i = 0; i < 16384; i++) {
    delayk_buffer[i] = 0;
    delaym_buffer[i] = 0;
  }
  delayk_index = 0;
  shiftk = peaking;
  delaym_index = 0;
  shiftm = peaking + gap;
  if (len_in < len) {
    len = len_in;
  }
  int n = 0;
  i = 0;
  double max = 0;
  double accum1 = 0;
  double accum2 = 0;
  double adder2out;
  double adder3out;
  int input;
  while (i < len) {
    input = (pulse[i] - bl) * pol;
    datak_out = delayk_buffer[delayk_index];
    delayk_buffer[delayk_index] = input;
    delayk_index++;
    if (delayk_index >= shiftk)
      delayk_index = 0;
    datam_in = input - datak_out;
    datam_out = delaym_buffer[delaym_index];
    delaym_buffer[delaym_index] = datam_in;
    delaym_index++;
    if (delaym_index >= shiftm)
      delaym_index = 0;
    adder2out = datam_in - datam_out;
    accum1 += adder2out;
    adder3out = adder2out * M + accum1 * N;
    accum2 += adder3out;
    slowshaperout = accum2 / (double)peaking;
    if (slowshaperout > max) {
      max = slowshaperout;
    }
    pulse[i] = slowshaperout;
    i++;
  }
  return max;
}
```