user: 请从给定的汇编指令推导出C源代码：

```asm
<YVU9toI420>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x58,%rsp
  mov    0xa0(%rsp),%rcx
  mov    %edx,0x10(%rsp)
  mov    %r8d,0x3c(%rsp)
  mov    %r9d,0x38(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x44(%rsp),%rax
  push   %rax
  lea    0x48(%rsp),%rax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  push   %rcx
  mov    0xe8(%rsp),%eax
  mov    %ebx,%ecx
  push   %rax
  mov    0xe8(%rsp),%eax
  push   %rax
  call   <chk_args@plt>
  add    $0x60,%rsp
  test   %eax,%eax
  je     L154
  mov    0x40(%rsp),%r8d
  lea    0xd0(%rsp),%rcx
  lea    0xc0(%rsp),%rdx
  lea    0x3c(%rsp),%rdi
  lea    0x90(%rsp),%rsi
  call   <adjust_range@plt>
  test   %eax,%eax
  jne    L40
L59:
  movl   $0x0,0x2c(%rsp)
L82:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L153
  mov    0x2c(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L40:
  mov    0x44(%rsp),%r8d
  lea    0xd8(%rsp),%rcx
  lea    0xc8(%rsp),%rdx
  lea    0x98(%rsp),%rsi
  lea    0x38(%rsp),%rdi
  call   <adjust_range@plt>
  test   %eax,%eax
  je     L59
  mov    0xc0(%rsp),%r10d
  test   $0x1,%r10b
  jne    L154
  mov    0xc8(%rsp),%r11d
  mov    %r11d,%eax
  and    $0x1,%eax
  mov    %eax,0x2c(%rsp)
  jne    L154
  test   %ebx,%ebx
  jle    L154
  mov    0xb8(%rsp),%eax
  test   %eax,%eax
  jle    L154
  mov    0xb8(%rsp),%ecx
  mov    0x38(%rsp),%edx
  movslq %r10d,%rax
  imul   %r11d,%ecx
  mov    %edx,%edi
  imul   %ebx,%edi
  movslq %ecx,%rcx
  add    %rax,%rcx
  mov    0x8(%rsp),%rax
  movslq %edi,%rdi
  lea    (%rax,%rcx,1),%r15
  movslq 0x3c(%rsp),%rax
  add    %rax,%rdi
  mov    %rax,%r14
  mov    0x98(%rsp),%eax
  lea    (%r12,%rdi,1),%rbp
  test   %eax,%eax
  jle    L101
  movslq 0xb8(%rsp),%rax
  xor    %r13d,%r13d
  mov    %ebx,0x18(%rsp)
  movslq %ebx,%r14
  mov    %r13d,%ebx
  mov    %rax,%r13
  nop
L129:
  mov    0x90(%rsp),%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  add    $0x1,%ebx
  add    %r13,%r15
  add    %r14,%rbp
  call   <memcpy@plt>
  mov    0x98(%rsp),%eax
  cmp    %ebx,%eax
  jg     L129
  mov    0x18(%rsp),%ebx
  mov    0xc0(%rsp),%r10d
  mov    0xc8(%rsp),%r11d
  mov    0x3c(%rsp),%r14d
  mov    0x38(%rsp),%edx
L101:
  mov    0xb0(%rsp),%esi
  imul   0xb8(%rsp),%esi
  mov    0x10(%rsp),%ebp
  mov    0x8(%rsp),%r15
  test   %esi,%esi
  lea    0xf(%rsi),%ecx
  cmovns %esi,%ecx
  imul   %ebx,%ebp
  movslq %esi,%rsi
  sar    $0x4,%ecx
  mov    %ecx,0x30(%rsp)
  test   %ebp,%ebp
  lea    0x3(%rbp),%ecx
  cmovns %ebp,%ecx
  movslq %ebp,%rbp
  sar    $0x2,%ecx
  test   %r11d,%r11d
  mov    %ecx,0x34(%rsp)
  lea    0x3(%r11),%ecx
  cmovns %r11d,%ecx
  sar    $0x2,%ecx
  imul   0xb8(%rsp),%ecx
  test   %ecx,%ecx
  lea    0x3(%rcx),%r9d
  cmovns %ecx,%r9d
  lea    0x3(%r10),%ecx
  sar    $0x2,%r9d
  test   %r10d,%r10d
  cmovns %r10d,%ecx
  movslq %r9d,%r9
  sar    $0x2,%ecx
  movslq %ecx,%rcx
  add    %rsi,%rcx
  add    %rcx,%r9
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %r9,%r15
  add    %ecx,%edx
  sar    %edx
  imul   %ebx,%edx
  mov    %edx,%r8d
  shr    $0x1f,%r8d
  add    %edx,%r8d
  mov    %r14d,%edx
  shr    $0x1f,%edx
  sar    %r8d
  add    %r14d,%edx
  movslq %r8d,%r8
  sar    %edx
  movslq %edx,%rdx
  add    %rbp,%rdx
  add    %rdx,%r8
  and    $0x2,%r11d
  lea    (%r12,%r8,1),%r14
  jne    L163
L34:
  cmp    $0x3,%eax
  jle    L148
  mov    %ebx,%r12d
  movslq 0x34(%rsp),%r13
  mov    0xb8(%rsp),%ebp
  sar    %r12d
  movslq %r12d,%r12
  sar    $0x2,%ebp
  lea    (%r12,%r13,1),%rax
  mov    %rax,0x8(%rsp)
  movslq %ebp,%rax
  mov    %r14,%rbp
  mov    %rax,0x10(%rsp)
  movslq %ebx,%rax
  xor    %ebx,%ebx
  mov    %rax,0x18(%rsp)
  movslq 0x30(%rsp),%rax
  mov    %ebx,%r14d
  mov    %r15,%rbx
  mov    %rax,0x20(%rsp)
L107:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    0x0(%r13,%rbp,1),%r15
  add    $0x1,%r14d
  mov    0x90(%rsp),%ecx
  mov    0xc0(%rsp),%edx
  call   <lineYVU9toI420@plt>
  mov    0x90(%rsp),%eax
  lea    (%r12,%rbp,1),%rdi
  mov    %rbp,%rsi
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  call   <memcpy@plt>
  mov    0x20(%rsp),%rax
  mov    0x90(%rsp),%ecx
  mov    %r15,%rdi
  mov    0xc0(%rsp),%edx
  lea    (%rbx,%rax,1),%rsi
  call   <lineYVU9toI420@plt>
  mov    0x90(%rsp),%eax
  mov    %r15,%rsi
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  mov    0x8(%rsp),%rax
  sar    %edx
  lea    (%rax,%rbp,1),%rdi
  call   <memcpy@plt>
  add    0x10(%rsp),%rbx
  add    0x18(%rsp),%rbp
  mov    0x98(%rsp),%eax
  test   %eax,%eax
  lea    0x3(%rax),%edx
  cmovns %eax,%edx
  sar    $0x2,%edx
  cmp    %r14d,%edx
  jg     L107
  mov    %rbx,%r15
  mov    %rbp,%r14
L148:
  test   $0x2,%al
  je     L59
  mov    0x90(%rsp),%ecx
  mov    0xc0(%rsp),%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <lineYVU9toI420@plt>
  movslq 0x30(%rsp),%rax
  mov    0x90(%rsp),%ecx
  mov    0xc0(%rsp),%edx
  lea    (%r15,%rax,1),%rsi
  movslq 0x34(%rsp),%rax
  lea    (%r14,%rax,1),%rdi
  call   <lineYVU9toI420@plt>
  jmp    L82
  nopl   0x0(%rax)
L163:
  mov    0x90(%rsp),%ecx
  mov    %r10d,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <lineYVU9toI420@plt>
  movslq 0x30(%rsp),%rsi
  movslq 0x34(%rsp),%rdi
  mov    0x90(%rsp),%ecx
  mov    0xc0(%rsp),%edx
  add    %r15,%rsi
  add    %r14,%rdi
  call   <lineYVU9toI420@plt>
  mov    0xb8(%rsp),%eax
  sar    $0x2,%eax
  cltq
  add    %rax,%r15
  mov    %ebx,%eax
  sar    %eax
  cltq
  add    %rax,%r14
  mov    0x98(%rsp),%eax
  sub    $0x2,%eax
  mov    %eax,0x98(%rsp)
  jmp    L34
  xchg   %ax,%ax
L154:
  movl   $0xffffffff,0x2c(%rsp)
  jmp    L82
L153:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int YVU9toI420(unsigned char *dest_ptr, int dest_width, int dest_height, int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy, unsigned char *src_ptr, int src_width, int src_height, int src_pitch, int src_x, int src_y, int src_dx, int src_dy) {
  int scale_x, scale_y;
  if (!chk_args(dest_ptr, dest_width, dest_height, dest_pitch, dest_x, dest_y, dest_dx, dest_dy, src_ptr, src_width, src_height, src_pitch, src_x, src_y, src_dx, src_dy, &scale_x, &scale_y))
    return -1;
  if (!adjust_range(&dest_x, &dest_dx, &src_x, &src_dx, scale_x) || !adjust_range(&dest_y, &dest_dy, &src_y, &src_dy, scale_y))
    return 0;
  if ((src_x & 1) || (src_y & 1))
    return -1;
  if (dest_pitch <= 0 || src_pitch <= 0)
    return -1;
  {
    unsigned char *s, *d;
    int src_uv_offs, dest_uv_offs;
    register int j;
    s = src_ptr + src_x + src_y * src_pitch;
    d = dest_ptr + dest_x + dest_y * dest_pitch;
    for (j = 0; j < dest_dy; j++) {
      memcpy(d, s, dest_dx);
      s += src_pitch;
      d += dest_pitch;
    }
    src_uv_offs = src_height * src_pitch / 16;
    dest_uv_offs = dest_height * dest_pitch / 4;
    s = (src_ptr + src_height * src_pitch) + src_x / 4 + src_y / 4 * src_pitch / 4;
    d = (dest_ptr + dest_height * dest_pitch) + dest_x / 2 + dest_y / 2 * dest_pitch / 2;
    if (src_y & 2) {
      lineYVU9toI420(d, s, src_x, dest_dx);
      lineYVU9toI420(d + dest_uv_offs, s + src_uv_offs, src_x, dest_dx);
      s += src_pitch / 4;
      d += dest_pitch / 2;
      dest_dy -= 2;
    }
    for (j = 0; j < dest_dy / 4; j++) {
      lineYVU9toI420(d, s, src_x, dest_dx);
      memcpy(d + dest_pitch / 2, d, dest_dx / 2);
      lineYVU9toI420(d + dest_uv_offs, s + src_uv_offs, src_x, dest_dx);
      memcpy(d + dest_pitch / 2 + dest_uv_offs, d + dest_uv_offs, dest_dx / 2);
      s += src_pitch / 4;
      d += dest_pitch;
    }
    if (dest_dy & 2) {
      lineYVU9toI420(d, s, src_x, dest_dx);
      lineYVU9toI420(d + dest_uv_offs, s + src_uv_offs, src_x, dest_dx);
    }
  }
  return 0;
}
```