user: Converte this assembly snippet into its equivalent C code:

```asm
<WSSIMPatch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movss  %xmm0,-0x3c(%rbp)
  movss  %xmm1,-0x40(%rbp)
  movss  %xmm2,-0x44(%rbp)
  movss  %xmm3,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x8(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
  movss  D0(%rip),%xmm0
  movss  %xmm0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L28
L26:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x3c(%rbp),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  subss  -0x40(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x10(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x14(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x14(%rbp)
  addl   $0x1,-0xc(%rbp)
L28:
  mov    -0x4c(%rbp),%eax
  add    %eax,%eax
  lea    0x1(%rax),%edx
  mov    -0x4c(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  imul   %edx,%eax
  mov    -0x4c(%rbp),%edx
  add    %edx,%edx
  add    $0x1,%edx
  imul   %edx,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L26
  movss  -0x10(%rbp),%xmm0
  divss  -0x14(%rbp),%xmm0
  movss  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x10(%rbp),%xmm0
  jbe    L16
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
L16:
  movss  -0x3c(%rbp),%xmm0
  addss  %xmm0,%xmm0
  mulss  -0x40(%rbp),%xmm0
  movaps %xmm0,%xmm1
  addss  -0x4(%rbp),%xmm1
  movss  -0x10(%rbp),%xmm0
  addss  %xmm0,%xmm0
  addss  -0x4(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  movss  -0x3c(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  %xmm0,%xmm1
  movss  -0x40(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  addss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  addss  -0x4(%rbp),%xmm1
  movss  -0x44(%rbp),%xmm0
  addss  -0x48(%rbp),%xmm0
  addss  -0x4(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0x8(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x8(%rbp)
  movss  -0x8(%rbp),%xmm0
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D0
type_infered: f32

tool: D0: 1e-06

assistant: ```c
float WSSIMPatch(float *PatchImg, float *PatchTemplate, float *kernel, float Mean, float TMean, float Var, float TVar, int f) {
  float d, weight, CoC;
  int i;
  weight = 0.0;
  d = 0.0;
  CoC = 0.0;
  float eps = 0.000001;
  for (i = 0; i < (2 * f + 1) * (2 * f + 1) * (2 * f + 1); i++) {
    CoC = CoC + (PatchImg[i] - Mean) * (PatchTemplate[i] - TMean) * kernel[i];
    weight = weight + kernel[i];
  }
  CoC = CoC / weight;
  if (CoC < 0)
    CoC = 0;
  d = (2 * Mean * TMean + eps) * (2 * CoC + eps);
  d = d / ((Mean * Mean + TMean * TMean + eps) * (Var + TVar + eps));
  return d;
}
```