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

```asm
<vc_image_resize_bytes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %ecx,-0x44(%rbp)
  mov    %r8,-0x50(%rbp)
  mov    %r9d,-0x48(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  jle    L229
  cmpl   $0x0,0x10(%rbp)
  jle    L229
  cmpl   $0x0,-0x3c(%rbp)
  jle    L229
  cmpl   $0x0,-0x48(%rbp)
  jle    L229
  mov    -0x3c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jne    L308
  mov    -0x40(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jne    L308
  mov    -0x38(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jne    L304
  mov    -0x44(%rbp),%eax
  cmp    0x18(%rbp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  jmp    L197
L304:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jne    L196
  mov    0x18(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jne    L196
  mov    -0x3c(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vclib_memcpy@plt>
  jmp    L197
L196:
  mov    -0x3c(%rbp),%edx
  mov    -0x50(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vclib_memcpy@plt>
  mov    -0x44(%rbp),%eax
  cltq
  add    %rax,-0x38(%rbp)
  mov    0x18(%rbp),%eax
  cltq
  add    %rax,-0x50(%rbp)
  subl   $0x1,-0x40(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  jg     L196
  jmp    L197
L308:
  mov    -0x40(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L175
  mov    -0x40(%rbp),%eax
  sub    0x10(%rbp),%eax
  imul   -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x48(%rbp),%r8d
  mov    -0x50(%rbp),%rdi
  mov    -0x44(%rbp),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x8(%rbp),%rax
  mov    0x20(%rbp),%ecx
  push   %rcx
  mov    0x18(%rbp),%ecx
  push   %rcx
  mov    %r8d,%r9d
  mov    %rdi,%r8
  mov    %edx,%ecx
  mov    0x10(%rbp),%edx
  mov    %rax,%rdi
  call   <vcir8_hzoom@plt>
  add    $0x10,%rsp
  mov    -0x40(%rbp),%eax
  cmp    0x10(%rbp),%eax
  je     L197
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%r8d
  mov    0x10(%rbp),%eax
  shl    $0x10,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %eax,%r11d
  mov    -0x44(%rbp),%r9d
  mov    -0x8(%rbp),%r10
  mov    -0x44(%rbp),%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%rax
  mov    0x20(%rbp),%edi
  push   %rdi
  push   %r8
  push   %r11
  push   $0x0
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <vcir8_vzoom2@plt>
  add    $0x20,%rsp
  jmp    L197
L175:
  mov    -0x3c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jl     L169
  mov    -0x3c(%rbp),%eax
  sub    -0x48(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%r8d
  mov    0x10(%rbp),%eax
  shl    $0x10,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %eax,%r11d
  mov    0x18(%rbp),%r9d
  mov    -0x50(%rbp),%r10
  mov    -0x44(%rbp),%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%esi
  mov    -0x10(%rbp),%rax
  mov    0x20(%rbp),%edi
  push   %rdi
  push   %r8
  push   %r11
  push   $0x0
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <vcir8_vzoom2@plt>
  add    $0x20,%rsp
  mov    -0x3c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  je     L197
  mov    -0x48(%rbp),%r9d
  mov    -0x10(%rbp),%r8
  mov    -0x44(%rbp),%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%rax
  mov    0x20(%rbp),%edi
  push   %rdi
  mov    -0x44(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <vcir8_hzoom@plt>
  add    $0x10,%rsp
  jmp    L197
L169:
  mov    -0x40(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,0x10(%rbp)
  jne    L306
  mov    -0x3c(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0x48(%rbp)
  jne    L306
  mov    -0x3c(%rbp),%eax
  or     0x10(%rbp),%eax
  or     -0x44(%rbp),%eax
  or     0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  or     %eax,%edx
  mov    -0x50(%rbp),%rax
  or     %edx,%eax
  and    $0xf,%eax
  test   %eax,%eax
  jne    L306
  jmp    L247
L18:
  mov    0x20(%rbp),%r8d
  mov    0x18(%rbp),%edi
  mov    -0x44(%rbp),%ecx
  mov    -0x3c(%rbp),%edx
  mov    -0x50(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <vcir8_down2_8@plt>
  mov    -0x44(%rbp),%eax
  shl    $0x3,%eax
  cltq
  add    %rax,-0x38(%rbp)
  mov    0x18(%rbp),%eax
  shl    $0x4,%eax
  cltq
  add    %rax,-0x50(%rbp)
  subl   $0x8,-0x40(%rbp)
L247:
  cmpl   $0x0,-0x40(%rbp)
  jg     L18
  jmp    L197
L306:
  mov    $0x0,%edi
  call   <vclib_obtain_tmp_buf@plt>
  mov    %rax,-0x18(%rbp)
  mov    $0x0,%eax
  call   <vclib_get_tmp_buf_size@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x48(%rbp),%eax
  add    $0xf,%eax
  and    $0xfffffff0,%eax
  mov    %eax,-0x20(%rbp)
  movl   $0x40,-0x2c(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jge    L141
  movl   $0x20,-0x2c(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jge    L141
  mov    -0x24(%rbp),%eax
  cltd
  idivl  -0x20(%rbp)
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x10,-0x2c(%rbp)
  jle    L220
  movl   $0x10,-0x2c(%rbp)
L220:
  cmpl   $0x0,-0x2c(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
L141:
  movl   $0x0,-0x28(%rbp)
  mov    0x10(%rbp),%eax
  shl    $0x10,%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L296
L63:
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x40(%rbp)
  jge    L227
  mov    -0x40(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L227:
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%r8d
  mov    0x18(%rbp),%r9d
  mov    -0x50(%rbp),%r10
  mov    -0x20(%rbp),%ecx
  mov    -0x2c(%rbp),%edx
  mov    -0x48(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    0x20(%rbp),%edi
  push   %rdi
  push   %r8
  mov    -0x1c(%rbp),%edi
  push   %rdi
  mov    -0x28(%rbp),%edi
  push   %rdi
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <vcir8_vzoom2@plt>
  add    $0x20,%rsp
  mov    -0x48(%rbp),%r9d
  mov    -0x18(%rbp),%r8
  mov    -0x44(%rbp),%ecx
  mov    -0x2c(%rbp),%edx
  mov    -0x3c(%rbp),%esi
  mov    -0x38(%rbp),%rax
  mov    0x20(%rbp),%edi
  push   %rdi
  mov    -0x20(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <vcir8_hzoom@plt>
  add    $0x10,%rsp
  mov    -0x2c(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  add    %eax,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  imul   -0x44(%rbp),%eax
  cltq
  add    %rax,-0x38(%rbp)
  mov    -0x2c(%rbp),%eax
  add    %eax,-0x30(%rbp)
L296:
  mov    -0x30(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L63
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <vclib_release_tmp_buf@plt>
  jmp    L197
L229:
  nop
L197:
  leave
  ret
```

assistant: ```c
void vc_image_resize_bytes(unsigned char *dest, int destw, int desth, int dest_pitch, const unsigned char *src, int srcw, int srch, int src_pitch, int smooth_flag) {
  if (desth <= 0 || srch <= 0 || destw <= 0 || srcw <= 0)
    return;
  if (destw == srcw && desth == srch) {
    if (dest == src) {
      assert(dest_pitch == src_pitch);
      return;
    }
    if (dest_pitch == destw && src_pitch == srcw) {
      vclib_memcpy(dest, src, destw * desth);
    } else {
      do {
        vclib_memcpy(dest, src, destw);
        dest += dest_pitch;
        src += src_pitch;
      } while (--desth > 0);
    }
  } else if (desth >= srch) {
    unsigned char *ptr = dest + dest_pitch * (desth - srch);
    vcir8_hzoom(ptr, destw, srch, dest_pitch, src, srcw, src_pitch, smooth_flag);
    if (desth != srch) {
      vcir8_vzoom2(dest, destw, desth, dest_pitch, ptr, dest_pitch, 0, (srch << 16) / desth, srch - 1, smooth_flag);
    }
  } else if (destw >= srcw) {
    unsigned char *ptr = dest + (destw - srcw);
    vcir8_vzoom2(ptr, srcw, desth, dest_pitch, src, src_pitch, 0, (srch << 16) / desth, srch - 1, smooth_flag);
    if (destw != srcw) {
      vcir8_hzoom(dest, destw, desth, dest_pitch, ptr, srcw, dest_pitch, smooth_flag);
    }
  } else {
    int i, j, step, pos, buf_pitch, buf_size;
    unsigned char *bufptr;
    if (desth * 2 == srch && destw * 2 == srcw && ((destw | srch | dest_pitch | src_pitch | ((int)dest) | ((int)src)) & 15) == 0) {
      while (desth > 0) {
        vcir8_down2_8(dest, src, destw, dest_pitch, src_pitch, smooth_flag);
        dest += dest_pitch << 3;
        src += src_pitch << 4;
        desth -= 8;
      }
      return;
    }
    bufptr = vclib_obtain_tmp_buf(0);
    buf_size = vclib_get_tmp_buf_size();
    buf_pitch = (srcw + 15) & ~15;
    j = 64;
    if (buf_pitch * j > buf_size) {
      j = 32;
      if (buf_pitch * j > buf_size) {
        j = buf_size / buf_pitch;
        if (j > 16)
          j = 16;
        assert(j > 0);
      }
    }
    pos = 0;
    step = (srch << 16) / desth;
    for (i = 0; i < desth; i += j) {
      if (i + j > desth) {
        j = desth - i;
      }
      vcir8_vzoom2(bufptr, srcw, j, buf_pitch, src, src_pitch, pos, step, srch - 1, smooth_flag);
      vcir8_hzoom(dest, destw, j, dest_pitch, bufptr, srcw, buf_pitch, smooth_flag);
      pos += j * step;
      dest += j * dest_pitch;
    }
    vclib_release_tmp_buf(bufptr);
  }
}
```