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

```asm
<neuralops_avgpool2d_2x2_fwd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9,-0x70(%rbp)
  mov    -0x50(%rbp),%rax
  add    $0x1,%rax
  shr    %rax
  mov    %rax,-0x10(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x1,%rax
  shr    %rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  jmp    L61
L71:
  movq   $0x0,-0x28(%rbp)
  jmp    L63
L1:
  movq   $0x0,-0x20(%rbp)
  jmp    L50
L62:
  movq   $0x0,-0x18(%rbp)
  jmp    L73
L7:
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rsi
  mov    -0x60(%rbp),%rax
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  imul   -0x58(%rbp),%rax
  add    %rsi,%rax
  imul   -0x50(%rbp),%rax
  add    %rcx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rsi
  mov    -0x60(%rbp),%rax
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  imul   -0x58(%rbp),%rax
  add    %rsi,%rax
  imul   -0x50(%rbp),%rax
  add    %rcx,%rax
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rsi
  mov    -0x60(%rbp),%rax
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  imul   -0x58(%rbp),%rax
  add    %rsi,%rax
  add    $0x1,%rax
  imul   -0x50(%rbp),%rax
  add    %rcx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x20(%rbp),%rax
  lea    (%rax,%rax,1),%rsi
  mov    -0x60(%rbp),%rax
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  imul   -0x58(%rbp),%rax
  add    %rsi,%rax
  add    $0x1,%rax
  imul   -0x50(%rbp),%rax
  add    %rcx,%rax
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm1
  movss  D6(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x3c(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movss  -0x3c(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addq   $0x1,-0x38(%rbp)
  addq   $0x1,-0x18(%rbp)
L73:
  mov    -0x18(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L7
  addq   $0x1,-0x20(%rbp)
L50:
  mov    -0x20(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L62
  addq   $0x1,-0x28(%rbp)
L63:
  mov    -0x28(%rbp),%rax
  cmp    -0x60(%rbp),%rax
  jb     L1
  addq   $0x1,-0x30(%rbp)
L61:
  mov    -0x30(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jb     L71
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D6
type: byte[4]

tool: {"D6": [0x00,0x00,0x80,0x3e]}

assistant: ```c
void neuralops_avgpool2d_2x2_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 out_width = (in_width + 1) / 2;
  size_t out_height = (in_height + 1) / 2;
  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.25f * (in_buf[x * 2 + in_width * (y * 2 + in_height * (a + chan * idx))] + in_buf[x * 2 + 1 + in_width * (y * 2 + in_height * (a + chan * idx))] + in_buf[x * 2 + in_width * (y * 2 + 1 + in_height * (a + chan * idx))] + in_buf[x * 2 + 1 + in_width * (y * 2 + 1 + in_height * (a + chan * idx))]);
          out_buf[p] = pool_value;
          p += 1;
        }
      }
    }
  }
}
```