user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<neuralops_avgpool2d_fwd>:
  endbr64
  push   %r15
  mov    %rsi,%r10
  mov    %rdx,%r11
  xor    %edx,%edx
  push   %r14
  mov    %rcx,%r14
  mov    %r8,%rcx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%rsi
  lea    -0x1(%r10,%rsi,1),%rax
  mov    %rax,-0x50(%rsp)
  div    %rsi
  mov    %rdi,-0x38(%rsp)
  mov    0x40(%rsp),%rdi
  mov    %r9,-0x10(%rsp)
  xor    %edx,%edx
  mov    %rax,%rbx
  lea    -0x1(%r11,%rdi,1),%rax
  mov    %rax,-0x30(%rsp)
  div    %rdi
  mov    %rax,-0x8(%rsp)
  mov    %rsi,%rax
  imul   %rdi,%rax
  test   %rax,%rax
  js     L5
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
L10:
  movss  D3(%rip),%xmm1
  cmpq   $0x0,-0x38(%rsp)
  divss  %xmm0,%xmm1
  je     L52
  mov    %r11,%rax
  imul   %r10,%r11
  xor    %r12d,%r12d
  movq   $0x0,-0x40(%rsp)
  imul   %r14,%rax
  lea    0x0(,%rsi,4),%r9
  pxor   %xmm2,%xmm2
  movq   $0x0,-0x68(%rsp)
  lea    0x0(,%r10,4),%r8
  lea    (%rcx,%r9,1),%r13
  mov    %r11,-0x20(%rsp)
  imul   %r10,%rax
  mov    %rax,-0x18(%rsp)
  mov    %r10,%rax
  imul   %rdi,%rax
  mov    %rax,-0x28(%rsp)
L41:
  movq   $0x0,-0x60(%rsp)
  mov    -0x40(%rsp),%rax
  mov    %rax,-0x48(%rsp)
  test   %r14,%r14
  je     L115
L2:
  movq   $0x0,-0x58(%rsp)
  mov    -0x48(%rsp),%r15
  cmp    %rdi,-0x30(%rsp)
  jb     L25
L16:
  cmp    %rsi,-0x50(%rsp)
  jb     L34
  mov    -0x10(%rsp),%rax
  mov    %r15,%r11
  xor    %r10d,%r10d
  lea    (%rax,%r12,4),%rbp
  cs nopw 0x0(%rax,%rax,1)
L109:
  test   %rdi,%rdi
  je     L119
  lea    0x0(%r13,%r11,4),%rdx
  xor    %ecx,%ecx
  movaps %xmm2,%xmm0
  nopl   0x0(%rax,%rax,1)
L108:
  mov    %rdx,%rax
  sub    %r9,%rax
  test   %rsi,%rsi
  je     L96
  nopl   0x0(%rax,%rax,1)
L140:
  addss  (%rax),%xmm0
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L140
L96:
  add    $0x1,%rcx
  add    %r8,%rdx
  cmp    %rcx,%rdi
  jne    L108
L65:
  mulss  %xmm1,%xmm0
  add    %rsi,%r11
  movss  %xmm0,0x0(%rbp,%r10,4)
  add    $0x1,%r10
  cmp    %r10,%rbx
  ja     L109
  xor    %ecx,%ecx
  lea    -0x1(%rbx),%rax
  cmp    %rsi,-0x50(%rsp)
  cmovb  %rcx,%rax
  lea    0x1(%r12,%rax,1),%r12
L34:
  addq   $0x1,-0x58(%rsp)
  add    -0x28(%rsp),%r15
  mov    -0x58(%rsp),%rax
  cmp    %rax,-0x8(%rsp)
  ja     L16
L25:
  addq   $0x1,-0x60(%rsp)
  mov    -0x60(%rsp),%rax
  mov    -0x20(%rsp),%rdx
  add    %rdx,-0x48(%rsp)
  cmp    %rax,%r14
  jne    L2
L115:
  addq   $0x1,-0x68(%rsp)
  mov    -0x18(%rsp),%rdx
  mov    -0x68(%rsp),%rax
  add    %rdx,-0x40(%rsp)
  cmp    %rax,-0x38(%rsp)
  jne    L41
L52:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L119:
  movaps %xmm2,%xmm0
  jmp    L65
L5:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm0,%xmm0
  shr    %rdx
  or     %rax,%rdx
  cvtsi2ss %rdx,%xmm0
  addss  %xmm0,%xmm0
  jmp    L10
```

tool_calls: name: parse_data
arguments: tag: D3
type_infered: byte[4]

tool: {"D3": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void neuralops_avgpool2d_fwd(size_t batch_sz, size_t in_width, size_t in_height, size_t chan, const float *in_buf, float *out_buf, size_t pool_w, size_t pool_h) {
  size_t out_width = (in_width + pool_w - 1) / pool_w;
  size_t out_height = (in_height + pool_h - 1) / pool_h;
  float normalizer = 1.0f / ((float)(pool_w * pool_h));
  size_t p = 0;
  for (size_t idx = 0; idx < batch_sz; idx += 1) {
    for (size_t a = 0; a < chan; a += 1) {
      for (size_t y = 0; y < out_height; y += 1) {
        for (size_t x = 0; x < out_width; x += 1) {
          float pool_value = 0.0f;
          for (size_t v = 0; v < pool_h; v += 1) {
            for (size_t u = 0; u < pool_w; u += 1) {
              pool_value += in_buf[x * pool_w + u + in_width * (y * pool_h + v + in_height * (a + chan * idx))];
            }
          }
          out_buf[p] = normalizer * pool_value;
          p += 1;
        }
      }
    }
  }
}
```