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

```asm
<moment>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x8(%rbp)
  cmpl   $0x1,-0x1c(%rbp)
  jg     L60
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L60:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  movl   $0x1,-0x10(%rbp)
  jmp    L16
L56:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0xc(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  addl   $0x1,-0x10(%rbp)
L16:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L56
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x1c(%rbp),%xmm1
  movss  -0xc(%rbp),%xmm0
  divss  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    0x18(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    0x18(%rbp),%rax
  movss  (%rax),%xmm0
  mov    0x10(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    0x10(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  movss  %xmm0,(%rax)
  movl   $0x1,-0x10(%rbp)
  jmp    L44
L8:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabs@plt>
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  addss  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movss  %xmm0,(%rax)
  movss  -0xc(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  movss  %xmm0,-0x4(%rbp)
  movss  -0x4(%rbp),%xmm1
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  movss  -0x4(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  movss  %xmm0,-0x4(%rbp)
  movss  -0x4(%rbp),%xmm1
  mov    0x10(%rbp),%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  mov    0x10(%rbp),%rax
  movss  %xmm0,(%rax)
  movss  -0x4(%rbp),%xmm0
  mulss  -0xc(%rbp),%xmm0
  movss  %xmm0,-0x4(%rbp)
  movss  -0x4(%rbp),%xmm1
  mov    0x18(%rbp),%rax
  movss  (%rax),%xmm0
  addss  %xmm1,%xmm0
  mov    0x18(%rbp),%rax
  movss  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L44:
  mov    -0x10(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L8
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x1c(%rbp),%xmm1
  divss  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x8(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2ssl -0x1c(%rbp),%xmm3
  movaps %xmm0,%xmm2
  divss  %xmm3,%xmm2
  subss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movd   %xmm0,%eax
  mov    -0x38(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  jp     L9
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  je     L37
L9:
  mov    0x10(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0x1c(%rbp),%xmm2
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm1,%xmm2
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  divss  %xmm1,%xmm0
  mov    0x10(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    0x18(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ssl -0x1c(%rbp),%xmm2
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm1,%xmm2
  mov    -0x40(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  divss  %xmm1,%xmm0
  movss  D22(%rip),%xmm1
  subss  %xmm1,%xmm0
  mov    0x18(%rbp),%rax
  movss  %xmm0,(%rax)
  jmp    L42
L37:
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L42:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D4
type: string
name: read_data
arguments: tag: D22
type: f32
name: read_data
arguments: tag: D17
type: string

tool: D4: n must be at least 2 in moment

tool: D22: 3

tool: D17: No skew/kurtosis when variance = 0 (in moment)

assistant: ```c
void moment(float data[], int n, float *ave, float *adev, float *sdev, float *var, float *skew, float *curt) {
  void nrerror(char error_text[]);
  int j;
  float ep = 0.0, s, p;
  if (n <= 1)
    nrerror("n must be at least 2 in moment");
  s = 0.0;
  for (j = 1; j <= n; j++)
    s += data[j];
  *ave = s / n;
  *adev = (*var) = (*skew) = (*curt) = 0.0;
  for (j = 1; j <= n; j++) {
    *adev += fabs(s = data[j] - (*ave));
    *var += (p = s * s);
    *skew += (p *= s);
    *curt += (p *= s);
  }
  *adev /= n;
  *var = (*var - ep * ep / n) / (n - 1);
  *sdev = sqrt(*var);
  if (*var) {
    *skew /= (n * (*var) * (*sdev));
    *curt = (*curt) / (n * (*var) * (*var)) - 3.0;
  } else
    nrerror("No skew/kurtosis when variance = 0 (in moment)");
}
```