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

```asm
<array_stats>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    D22(%rip),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x40(%rbp)
  mov    D19(%rip),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x3c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    D22(%rip),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x38(%rbp)
  mov    D19(%rip),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x34(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L30
L14:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x30(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  movss  -0x38(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L41
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x38(%rbp)
L41:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  comiss -0x34(%rbp),%xmm0
  jbe    L18
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x34(%rbp)
L18:
  addl   $0x1,-0x44(%rbp)
L30:
  mov    -0x44(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L14
  movsd  -0x20(%rbp),%xmm0
  addsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm0
  addsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movss  -0x40(%rbp),%xmm0
  comiss -0x38(%rbp),%xmm0
  jbe    L36
  movss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x40(%rbp)
L36:
  movss  -0x34(%rbp),%xmm0
  comiss -0x3c(%rbp),%xmm0
  jbe    L22
  movss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x3c(%rbp)
L22:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x5c(%rbp),%xmm1
  movsd  -0x20(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  addsd  -0x10(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x78(%rbp),%rax
  movss  %xmm0,(%rax)
  movsd  -0x20(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x5c(%rbp),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x5c(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  mov    -0x80(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x68(%rbp),%rax
  movss  -0x40(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x70(%rbp),%rax
  movss  -0x3c(%rbp),%xmm0
  movss  %xmm0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void array_stats(float img[], int npx, float *minval, float *maxval, float *mean, float *var) {
  int i;
  double t, s1, s2, y0, ts1, ts2;
  float mini, maxi, tmin, tmax;
  mini = FLT_MAX;
  maxi = FLT_MIN;
  s1 = 0.;
  s2 = 0.;
  y0 = img[0];
#pragma omp parallel private(i, t, ts1, ts2, tmin, tmax)
  {
    tmin = FLT_MAX;
    tmax = FLT_MIN;
    ts1 = 0.;
    ts2 = 0.;
#pragma omp for
    for (i = 0; i < npx; i++) {
      t = img[i] - y0;
      ts1 = ts1 + t;
      ts2 = ts2 + t * t;
      if (img[i] < tmin)
        tmin = img[i];
      if (img[i] > tmax)
        tmax = img[i];
    }
#pragma omp critical
    {
      s1 += ts1;
      s2 += ts2;
      if (tmin < mini)
        mini = tmin;
      if (tmax > maxi)
        maxi = tmax;
    }
  }
  *mean = (float)(s1 / npx + y0);
  *var = (float)((s2 - (s1 * s1 / npx)) / npx);
  *minval = mini;
  *maxval = maxi;
}
```