user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<neuralops_avgpool2d_fwd>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  mov    %rdx,%rsi
  xor    %edx,%edx
  push   %r14
  mov    %r8,%r10
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,-0x28(%rsp)
  mov    0x58(%rsp),%rdi
  mov    0x60(%rsp),%r12
  mov    %rcx,-0x20(%rsp)
  lea    -0x1(%rdi),%rbp
  mov    %r9,0x8(%rsp)
  lea    (%r15,%rbp,1),%rax
  mov    %rax,-0x48(%rsp)
  div    %rdi
  xor    %edx,%edx
  mov    %rax,-0x78(%rsp)
  lea    -0x1(%rsi,%r12,1),%rax
  mov    %rax,-0x18(%rsp)
  div    %r12
  mov    %rax,0x10(%rsp)
  mov    %rdi,%rax
  imul   %r12,%rax
  test   %rax,%rax
  js     L170
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
L127:
  movss  D1(%rip),%xmm3
  cmpq   $0x0,-0x28(%rsp)
  divss  %xmm0,%xmm3
  je     L197
  mov    -0x20(%rsp),%rax
  test   %rax,%rax
  je     L197
  imul   %rsi,%rax
  mov    %r12,0x60(%rsp)
  mov    %rdi,%r9
  pxor   %xmm4,%xmm4
  imul   %r15,%rsi
  and    $0xfffffffffffffffc,%r9
  movq   $0x0,-0x30(%rsp)
  lea    0x0(,%r15,4),%r14
  movq   $0x0,-0x68(%rsp)
  movq   $0x0,-0x50(%rsp)
  imul   %r15,%rax
  mov    %rsi,-0x8(%rsp)
  mov    %rax,(%rsp)
  mov    %r15,%rax
  imul   %r12,%rax
  mov    %rbp,%r12
  mov    0x60(%rsp),%rbp
  mov    %rax,-0x10(%rsp)
  mov    %rdi,%rax
  shr    $0x2,%rax
  shl    $0x4,%rax
  mov    %rax,%r13
L111:
  movq   $0x0,-0x60(%rsp)
  mov    -0x30(%rsp),%rax
  mov    %rax,-0x38(%rsp)
L116:
  movq   $0x0,-0x58(%rsp)
  mov    -0x38(%rsp),%rax
  mov    %rax,-0x40(%rsp)
  cmp    %rbp,-0x18(%rsp)
  jb     L126
L173:
  cmp    %rdi,-0x48(%rsp)
  jb     L65
  mov    -0x50(%rsp),%rbx
  mov    0x8(%rsp),%rax
  xor    %r11d,%r11d
  lea    (%rax,%rbx,4),%rax
  mov    -0x40(%rsp),%rbx
  mov    %rax,-0x70(%rsp)
  nop
L110:
  test   %rbp,%rbp
  je     L183
  lea    (%r10,%rbx,4),%rsi
  mov    %rbx,%rcx
  movaps %xmm4,%xmm1
  xor    %r8d,%r8d
  cs nopw 0x0(%rax,%rax,1)
L195:
  test   %rdi,%rdi
  je     L174
  cmp    $0x2,%r12
  jbe    L154
  lea    0x0(%r13,%rsi,1),%rdx
  mov    %rsi,%rax
  nopl   0x0(%rax,%rax,1)
L20:
  movups (%rax),%xmm0
  add    $0x10,%rax
  addss  %xmm0,%xmm1
  movaps %xmm0,%xmm2
  shufps $0x55,%xmm0,%xmm2
  addss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  unpckhps %xmm0,%xmm1
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  addss  %xmm2,%xmm1
  cmp    %rax,%rdx
  jne    L20
  mov    %r9,%rax
  cmp    %rdi,%r9
  je     L174
L108:
  lea    (%rax,%rcx,1),%rdx
  addss  (%r10,%rdx,4),%xmm1
  lea    0x1(%rax),%rdx
  cmp    %rdx,%rdi
  jbe    L174
  add    %rcx,%rdx
  add    $0x2,%rax
  addss  (%r10,%rdx,4),%xmm1
  cmp    %rax,%rdi
  jbe    L174
  add    %rcx,%rax
  addss  (%r10,%rax,4),%xmm1
L174:
  add    $0x1,%r8
  add    %r15,%rcx
  add    %r14,%rsi
  cmp    %r8,%rbp
  jne    L195
L88:
  mulss  %xmm3,%xmm1
  mov    -0x70(%rsp),%rax
  add    %rdi,%rbx
  movss  %xmm1,(%rax,%r11,4)
  add    $0x1,%r11
  cmp    %r11,-0x78(%rsp)
  ja     L110
  mov    -0x78(%rsp),%rax
  xor    %ebx,%ebx
  sub    $0x1,%rax
  cmp    %rdi,-0x48(%rsp)
  cmovb  %rbx,%rax
  mov    -0x50(%rsp),%rbx
  lea    0x1(%rbx,%rax,1),%rax
  mov    %rax,-0x50(%rsp)
L65:
  addq   $0x1,-0x58(%rsp)
  mov    -0x10(%rsp),%rsi
  mov    -0x58(%rsp),%rax
  add    %rsi,-0x40(%rsp)
  cmp    %rax,0x10(%rsp)
  ja     L173
L126:
  addq   $0x1,-0x60(%rsp)
  mov    -0x8(%rsp),%rsi
  mov    -0x60(%rsp),%rax
  add    %rsi,-0x38(%rsp)
  cmp    %rax,-0x20(%rsp)
  jne    L116
  addq   $0x1,-0x68(%rsp)
  mov    (%rsp),%rsi
  mov    -0x68(%rsp),%rax
  add    %rsi,-0x30(%rsp)
  cmp    %rax,-0x28(%rsp)
  jne    L111
L197:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L154:
  xor    %eax,%eax
  jmp    L108
L183:
  movaps %xmm4,%xmm1
  jmp    L88
L170:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm0,%xmm0
  shr    %rdx
  or     %rax,%rdx
  cvtsi2ss %rdx,%xmm0
  addss  %xmm0,%xmm0
  jmp    L127
```

tool_calls: name: disassemble_data
arguments: label: D1
data_type: byte[4]

tool: {"D1": [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;
        }
      }
    }
  }
}
```