user: Demonstrate the C code that generates the assembly output below:

```asm
<NV12TileToNV12>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  mov    %ebx,%r13d
  sub    $0x58,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,0x38(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  and    $0x1,%edx
  lea    -0x1(%rcx),%eax
  mov    %rsi,0x8(%rsp)
  cmove  %ecx,%eax
  shr    $0x1f,%r13d
  mov    %edx,0x2c(%rsp)
  add    %ebx,%r13d
  movl   $0x0,0x4(%rsp)
  mov    %eax,0x28(%rsp)
  mov    %ebx,%eax
  sar    %r13d
  mov    0x28(%rsp),%ecx
  shl    $0xc,%eax
  mov    %r13d,(%rsp)
  cltq
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  lea    0x100(%rdi),%rax
  mov    %rax,0x10(%rsp)
  mov    %ebx,%eax
  shl    $0xb,%eax
  cltq
  lea    -0x100(,%rax,4),%rax
  mov    %rax,0x20(%rsp)
  cmp    %ecx,0x4(%rsp)
  jge    L14
  nopl   (%rax)
L89:
  mov    0x8(%rsp),%rax
  mov    %rax,0x40(%rsp)
  cmp    $0x1,%ebx
  jle    L11
  mov    0x20(%rsp),%r12
  mov    0x10(%rsp),%r14
  xor    %r15d,%r15d
  lea    0x40(%rsp),%rbp
  add    %r14,%r12
  jmp    L52
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %r13,%rdi
  call   <copyTile@plt>
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <copyTile@plt>
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <copyTile@plt>
  lea    0x100(%r12),%rdi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  call   <copyTile@plt>
L45:
  add    $0x1,%r15d
  add    $0x200,%r14
  add    $0x200,%r12
  cmp    (%rsp),%r15d
  jge    L11
L52:
  lea    -0x100(%r14),%r13
  mov    %ebx,%edx
  mov    %rbp,%rsi
  test   $0x1,%r15b
  je     L20
  mov    %r12,%rdi
  call   <copyTile@plt>
  lea    0x100(%r12),%rdi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  call   <copyTile@plt>
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <copyTile@plt>
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <copyTile@plt>
  jmp    L45
  nopl   0x0(%rax)
L11:
  mov    0x18(%rsp),%rcx
  addl   $0x2,0x4(%rsp)
  add    %rcx,0x8(%rsp)
  add    %rcx,0x10(%rsp)
  mov    0x28(%rsp),%ecx
  cmp    %ecx,0x4(%rsp)
  jl     L89
L14:
  lea    0x1(%rcx),%eax
  xor    %edx,%edx
  mov    0x30(%rsp),%rbp
  shr    %eax
  cmp    $0xffffffff,%ecx
  cmovl  %rdx,%rax
  imul   0x18(%rsp),%rax
  mov    0x2c(%rsp),%edx
  add    %rax,%rbp
  add    0x38(%rsp),%rax
  test   %edx,%edx
  je     L81
  mov    %rax,0x40(%rsp)
  test   %ebx,%ebx
  jle    L81
  lea    -0x1(%rbx),%r12d
  lea    0x40(%rsp),%r13
  add    $0x1,%r12
  shl    $0x8,%r12
  add    %rbp,%r12
L38:
  mov    %rbp,%rdi
  mov    %ebx,%edx
  mov    %r13,%rsi
  add    $0x100,%rbp
  call   <copyTile@plt>
  cmp    %r12,%rbp
  jne    L38
L81:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void NV12TileToNV12(uint8_t *dst_head, uint8_t *src_head, int wTiles, int hTiles) {
  int loop = 0;
  int Z = 0;
  uint8_t *src = src_head;
  uint8_t *dst = dst_head;
  for (loop = 0; loop < (hTiles % 2 == 0 ? hTiles : hTiles - 1); loop = loop + 2) {
    src = src_head;
    for (Z = 0; Z < (wTiles / 2); Z++) {
      dst = dst_head;
      if (Z % 2 == 0) {
        dst = dst + (Z * 2 * 64);
        copyTile(dst, &src, wTiles);
        dst = dst + 64;
        copyTile(dst, &src, wTiles);
        dst = dst_head + (wTiles * (64 * 32));
        dst = dst + (Z * 2 * 64);
        copyTile(dst, &src, wTiles);
        dst = dst + 64;
        copyTile(dst, &src, wTiles);
      } else {
        dst = dst_head + (wTiles * (64 * 32));
        dst = dst + (Z * 2 * 64);
        copyTile(dst, &src, wTiles);
        dst = dst + 64;
        copyTile(dst, &src, wTiles);
        dst = dst_head + (Z * 2 * 64);
        copyTile(dst, &src, wTiles);
        dst = dst + 64;
        copyTile(dst, &src, wTiles);
      }
    }
    src_head = src_head + (2 * (64 * 32) * wTiles);
    dst_head = dst_head + (2 * wTiles * (64 * 32));
  }
  if (hTiles % 2) {
    src = src_head;
    for (loop = 0; loop < wTiles; loop++) {
      dst = dst_head + (loop * 64);
      copyTile(dst, &src, wTiles);
    }
  }
}
```