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

```asm
<neuralops_batchnorm2d_bwd_input>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x48(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r9,0x20(%rsp)
  mov    0xa8(%rsp),%r12
  mov    0xb0(%rsp),%r13
  movss  %xmm0,0x2c(%rsp)
  test   %rdi,%rdi
  je     L73
  mov    %rsi,%r14
  mov    %rdx,%r15
  mov    %r8,%rbp
  mov    %rsi,%rax
  imul   %rdx,%rax
  imul   %rdi,%rax
  mov    %rax,0x40(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x10(%rsp)
  movq   $0x0,0x38(%rsp)
  mov    $0x0,%ebx
  and    $0x1,%eax
  mov    %rax,0x30(%rsp)
  jmp    L112
L44:
  mov    0x40(%rsp),%rdi
  mov    %rdi,%rax
  shr    %rax
  and    $0x1,%edi
  or     %rdi,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  addss  %xmm0,%xmm0
  jmp    L66
L156:
  call   <sqrtf@plt>
  jmp    L87
L134:
  mov    0x10(%rsp),%rax
  shr    %rax
  or     0x30(%rsp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  addss  %xmm0,%xmm0
  jmp    L78
L1:
  movss  0x4(%rsp),%xmm3
  mulss  0x28(%rsp),%xmm3
  movaps %xmm6,%xmm2
  mulss  %xmm5,%xmm2
  lea    (%r14,%rbx,1),%rax
L10:
  movaps %xmm4,%xmm0
  mulss  (%r12,%rbx,4),%xmm0
  addss  %xmm3,%xmm0
  movss  0x0(%rbp,%rbx,4),%xmm1
  subss  (%rsp),%xmm1
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,0x0(%r13,%rbx,4)
  add    $0x1,%rbx
  cmp    %rax,%rbx
  jne    L10
  mov    %rax,%rbx
L179:
  add    $0x1,%rdx
  cmp    %rdx,%r15
  je     L106
L51:
  test   %r14,%r14
  jne    L1
  jmp    L179
L106:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    %rax,0x18(%rsp)
  je     L147
L159:
  mov    0x20(%rsp),%rcx
  mov    0x8(%rsp),%rax
  movss  (%rcx,%rax,4),%xmm6
  movss  %xmm6,(%rsp)
  mov    0x90(%rsp),%rsi
  movss  (%rsi,%rax,4),%xmm6
  movss  %xmm6,0x4(%rsp)
  mov    0x98(%rsp),%rdi
  movss  0x2c(%rsp),%xmm0
  addss  (%rdi,%rax,4),%xmm0
  pxor   %xmm5,%xmm5
  ucomiss %xmm0,%xmm5
  ja     L156
  sqrtss %xmm0,%xmm0
L87:
  movss  D22(%rip),%xmm4
  divss  %xmm0,%xmm4
  mov    0xa0(%rsp),%rax
  mov    0x8(%rsp),%rcx
  movss  (%rax,%rcx,4),%xmm6
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  js     L134
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
L78:
  movss  D15(%rip),%xmm5
  divss  %xmm0,%xmm5
  mov    $0x0,%edx
  test   %r15,%r15
  jne    L51
  jmp    L106
L147:
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    %rax,0x48(%rsp)
  je     L73
L112:
  cmpq   $0x0,0x18(%rsp)
  je     L147
  mov    0x40(%rsp),%rax
  test   %rax,%rax
  js     L44
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
L66:
  movss  D22(%rip),%xmm6
  divss  %xmm0,%xmm6
  movss  %xmm6,0x28(%rsp)
  movq   $0x0,0x8(%rsp)
  jmp    L159
L73:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D22
type_guessed: f32
name: unpack_data
arguments: data_tag: D15
type_guessed: byte[4]

tool: D22: 1

tool: {"D15": [0x00,0x00,0x00,0x40]}

assistant: ```c
void neuralops_batchnorm2d_bwd_input(size_t batch_sz, size_t width, size_t height, size_t chan, const float *in_buf, const float *mean, const float *mean_grad, const float *var, const float *var_grad, const float *out_grad, float *in_grad, float epsilon) {
  size_t p = 0;
  for (size_t idx = 0; idx < batch_sz; idx += 1) {
    for (size_t a = 0; a < chan; a += 1) {
      float m = mean[a];
      float v = var[a];
      float dm = mean_grad[a];
      float cm = 1.0f / ((float)(width * height * batch_sz));
      float rs = 1.0f / sqrtf(v + epsilon);
      float dv = var_grad[a];
      float cv = 2.0f / ((float)(width * height * batch_sz - 1));
      for (size_t y = 0; y < height; y += 1) {
        for (size_t x = 0; x < width; x += 1) {
          in_grad[p] = out_grad[p] * rs + dm * cm + dv * cv * (in_buf[p] - m);
          p += 1;
        }
      }
    }
  }
}
```