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

```asm
<covariance_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x38(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  movsd  %xmm1,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  movl   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L90
L29:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x24(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jle    L0
  movsd  -0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <_FMUL_@plt>
  movq   %xmm0,%rax
  movsd  -0x48(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  movapd %xmm1,%xmm3
  movapd %xmm0,%xmm2
  movsd  -0x70(%rbp),%xmm1
  movq   %rax,%xmm0
  call   <_FDIV_@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <_FDIV_@plt>
  movq   %xmm0,%rax
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm1
  movsd  -0x8(%rbp),%xmm0
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <_FSUB_@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L52
  movsd  -0x40(%rbp),%xmm0
  ucomisd -0x40(%rbp),%xmm0
  jnp    L27
L52:
  movsd  -0x18(%rbp),%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jnp    L17
  movsd  -0x40(%rbp),%xmm0
  ucomisd -0x40(%rbp),%xmm0
  jnp    L17
  mov    $0x1,%eax
  jmp    L94
L17:
  mov    $0x0,%eax
L94:
  and    $0x1,%eax
  jmp    L138
L27:
  movsd  -0x40(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  je     L20
  movsd  -0x18(%rbp),%xmm0
  comisd -0x40(%rbp),%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  je     L20
  mov    $0x1,%eax
  jmp    L118
L20:
  mov    $0x0,%eax
L118:
  and    $0x1,%eax
L138:
  test   %al,%al
  je     L106
  addl   $0x1,-0x28(%rbp)
  jmp    L106
L0:
  addl   $0x1,-0x28(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
L106:
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x20(%rbp)
L90:
  mov    -0x20(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jl     L29
  mov    -0x28(%rbp),%eax
  leave
  ret
```

assistant: ```c
int covariance_t(long gridsize, double missval1, double missval2, int *nofvals, double *work0, double *work1, double *work2) {
  long i;
  int nvals, nmiss = 0;
  double temp;
  double dnvals;
  double covar;
  for (i = 0; i < gridsize; i++) {
    nvals = nofvals[i];
    dnvals = nvals;
    if (nvals > 0) {
      temp = _FDIV_(_FMUL_(work0[i], work1[i], missval1, missval2), dnvals * dnvals, missval1, missval2);
      covar = _FSUB_(_FDIV_(work2[i], dnvals, missval1, missval2), temp, missval1, missval2);
      if ((((covar) != (covar)) || ((missval1) != (missval1)) ? (((covar) != (covar)) && ((missval1) != (missval1)) ? 1 : 0) : !(covar < missval1 || missval1 < covar)))
        nmiss++;
    } else {
      nmiss++;
      covar = missval1;
    }
    work0[i] = covar;
  }
  return nmiss;
}
```