user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<memmove>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  ja     L72
  mov    -0x10(%rbp),%rax
  xor    -0x8(%rbp),%rax
  and    $0x7,%eax
  test   %rax,%rax
  jne    L122
  jmp    L154
L5:
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
  subq   $0x1,-0x28(%rbp)
L154:
  cmpq   $0x0,-0x28(%rbp)
  je     L22
  mov    -0x10(%rbp),%rax
  and    $0x7,%eax
  test   %rax,%rax
  jne    L5
  jmp    L22
L43:
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rdx),%rdx
  mov    %rdx,(%rax)
  addq   $0x8,-0x10(%rbp)
  addq   $0x8,-0x8(%rbp)
  subq   $0x8,-0x28(%rbp)
L22:
  cmpq   $0x7,-0x28(%rbp)
  ja     L43
  jmp    L122
L125:
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
  subq   $0x1,-0x28(%rbp)
L122:
  cmpq   $0x0,-0x28(%rbp)
  jne    L125
  jmp    L167
L72:
  mov    -0x28(%rbp),%rax
  add    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  add    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  xor    -0x8(%rbp),%rax
  and    $0x7,%eax
  test   %rax,%rax
  jne    L18
  jmp    L78
L49:
  subq   $0x1,-0x10(%rbp)
  subq   $0x1,-0x8(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  subq   $0x1,-0x28(%rbp)
L78:
  cmpq   $0x0,-0x28(%rbp)
  je     L67
  mov    -0x10(%rbp),%rax
  and    $0x7,%eax
  test   %rax,%rax
  jne    L49
  jmp    L67
L59:
  subq   $0x8,-0x10(%rbp)
  subq   $0x8,-0x8(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rdx),%rdx
  mov    %rdx,(%rax)
  subq   $0x8,-0x28(%rbp)
L67:
  cmpq   $0x7,-0x28(%rbp)
  ja     L59
  jmp    L18
L71:
  subq   $0x1,-0x10(%rbp)
  subq   $0x1,-0x8(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  subq   $0x1,-0x28(%rbp)
L18:
  cmpq   $0x0,-0x28(%rbp)
  jne    L71
L167:
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
void *memmove(void *s1, const void *s2, size_t n) {
  uintptr_t from = (uintptr_t)s2;
  uintptr_t to = (uintptr_t)s1;
  if (to <= from) {
    if (((from ^ to) & (sizeof(uintptr_t) - 1)) == 0) {
      while (n != 0 && ((from & (sizeof(uintptr_t) - 1)) != 0)) {
        *(char *)to = *(const char *)from;
        from++;
        to++;
        n--;
      }
      while (n >= sizeof(uintptr_t)) {
        *(uintptr_t *)to = *(const uintptr_t *)from;
        from += sizeof(uintptr_t);
        to += sizeof(uintptr_t);
        n -= sizeof(uintptr_t);
      }
    }
    while (n != 0) {
      *(char *)to = *(const char *)from;
      from++;
      to++;
      n--;
    }
  } else {
    from += n;
    to += n;
    if (((from ^ to) & (sizeof(uintptr_t) - 1)) == 0) {
      while (n != 0 && ((from & (sizeof(uintptr_t) - 1)) != 0)) {
        from--;
        to--;
        *(char *)to = *(const char *)from;
        n--;
      }
      while (n >= sizeof(uintptr_t)) {
        from -= sizeof(uintptr_t);
        to -= sizeof(uintptr_t);
        *(uintptr_t *)to = *(const uintptr_t *)from;
        n -= sizeof(uintptr_t);
      }
    }
    while (n != 0) {
      from--;
      to--;
      *(char *)to = *(const char *)from;
      n--;
    }
  }
  return s1;
}
```