user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ref_calc_coeffs>:
  endbr64
  push   %r14
  mov    %rsi,%rax
  mov    %rcx,%r14
  push   %r13
  sub    %rdx,%rax
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x40,%rsp
  cmp    %rcx,%rax
  fldt   0x70(%rsp)
  setg   %dil
  fstpt  0x20(%rsp)
  call   <assert@plt>
  mov    %r12,(%rsp)
  fildll (%rsp)
  fmuls  0xe7b(%rip)        # 2000 <_fini+0xd00>
  test   %r12,%r12
  jle    L28
  mov    %r12,%rax
  sar    %rax
  mov    %rax,0x38(%rsp)
  test   %rbx,%rbx
  jle    L17
  cmp    %rbx,%r12
  fldz
  mov    %rbx,%rdx
  cmovle %r12,%rdx
  xor    %ebx,%ebx
L91:
  mov    %rbx,%rax
  add    $0x1,%rbx
  shl    $0x4,%rax
  fstpt  0x0(%rbp,%rax,1)
  fldt   0x0(%rbp,%rax,1)
  cmp    %rdx,%rbx
  jl     L91
  cmp    %rbx,%r12
  jle    L99
L29:
  mov    %r12,%r13
  fld    %st(0)
  sub    %r14,%r13
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L93:
  fxch   %st(1)
  fxch   %st(2)
  jmp    L67
  cs nopw 0x0(%rax,%rax,1)
L135:
  fxch   %st(1)
L67:
  cmp    %r13,%rbx
  jge    L78
  fxch   %st(1)
  fstps  0x34(%rsp)
  sub    $0x10,%rsp
  fstpt  0x20(%rsp)
  fildll 0x48(%rsp)
  mov    %rbx,0x10(%rsp)
  fld1
  fldt   0x30(%rsp)
  fsubrp %st,%st(1)
  fsubp  %st,%st(1)
  fildll 0x10(%rsp)
  faddp  %st,%st(1)
  fabs
  fdiv   %st(1),%st
  fxch   %st(1)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <ref_catrom@plt>
  fldt   0x10(%rsp)
  mov    %rbx,%rax
  add    $0x1,%rbx
  shl    $0x4,%rax
  cmp    %r12,%rbx
  fdivr  %st,%st(1)
  fldt   0x20(%rsp)
  fadd   %st(2),%st
  fxch   %st(2)
  fstpt  0x0(%rbp,%rax,1)
  pop    %rax
  pop    %rdx
  flds   0x34(%rsp)
  jl     L93
  fstp   %st(1)
L85:
  shl    $0x4,%r12
  mov    %rbp,%rax
  add    %rbp,%r12
  nopl   0x0(%rax,%rax,1)
L37:
  fldt   (%rax)
  add    $0x10,%rax
  fdiv   %st(2),%st
  fld    %st(0)
  fstpt  -0x10(%rax)
  faddp  %st,%st(1)
  cmp    %rax,%r12
  jne    L37
  fstp   %st(1)
  fld1
  xor    %edi,%edi
  fsubrp %st,%st(1)
  fabs
  fldt   0xd7c(%rip)        # 2010 <_fini+0xd10>
  fcomip %st(1),%st
  fstp   %st(0)
  seta   %dil
L96:
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <assert@plt>
  nopl   (%rax)
L78:
  fxch   %st(1)
  mov    %rbx,%rax
  add    $0x1,%rbx
  shl    $0x4,%rax
  fstpt  0x0(%rbp,%rax,1)
  fldt   0x0(%rbp,%rax,1)
  cmp    %rbx,%r12
  jg     L135
  fstp   %st(2)
  fxch   %st(1)
  jmp    L85
  nopl   0x0(%rax)
L17:
  xor    %ebx,%ebx
  fldz
  jmp    L29
  nopl   0x0(%rax)
L99:
  fstp   %st(1)
  fld    %st(0)
  jmp    L85
  nopl   0x0(%rax)
L28:
  fstp   %st(0)
  xor    %edi,%edi
  jmp    L96
```

assistant: ```c
void ref_calc_coeffs(long double *coeffs, long double offset, long taps, long ltrim, long rtrim) {
  long i;
  long double tap_offset, tap_mult, fudge, total_check;
  assert(taps - ltrim - rtrim > 0);
  tap_mult = (long double)taps / 4;
  fudge = 0.0;
  for (i = 0; i < taps; i++) {
    if (i < ltrim || i >= taps - rtrim) {
      coeffs[i] = 0;
      continue;
    }
    tap_offset = 1 - offset - taps / 2 + i;
    coeffs[i] = ref_catrom(fabsl(tap_offset) / tap_mult) / tap_mult;
    fudge += coeffs[i];
  }
  total_check = 0.0;
  for (i = 0; i < taps; i++) {
    coeffs[i] /= fudge;
    total_check += coeffs[i];
  }
  assert(fabsl(total_check - 1.0) < 0.0000000001L);
}
```