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

```asm
<memcpy>:
  endbr64
  mov    %edx,%eax
  mov    %rdi,%r8
  test   %eax,%eax
  je     L427
  mov    %rsi,%r9
  test   $0x1,%dil
  jne    L72
  mov    %rsi,%rcx
  test   $0x1,%sil
  jne    L289
  mov    %rsi,%rdx
L340:
  cmp    $0x2,%eax
  jbe    L89
  test   $0x2,%dil
  je     L145
  movzwl (%rdx),%ecx
  add    $0x2,%rdx
  sub    $0x2,%eax
  add    $0x2,%rdi
  mov    %cx,-0x2(%rdi)
  mov    %rdx,%rcx
L89:
  and    $0x2,%ecx
  jne    L230
L243:
  mov    %eax,%r11d
  shr    $0x2,%r11d
  je     L15
  lea    -0x1(%r11),%ecx
  cmp    $0x2,%ecx
  jbe    L442
  lea    0x8(%rdx),%rcx
  cmp    %rcx,%rdi
  je     L442
  mov    %eax,%r10d
  xor    %ecx,%ecx
  shr    $0x3,%r10d
  mov    %r10d,%esi
  shl    $0x4,%rsi
  xchg   %ax,%ax
L292:
  movdqu (%rdx,%rcx,1),%xmm1
  movups %xmm1,(%rdi,%rcx,1)
  add    $0x10,%rcx
  cmp    %rcx,%rsi
  jne    L292
  lea    (%r10,%r10,1),%ecx
  mov    %r11d,%esi
  mov    %rcx,%r10
  shl    $0x3,%rcx
  lea    (%rdi,%rcx,1),%r9
  add    %rdx,%rcx
  cmp    %r10d,%r11d
  je     L60
  mov    (%rcx),%rcx
  mov    %rcx,(%r9)
L60:
  shl    $0x3,%rsi
  add    %rsi,%rdx
  add    %rsi,%rdi
L15:
  test   $0x2,%al
  je     L311
  movzwl (%rdx),%ecx
  add    $0x2,%rdi
  add    $0x2,%rdx
  mov    %cx,-0x2(%rdi)
L311:
  test   $0x1,%al
  je     L427
  movzbl (%rdx),%eax
  mov    %al,(%rdi)
L427:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L72:
  movzbl (%rsi),%ecx
  lea    0x1(%rsi),%rdx
  lea    0x1(%rdi),%rdi
  sub    $0x1,%eax
  mov    %cl,(%r8)
  mov    %rdx,%rcx
  test   $0x1,%dl
  je     L340
  mov    %rdx,%r9
  test   %eax,%eax
  je     L427
L490:
  lea    0x1(%r9),%rsi
  mov    %rdi,%rcx
  lea    -0x1(%rax),%edx
  sub    %rsi,%rcx
  cmp    $0xe,%rcx
  jbe    L288
  cmp    $0x6,%edx
  jbe    L288
  cmp    $0xe,%edx
  jbe    L271
  lea    -0x10(%rax),%esi
  xor    %edx,%edx
  xor    %ecx,%ecx
  shr    $0x4,%esi
  add    $0x1,%esi
  nopw   0x0(%rax,%rax,1)
L42:
  movdqu (%r9,%rdx,1),%xmm0
  add    $0x1,%ecx
  movups %xmm0,(%rdi,%rdx,1)
  add    $0x10,%rdx
  cmp    %esi,%ecx
  jb     L42
  shl    $0x4,%esi
  mov    %eax,%edx
  mov    %esi,%r11d
  sub    %esi,%edx
  lea    (%rdi,%r11,1),%rcx
  lea    (%r9,%r11,1),%r10
  cmp    %esi,%eax
  je     L427
  lea    -0x1(%rdx),%esi
  mov    %edx,%eax
  cmp    $0x6,%esi
  jbe    L19
L20:
  mov    (%r9,%r11,1),%rsi
  mov    %rsi,(%rdi,%r11,1)
  mov    %eax,%esi
  and    $0xfffffff8,%esi
  mov    %esi,%edi
  sub    %esi,%edx
  add    %rdi,%rcx
  add    %rdi,%r10
  cmp    %eax,%esi
  je     L427
  lea    -0x1(%rdx),%esi
L19:
  movzbl (%r10),%eax
  mov    %al,(%rcx)
  test   %esi,%esi
  je     L427
  movzbl 0x1(%r10),%eax
  mov    %al,0x1(%rcx)
  cmp    $0x2,%edx
  je     L427
  movzbl 0x2(%r10),%eax
  mov    %al,0x2(%rcx)
  cmp    $0x3,%edx
  je     L427
  movzbl 0x3(%r10),%eax
  mov    %al,0x3(%rcx)
  cmp    $0x4,%edx
  je     L427
  movzbl 0x4(%r10),%eax
  mov    %al,0x4(%rcx)
  cmp    $0x5,%edx
  je     L427
  movzbl 0x5(%r10),%eax
  mov    %al,0x5(%rcx)
  cmp    $0x6,%edx
  je     L427
  movzbl 0x6(%r10),%eax
  mov    %al,0x6(%rcx)
  jmp    L427
  nopl   0x0(%rax,%rax,1)
L145:
  and    $0x2,%ecx
  je     L243
  mov    %eax,%r10d
  shr    %r10d
  jmp    L375
  nopl   0x0(%rax)
L289:
  mov    %r8,%rdi
  jmp    L490
L230:
  mov    %eax,%r10d
  shr    %r10d
  je     L311
L375:
  lea    0x2(%rdx),%r9
  mov    %rdi,%rsi
  lea    -0x1(%r10),%ecx
  sub    %r9,%rsi
  cmp    $0xc,%rsi
  jbe    L196
  cmp    $0x2,%ecx
  jbe    L196
  push   %r12
  push   %rbp
  push   %rbx
  cmp    $0x6,%ecx
  jbe    L368
  mov    %r10d,%esi
  xor    %ecx,%ecx
  shr    $0x3,%esi
  shl    $0x4,%rsi
  cs nopw 0x0(%rax,%rax,1)
L43:
  movdqu (%rdx,%rcx,1),%xmm2
  movups %xmm2,(%rdi,%rcx,1)
  add    $0x10,%rcx
  cmp    %rcx,%rsi
  jne    L43
  mov    %r10d,%r9d
  mov    %r10d,%ebx
  mov    %r10d,%esi
  and    $0xfffffff8,%r9d
  and    $0x7,%ebx
  mov    %r9d,%ecx
  lea    (%rcx,%rcx,1),%r11
  lea    (%rdi,%r11,1),%rbp
  add    %rdx,%r11
  cmp    %r9d,%r10d
  je     L420
  lea    -0x1(%rbx),%r9d
  mov    %ebx,%r12d
  cmp    $0x2,%r9d
  jbe    L91
L302:
  mov    (%rdx,%rcx,2),%rsi
  mov    %r12d,%r9d
  and    $0xfffffffc,%r9d
  mov    %rsi,(%rdi,%rcx,2)
  mov    %r9d,%ecx
  sub    %r9d,%ebx
  mov    %r10d,%esi
  add    %rcx,%rcx
  add    %rcx,%rbp
  add    %rcx,%r11
  cmp    %r9d,%r12d
  je     L420
  lea    -0x1(%rbx),%r9d
L91:
  movzwl (%r11),%ecx
  mov    %r10d,%esi
  mov    %cx,0x0(%rbp)
  test   %r9d,%r9d
  je     L420
  movzwl 0x2(%r11),%ecx
  mov    %cx,0x2(%rbp)
  cmp    $0x2,%ebx
  je     L420
  movzwl 0x4(%r11),%ecx
  mov    %cx,0x4(%rbp)
L420:
  add    %rsi,%rsi
  add    %rsi,%rdx
  add    %rsi,%rdi
  test   $0x1,%al
  je     L416
  movzbl (%rdx),%eax
  mov    %al,(%rdi)
L416:
  pop    %rbx
  mov    %r8,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L288:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L103:
  movzbl (%r9,%rdx,1),%ecx
  mov    %cl,(%rdi,%rdx,1)
  add    $0x1,%rdx
  cmp    %rdx,%rax
  jne    L103
  jmp    L427
  xchg   %ax,%ax
L442:
  mov    %r11d,%esi
  xor    %ecx,%ecx
  nopl   (%rax)
L165:
  mov    (%rdx,%rcx,8),%r9
  mov    %r9,(%rdi,%rcx,8)
  add    $0x1,%rcx
  cmp    %rcx,%rsi
  jne    L165
  jmp    L60
  xchg   %ax,%ax
L196:
  mov    %r10d,%esi
  xor    %ecx,%ecx
  nopl   (%rax)
L346:
  movzwl (%rdx,%rcx,2),%r9d
  mov    %r9w,(%rdi,%rcx,2)
  add    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L346
  add    %rsi,%rsi
  add    %rsi,%rdx
  add    %rsi,%rdi
  jmp    L311
L271:
  mov    %r9,%r10
  mov    %rdi,%rcx
  mov    %eax,%edx
  xor    %r11d,%r11d
  jmp    L20
L368:
  mov    %r10d,%r12d
  mov    %rdx,%r11
  mov    %rdi,%rbp
  mov    %r10d,%ebx
  xor    %ecx,%ecx
  jmp    L302
```

assistant: ```c
void *memcpy(void *to, const void *from, unsigned int n) {
  void *xto = to;
  unsigned int temp;
  if (!n)
    return xto;
  if ((long)to & 1) {
    char *cto = to;
    const char *cfrom = from;
    *cto++ = *cfrom++;
    to = cto;
    from = cfrom;
    n--;
  }
  if ((long)from & 1) {
    char *cto = to;
    const char *cfrom = from;
    for (; n; n--)
      *cto++ = *cfrom++;
    return xto;
  }
  if (n > 2 && (long)to & 2) {
    short *sto = to;
    const short *sfrom = from;
    *sto++ = *sfrom++;
    to = sto;
    from = sfrom;
    n -= 2;
  }
  if ((long)from & 2) {
    short *sto = to;
    const short *sfrom = from;
    temp = n >> 1;
    for (; temp; temp--)
      *sto++ = *sfrom++;
    to = sto;
    from = sfrom;
    if (n & 1) {
      char *cto = to;
      const char *cfrom = from;
      *cto = *cfrom;
    }
    return xto;
  }
  temp = n >> 2;
  if (temp) {
    long *lto = to;
    const long *lfrom = from;
    for (; temp; temp--)
      *lto++ = *lfrom++;
    to = lto;
    from = lfrom;
  }
  if (n & 2) {
    short *sto = to;
    const short *sfrom = from;
    *sto++ = *sfrom++;
    to = sto;
    from = sfrom;
  }
  if (n & 1) {
    char *cto = to;
    const char *cfrom = from;
    *cto = *cfrom;
  }
  return xto;
}
```