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

```asm
<pool_forwards_cpu>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,0x58(%rsp)
  mov    %esi,%ebx
  mov    %esi,0x88(%rsp)
  mov    %ecx,0x28(%rsp)
  mov    %r8d,0x4(%rsp)
  mov    %ecx,%esi
  imul   %edx,%esi
  mov    %esi,0x78(%rsp)
  test   %ebx,%ebx
  jle    L113
  mov    %edx,%eax
  mov    %ecx,%edi
  mov    %r9d,%r15d
  mov    %ecx,%esi
  imul   0xd0(%rsp),%edi
  mov    %edi,0x7c(%rsp)
  movslq 0xd8(%rsp),%rdi
  mov    %rdi,0x48(%rsp)
  shl    $0x3,%rdi
  mov    %rdi,0x50(%rsp)
  movl   $0x0,0x74(%rsp)
  movl   $0x0,0x68(%rsp)
  sub    %r8d,%eax
  mov    %eax,0x70(%rsp)
  lea    -0x2(%r9),%eax
  mov    %eax,0x8c(%rsp)
  sub    %r9d,%esi
  mov    %esi,0x44(%rsp)
  jmp    L130
L149:
  movslq %r13d,%rax
  mov    0x8(%rsp),%rdx
  add    0x18(%rsp),%rdx
  add    %rax,%rdx
  lea    (%r14,%rdx,8),%rbx
  add    0x10(%rsp),%rax
  mov    0x20(%rsp),%rcx
  lea    (%rcx,%rax,8),%rbp
L75:
  movsd  (%rbx),%xmm1
  call   <max@plt>
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  jne    L75
L167:
  add    $0x1,%r12d
  add    0x28(%rsp),%r13d
  cmp    %r12d,0x4(%rsp)
  je     L80
L95:
  test   %r15d,%r15d
  jg     L149
  jmp    L167
L80:
  mov    0x38(%rsp),%r14
L91:
  addq   $0x8,0xe0(%rsp)
  mov    0xe0(%rsp),%rax
  movsd  %xmm0,-0x8(%rax)
  mov    0xd8(%rsp),%edi
  add    %edi,0x2c(%rsp)
  mov    0x2c(%rsp),%eax
  mov    0x48(%rsp),%rdi
  add    %rdi,0x8(%rsp)
  mov    0x50(%rsp),%rsi
  add    %rsi,0x30(%rsp)
  add    %rsi,%r14
  cmp    0x44(%rsp),%eax
  jg     L16
L137:
  mov    0x30(%rsp),%rbx
  movsd  (%rbx),%xmm0
  cmp    $0x1,%r15d
  jle    L31
L78:
  movsd  0x8(%rbx),%xmm1
  call   <max@plt>
  add    $0x8,%rbx
  cmp    %r14,%rbx
  jne    L78
L31:
  cmpl   $0x1,0x4(%rsp)
  jle    L91
  mov    0x40(%rsp),%r13d
  add    0x28(%rsp),%r13d
  mov    $0x1,%r12d
  mov    0x60(%rsp),%rax
  add    0x8(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    %r14,0x38(%rsp)
  mov    0x58(%rsp),%r14
  jmp    L95
L16:
  mov    0xd0(%rsp),%esi
  add    %esi,0x6c(%rsp)
  mov    0x6c(%rsp),%eax
  mov    0x7c(%rsp),%edi
  add    %edi,0x40(%rsp)
  cmp    0x70(%rsp),%eax
  jg     L109
L152:
  cmpl   $0x0,0x44(%rsp)
  js     L16
  movslq 0x40(%rsp),%rax
  mov    0x18(%rsp),%rsi
  lea    (%rax,%rsi,1),%rdx
  mov    0x58(%rsp),%rdi
  lea    (%rdi,%rdx,8),%rcx
  mov    %rcx,0x30(%rsp)
  add    $0x8,%rdi
  mov    %rdi,0x20(%rsp)
  add    0x80(%rsp),%rax
  lea    (%rdi,%rax,8),%r14
  movq   $0x0,0x8(%rsp)
  movl   $0x0,0x2c(%rsp)
  lea    -0x1(%r15),%eax
  add    %rsi,%rax
  mov    %rax,0x60(%rsp)
  jmp    L137
L109:
  addl   $0x1,0x68(%rsp)
  mov    0x68(%rsp),%eax
  mov    0x78(%rsp),%edi
  add    %edi,0x74(%rsp)
  cmp    %eax,0x88(%rsp)
  je     L113
L130:
  cmpl   $0x0,0x70(%rsp)
  js     L109
  movl   $0x0,0x40(%rsp)
  movl   $0x0,0x6c(%rsp)
  movslq 0x74(%rsp),%rsi
  mov    %rsi,0x18(%rsp)
  mov    0x8c(%rsp),%eax
  add    %rsi,%rax
  mov    %rax,0x80(%rsp)
  jmp    L152
L113:
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void pool_forwards_cpu(const double *data_im, const int channels, const int height, const int width, const int kernel_h, const int kernel_w, const int stride_h, const int stride_w, double *data_pooled) {
  const int channel_size = height * width;
  for (int channel = 0; channel < channels; channel++) {
    for (int fitting_height = 0; fitting_height <= (height - kernel_h); fitting_height += stride_h) {
      for (int fitting_width = 0; fitting_width <= (width - kernel_w); fitting_width += stride_w) {
        int max_index = fitting_height * width + fitting_width + channel_size * channel;
        double max_value = data_im[max_index];
        for (int kernel_col = 1; kernel_col < kernel_w; kernel_col++) {
          int input_row = fitting_height;
          int input_col = fitting_width + kernel_col;
          int data_index = input_row * width + input_col + channel_size * channel;
          double data_value = data_im[data_index];
          max_value = max(max_value, data_value);
        }
        for (int kernel_row = 1; kernel_row < kernel_h; kernel_row++) {
          for (int kernel_col = 0; kernel_col < kernel_w; kernel_col++) {
            int input_row = fitting_height + kernel_row;
            int input_col = fitting_width + kernel_col;
            int data_index = input_row * width + input_col + channel_size * channel;
            double data_value = data_im[data_index];
            max_value = max(max_value, data_value);
          }
        }
        *(data_pooled++) = max_value;
      }
    }
  }
}
```