user: 请从给定的汇编指令推导出C源代码：

```asm
<neuralops_avgpool2d_fwd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    -0x60(%rbp),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
  mov    $0x0,%edx
  divq   0x10(%rbp)
  mov    %rax,-0x10(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  sub    $0x1,%rax
  mov    $0x0,%edx
  divq   0x18(%rbp)
  mov    %rax,-0x8(%rbp)
  mov    0x10(%rbp),%rax
  imul   0x18(%rbp),%rax
  test   %rax,%rax
  js     L100
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  jmp    L6
L100:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  addss  %xmm0,%xmm0
L6:
  movss  D2(%rip),%xmm1
  divss  %xmm0,%xmm1
  movss  %xmm1,-0x4c(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  jmp    L79
L7:
  movq   $0x0,-0x38(%rbp)
  jmp    L91
L102:
  movq   $0x0,-0x30(%rbp)
  jmp    L95
L24:
  movq   $0x0,-0x28(%rbp)
  jmp    L54
L108:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x50(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L129
L43:
  movq   $0x0,-0x18(%rbp)
  jmp    L12
L110:
  mov    -0x28(%rbp),%rax
  imul   0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  imul   0x18(%rbp),%rax
  mov    %rax,%rcx
  mov    -0x70(%rbp),%rax
  imul   -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  imul   -0x68(%rbp),%rax
  add    %rax,%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  imul   -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x50(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x50(%rbp)
  addq   $0x1,-0x18(%rbp)
L12:
  mov    -0x18(%rbp),%rax
  cmp    0x10(%rbp),%rax
  jb     L110
  addq   $0x1,-0x20(%rbp)
L129:
  mov    -0x20(%rbp),%rax
  cmp    0x18(%rbp),%rax
  jb     L43
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movss  -0x4c(%rbp),%xmm0
  mulss  -0x50(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addq   $0x1,-0x48(%rbp)
  addq   $0x1,-0x28(%rbp)
L54:
  mov    -0x28(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L108
  addq   $0x1,-0x30(%rbp)
L95:
  mov    -0x30(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L24
  addq   $0x1,-0x38(%rbp)
L91:
  mov    -0x38(%rbp),%rax
  cmp    -0x70(%rbp),%rax
  jb     L102
  addq   $0x1,-0x40(%rbp)
L79:
  mov    -0x40(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jb     L7
  nop
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type: byte[4]

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