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

```asm
<ref_calc_coeffs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    -0x60(%rbp),%rax
  sub    -0x68(%rbp),%rax
  sub    -0x70(%rbp),%rax
  test   %rax,%rax
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  fildll -0x60(%rbp)
  fldt   0xe86(%rip)        # 2000 <_fini+0xd28>
  fdivrp %st,%st(1)
  fstpt  -0x20(%rbp)
  fldz
  fstpt  -0x40(%rbp)
  movq   $0x0,-0x48(%rbp)
  jmp    L19
L24:
  mov    -0x48(%rbp),%rax
  cmp    -0x68(%rbp),%rax
  jl     L31
  mov    -0x60(%rbp),%rax
  sub    -0x70(%rbp),%rax
  cmp    %rax,-0x48(%rbp)
  jl     L49
L31:
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldz
  fstpt  (%rax)
  jmp    L5
L49:
  fld1
  fldt   0x10(%rbp)
  fsubrp %st,%st(1)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdx
  shr    $0x3f,%rdx
  add    %rdx,%rax
  sar    %rax
  mov    %rax,-0x78(%rbp)
  fildll -0x78(%rbp)
  fsubrp %st,%st(1)
  fildll -0x48(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
  fldt   -0x10(%rbp)
  fabs
  fldt   -0x20(%rbp)
  fdivrp %st,%st(1)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  call   <ref_catrom@plt>
  add    $0x10,%rsp
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldt   -0x20(%rbp)
  fdivrp %st,%st(1)
  fstpt  (%rax)
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldt   (%rax)
  fldt   -0x40(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x40(%rbp)
L5:
  addq   $0x1,-0x48(%rbp)
L19:
  mov    -0x48(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jl     L24
  fldz
  fstpt  -0x30(%rbp)
  movq   $0x0,-0x48(%rbp)
  jmp    L16
L8:
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldt   (%rax)
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldt   -0x40(%rbp)
  fdivrp %st,%st(1)
  fstpt  (%rax)
  mov    -0x48(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  fldt   (%rax)
  fldt   -0x30(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x30(%rbp)
  addq   $0x1,-0x48(%rbp)
L16:
  mov    -0x48(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jl     L8
  fldt   -0x30(%rbp)
  fld1
  fsubrp %st,%st(1)
  fabs
  fldt   0xd4d(%rip)        # 2010 <_fini+0xd38>
  fcomip %st(1),%st
  fstp   %st(0)
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  nop
  leave
  ret
```

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);
}
```