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

```asm
<fe_Sigma_at>:
  endbr64
  push   %r15
  sub    $0x1,%ecx
  push   %r14
  push   %r13
  push   %r12
  mov    $0x1,%r12d
  push   %rbp
  mov    $0x2,%ebp
  shl    %cl,%r12d
  push   %rbx
  shl    %cl,%ebp
  lea    -0x1(%rbp),%ebx
  sub    $0x58,%rsp
  mov    %ebx,0x3c(%rsp)
  movsd  %xmm0,0x10(%rsp)
  test   %edx,%edx
  jle    L3
  pxor   %xmm7,%xmm7
  lea    -0x1(%rdx),%eax
  mov    %rdi,%r15
  mov    %rsi,%r13
  cvtsi2sd %r12d,%xmm7
  lea    0x8(%rsi,%rax,8),%rax
  mov    %rax,0x40(%rsp)
  lea    -0x1(%r12),%r14d
  movsd  %xmm7,0x48(%rsp)
  nopl   0x0(%rax)
L10:
  movsd  0x48(%rsp),%xmm5
  mulsd  0x0(%r13),%xmm5
  add    $0x8,%r13
  movapd %xmm5,%xmm0
  movsd  %xmm5,0x8(%rsp)
  call   <ceil@plt>
  mov    %r12d,%esi
  mov    %eax,%edi
  call   <mini@plt>
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <maxi@plt>
  movsd  0x8(%rsp),%xmm0
  subsd  D0(%rip),%xmm0
  mov    %eax,%ebp
  call   <ceil@plt>
  mov    %r14d,%esi
  mov    %eax,%edi
  call   <mini@plt>
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <maxi@plt>
  pxor   %xmm0,%xmm0
  movsd  0x8(%rsp),%xmm4
  cvtsi2sd %ebp,%xmm0
  mov    %eax,%ebx
  subsd  %xmm0,%xmm4
  addsd  D5(%rip),%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm4,0x30(%rsp)
  call   <hat@plt>
  call   <sq@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  subsd  %xmm0,%xmm1
  addsd  D0(%rip),%xmm1
  movsd  %xmm3,0x28(%rsp)
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x20(%rsp)
  call   <hat@plt>
  call   <sq@plt>
  movsd  0x10(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm4
  mulsd  %xmm0,%xmm2
  movapd %xmm4,%xmm0
  movsd  %xmm2,0x18(%rsp)
  call   <hat@plt>
  movsd  0x20(%rsp),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm0
  call   <hat@plt>
  mov    0x3c(%rsp),%ecx
  lea    -0x1(%rbp),%eax
  movsd  0x28(%rsp),%xmm3
  movsd  0x18(%rsp),%xmm2
  mulsd  0x8(%rsp),%xmm0
  imul   %ecx,%eax
  mulsd  0x10(%rsp),%xmm0
  lea    (%rax,%rbp,1),%esi
  add    %ebx,%eax
  add    %esi,%esi
  add    %eax,%eax
  movslq %esi,%rsi
  cltq
  lea    -0x10(%r15,%rsi,8),%rsi
  addsd  (%rsi),%xmm3
  movsd  %xmm3,(%rsi)
  lea    (%rbx,%rbx,1),%esi
  lea    -0x1(%rsi),%edi
  imul   %ecx,%edi
  add    %edi,%esi
  lea    (%rdi,%rbp,2),%edx
  movslq %esi,%rsi
  movslq %edx,%rdx
  lea    -0x8(%r15,%rsi,8),%rsi
  lea    -0x10(%r15,%rdx,8),%rdx
  addsd  (%rsi),%xmm2
  movsd  %xmm2,(%rsi)
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  %xmm0,-0x8(%r15,%rax,8)
  cmp    %r13,0x40(%rsp)
  jne    L10
L3:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: tag: D0
datatype: f64
name: unpack_data
arguments: tag: D5
datatype: byte[8]

tool: D0: 0.5

tool: {"D5": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void fe_Sigma_at(double *S, double *y, int N, double dt, int L) {
  int n = 1 << (L - 1);
  int d = 2 * n - 1;
  int t;
  int i, j;
  double yn;
  double a, b, c;
  for (t = 0; t < N; t++) {
    yn = y[t] * (double)n;
    i = maxi(mini(((int)ceil(yn)), n), 1);
    j = maxi(mini(((int)ceil(yn - 0.5)), n - 1), 1);
    a = sq(hat(yn - i + 1)) * dt;
    b = sq(hat(yn - j + 0.5)) * dt;
    c = hat(yn - i + 1) * hat(yn - j + 0.5) * dt;
    S[(2 * i - 2) * d + 2 * i - 2] += a;
    S[(2 * j - 1) * d + 2 * j - 1] += b;
    S[(2 * i - 2) * d + 2 * j - 1] = S[(2 * j - 1) * d + 2 * i - 2] += c;
  }
}
```