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

```asm
<bgsub_mean_var>:
  endbr64
  mov    %ecx,%eax
  pxor   %xmm0,%xmm0
  movsd  D3(%rip),%xmm4
  movsd  D9(%rip),%xmm3
  imul   %ecx,%eax
  cvtsi2sd %eax,%xmm0
  divsd  %xmm0,%xmm4
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  divsd  %xmm0,%xmm3
  cvtsd2ss %xmm4,%xmm4
  cvtsd2ss %xmm3,%xmm3
  test   %edi,%edi
  jle    L58
  pxor   %xmm1,%xmm1
  mov    %r9,%rax
  lea    0x4(%r8),%r10
  cvtsi2ss %ecx,%xmm1
  lea    0x4(%rdx),%rcx
  sub    %rcx,%rax
  cmp    $0x8,%rax
  seta   %al
  cmp    $0x1,%edi
  setne  %cl
  and    %ecx,%eax
  lea    0xf(%r8),%rcx
  sub    %rdx,%rcx
  cmp    $0x1e,%rcx
  seta   %cl
  and    %ecx,%eax
  mov    %r9,%rcx
  sub    %r10,%rcx
  cmp    $0x8,%rcx
  seta   %cl
  and    %ecx,%eax
  lea    0xf(%rsi),%rcx
  sub    %r8,%rcx
  cmp    $0x1e,%rcx
  seta   %cl
  test   %cl,%al
  je     L6
  lea    0x4(%rsi),%rcx
  mov    %r9,%rax
  sub    %rcx,%rax
  cmp    $0x8,%rax
  jbe    L6
  lea    -0x1(%rdi),%eax
  mov    %edi,%r10d
  cmp    $0x2,%eax
  jbe    L38
  mov    %edi,%ecx
  movaps %xmm3,%xmm7
  movaps %xmm1,%xmm6
  xor    %eax,%eax
  shr    $0x2,%ecx
  movaps %xmm4,%xmm5
  shufps $0x0,%xmm7,%xmm7
  shufps $0x0,%xmm6,%xmm6
  shl    $0x4,%rcx
  shufps $0x0,%xmm5,%xmm5
  xchg   %ax,%ax
L9:
  movups (%rsi,%rax,1),%xmm0
  mulps  %xmm7,%xmm0
  movups %xmm0,(%r8,%rax,1)
  movups (%rdx,%rax,1),%xmm0
  movups (%rsi,%rax,1),%xmm2
  mulps  %xmm6,%xmm0
  mulps  %xmm2,%xmm2
  subps  %xmm2,%xmm0
  mulps  %xmm5,%xmm0
  movups %xmm0,(%r9,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L9
  mov    %edi,%ecx
  and    $0xfffffffc,%ecx
  mov    %ecx,%eax
  cmp    %ecx,%edi
  je     L58
  sub    %ecx,%edi
  mov    %edi,%r10d
  cmp    $0x1,%edi
  je     L90
L71:
  lea    (%rsi,%rcx,4),%rdi
  movaps %xmm3,%xmm2
  movaps %xmm1,%xmm5
  movq   (%rdi),%xmm0
  shufps $0xe0,%xmm2,%xmm2
  shufps $0xe0,%xmm5,%xmm5
  mulps  %xmm2,%xmm0
  movlps %xmm0,(%r8,%rcx,4)
  movq   (%rdx,%rcx,4),%xmm0
  movq   (%rdi),%xmm2
  mulps  %xmm5,%xmm0
  mulps  %xmm2,%xmm2
  subps  %xmm2,%xmm0
  movaps %xmm4,%xmm2
  shufps $0xe0,%xmm2,%xmm2
  mulps  %xmm2,%xmm0
  movlps %xmm0,(%r9,%rcx,4)
  mov    %r10d,%ecx
  and    $0xfffffffe,%ecx
  add    %ecx,%eax
  cmp    %ecx,%r10d
  je     L58
L90:
  cltq
  lea    (%rsi,%rax,4),%rcx
  mulss  (%rcx),%xmm3
  movss  %xmm3,(%r8,%rax,4)
  movss  (%rcx),%xmm0
  mulss  (%rdx,%rax,4),%xmm1
  mulss  %xmm0,%xmm0
  subss  %xmm0,%xmm1
  mulss  %xmm4,%xmm1
  movss  %xmm1,(%r9,%rax,4)
  ret
  nop
L6:
  movslq %edi,%rdi
  xor    %eax,%eax
  nopl   (%rax)
L47:
  movss  (%rsi,%rax,4),%xmm0
  mulss  %xmm3,%xmm0
  movss  %xmm0,(%r8,%rax,4)
  movss  (%rsi,%rax,4),%xmm2
  movss  (%rdx,%rax,4),%xmm0
  mulss  %xmm2,%xmm2
  mulss  %xmm1,%xmm0
  subss  %xmm2,%xmm0
  mulss  %xmm4,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L47
L58:
  ret
L38:
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L71
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type_infered: f64
name: unpack_data
arguments: data_tag: D9
type_infered: f64

tool: D3: 6.25

tool: D9: 1

assistant: ```c
void bgsub_mean_var(int size, float *s, float *ss, int c, float *m, float *v) {
  float inv_c_sqr = 6.25 / (c * c);
  float inv_c = 1. / c;
  int i;
  for (i = 0; i < size; ++i) {
    m[i] = s[i] * inv_c;
    v[i] = (ss[i] * c - s[i] * s[i]) * inv_c_sqr;
  }
}
```