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

```asm
<yuv420_to_yuv420_crop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %ecx,-0x6c(%rbp)
  mov    %r8d,-0x70(%rbp)
  mov    %r9d,-0x74(%rbp)
  mov    0x30(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    0x38(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    0x40(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x6c(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x6c(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  cmpl   $0x0,0x10(%rbp)
  jne    L38
  cmpl   $0x0,0x18(%rbp)
  jne    L38
  cmpl   $0x0,0x20(%rbp)
  jne    L38
  cmpl   $0x0,0x28(%rbp)
  je     L12
L38:
  mov    0x20(%rbp),%eax
  imul   -0x74(%rbp),%eax
  mov    %eax,%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    0x20(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  imul   -0x74(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    %ecx,%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x38(%rbp)
  mov    0x20(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  imul   -0x74(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    %ecx,%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  mov    0x10(%rbp),%edx
  mov    0x18(%rbp),%eax
  add    %edx,%eax
  sub    %eax,-0x50(%rbp)
  mov    0x20(%rbp),%edx
  mov    0x28(%rbp),%eax
  add    %edx,%eax
  sub    %eax,-0x4c(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x44(%rbp)
L12:
  mov    -0x88(%rbp),%rax
  mov    -0x48(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x90(%rbp),%rax
  mov    -0x44(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  imul   -0x44(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  imul   -0x44(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    -0x4c(%rbp),%r8d
  mov    -0x50(%rbp),%edi
  mov    -0x74(%rbp),%ecx
  mov    -0x48(%rbp),%esi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <plane_copy@plt>
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r8d
  mov    -0x50(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edi
  mov    -0x74(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    -0x38(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %esi,%eax
  sar    %eax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <plane_copy@plt>
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r8d
  mov    -0x50(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edi
  mov    -0x74(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %esi,%eax
  sar    %eax
  mov    %eax,%esi
  mov    -0x10(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <plane_copy@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  leave
  ret
```

assistant: ```c
void yuv420_to_yuv420_crop(unsigned char *pInpY, unsigned char *pInpCb, unsigned char *pInpCr, int picWidth, int picHeight, int stride, int CropLeft, int CropRight, int CropTop, int CropBottom, unsigned char *pDest, int *pDestWidth, int *pDestHeight) {
  unsigned char *p_sour[3];
  unsigned char *p_dest[3];
  int inp_width = picWidth;
  int inp_height = picHeight;
  int out_width = picWidth;
  int out_height = picHeight;
  p_sour[0] = pInpY;
  p_sour[1] = pInpCb;
  p_sour[2] = pInpCr;
  if (CropLeft || CropRight || CropTop || CropBottom) {
    p_sour[0] = pInpY + (CropTop * stride + CropLeft);
    p_sour[1] = pInpCb + (CropTop / 2 * stride / 2 + CropLeft / 2);
    p_sour[2] = pInpCr + (CropTop / 2 * stride / 2 + CropLeft / 2);
    inp_width = inp_width - (CropLeft + CropRight);
    inp_height = inp_height - (CropTop + CropBottom);
    out_width = inp_width;
    out_height = inp_height;
  }
  *pDestWidth = out_width;
  *pDestHeight = out_height;
  p_dest[0] = pDest;
  p_dest[1] = p_dest[0] + out_width * out_height;
  p_dest[2] = p_dest[1] + out_width / 2 * out_height / 2;
  plane_copy(p_dest[0], out_width, p_sour[0], stride, inp_width, inp_height);
  plane_copy(p_dest[1], out_width / 2, p_sour[1], stride / 2, inp_width / 2, inp_height / 2);
  plane_copy(p_dest[2], out_width / 2, p_sour[2], stride / 2, inp_width / 2, inp_height / 2);
}
```