user: What would the C source look like for the assembly code provided here?

```asm
<BMP_scale>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %ecx,%eax
  mov    %r8,-0x60(%rbp)
  mov    %r9d,%r8d
  mov    0x10(%rbp),%edi
  mov    0x18(%rbp),%ecx
  mov    %si,-0x4c(%rbp)
  mov    %dx,-0x50(%rbp)
  mov    %ax,-0x54(%rbp)
  mov    %r8d,%eax
  mov    %ax,-0x58(%rbp)
  mov    %edi,%eax
  mov    %ax,-0x64(%rbp)
  mov    %ecx,%eax
  mov    %ax,-0x68(%rbp)
  movzwl -0x50(%rbp),%eax
  mov    $0x0,%edx
  divw   -0x64(%rbp)
  movzwl %ax,%edx
  movzwl -0x4c(%rbp),%eax
  imul   %edx,%eax
  movzwl -0x4c(%rbp),%edx
  sub    %edx,%eax
  cltq
  mov    %rax,-0x20(%rbp)
  movzwl -0x50(%rbp),%eax
  mov    $0x0,%edx
  divw   -0x64(%rbp)
  mov    %dx,-0x34(%rbp)
  movzwl -0x4c(%rbp),%eax
  mov    $0x0,%edx
  divw   -0x58(%rbp)
  movzwl %ax,%eax
  mov    %rax,-0x18(%rbp)
  movzwl -0x4c(%rbp),%eax
  mov    $0x0,%edx
  divw   -0x58(%rbp)
  mov    %dx,-0x32(%rbp)
  movzwl -0x54(%rbp),%eax
  movzwl -0x4c(%rbp),%edx
  sub    %edx,%eax
  cltq
  mov    %rax,-0x10(%rbp)
  movzwl -0x68(%rbp),%eax
  movzwl -0x58(%rbp),%edx
  sub    %edx,%eax
  cltq
  mov    %rax,-0x8(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movzwl -0x64(%rbp),%eax
  mov    %ax,-0x3c(%rbp)
  movw   $0x0,-0x3a(%rbp)
  jmp    L38
L29:
  movzwl -0x58(%rbp),%eax
  mov    %ax,-0x38(%rbp)
  movw   $0x0,-0x36(%rbp)
  jmp    L5
L48:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    -0x30(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  add    %rax,-0x30(%rbp)
  movzwl -0x36(%rbp),%edx
  movzwl -0x32(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x36(%rbp)
  movzwl -0x58(%rbp),%eax
  cmp    %ax,-0x36(%rbp)
  jl     L5
  movzwl -0x36(%rbp),%eax
  sub    -0x58(%rbp),%ax
  mov    %ax,-0x36(%rbp)
  addq   $0x1,-0x30(%rbp)
L5:
  movzwl -0x38(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %dx,-0x38(%rbp)
  test   %ax,%ax
  jne    L48
  mov    -0x10(%rbp),%rax
  add    %rax,-0x30(%rbp)
  mov    -0x8(%rbp),%rax
  add    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  add    %rax,-0x30(%rbp)
  movzwl -0x3a(%rbp),%edx
  movzwl -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %ax,-0x3a(%rbp)
  movzwl -0x64(%rbp),%eax
  cmp    %ax,-0x3a(%rbp)
  jl     L38
  movzwl -0x3a(%rbp),%eax
  sub    -0x64(%rbp),%ax
  mov    %ax,-0x3a(%rbp)
  movzwl -0x4c(%rbp),%eax
  add    %rax,-0x30(%rbp)
L38:
  movzwl -0x3c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %dx,-0x3c(%rbp)
  test   %ax,%ax
  jne    L29
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void BMP_scale(const unsigned char *src_buf, unsigned short src_wb, unsigned short src_h, unsigned short src_pitch, unsigned char *dst_buf, unsigned short dst_wb, unsigned short dst_h, unsigned short dst_pitch) {
  const long yd = ((src_h / dst_h) * src_wb) - src_wb;
  const unsigned short yr = src_h % dst_h;
  const long xd = src_wb / dst_wb;
  const unsigned short xr = src_wb % dst_wb;
  const unsigned long adj_src = src_pitch - src_wb;
  const unsigned long adj_dst = dst_pitch - dst_wb;
  const unsigned char *src = src_buf;
  unsigned char *dst = dst_buf;
  unsigned short y = dst_h;
  short ye = 0;
  while (y--) {
    unsigned short x = dst_wb;
    short xe = 0;
    while (x--) {
      *dst++ = *src;
      src += xd;
      if ((xe += xr) >= (short)dst_wb) {
        xe -= dst_wb;
        src++;
      }
    }
    src += adj_src;
    dst += adj_dst;
    src += yd;
    if ((ye += yr) >= (short)dst_h) {
      ye -= dst_h;
      src += src_wb;
    }
  }
}
```