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

```asm
<mesh_memcpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  xor    -0x18(%rbp),%rax
  and    $0x3,%eax
  test   %rax,%rax
  jne    L180
  cmpq   $0x0,-0x28(%rbp)
  je     L222
  mov    -0x18(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  je     L222
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
L222:
  mov    -0x18(%rbp),%rax
  and    $0x2,%eax
  test   %rax,%rax
  je     L70
  cmpq   $0x1,-0x28(%rbp)
  jbe    L128
  mov    -0x18(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    (%rdx),%edx
  mov    %edx,(%rax)
  addq   $0x2,-0x18(%rbp)
  addq   $0x8,-0x10(%rbp)
  subq   $0x2,-0x28(%rbp)
  jmp    L70
L128:
  cmpq   $0x1,-0x28(%rbp)
  jne    L70
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
L70:
  mov    -0x28(%rbp),%rax
  and    $0xfffffffffffffffc,%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L30
L182:
  mov    -0x8(%rbp),%rax
  sub    -0x20(%rbp),%rax
  cmp    $0x7,%rax
  jbe    L50
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x8,-0x18(%rbp)
  addq   $0x20,-0x10(%rbp)
  subq   $0x8,-0x28(%rbp)
  addq   $0x8,-0x20(%rbp)
  jmp    L30
L50:
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x4,-0x18(%rbp)
  addq   $0x10,-0x10(%rbp)
  subq   $0x4,-0x28(%rbp)
  addq   $0x8,-0x20(%rbp)
L30:
  mov    -0x20(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L182
  cmpq   $0x3,-0x28(%rbp)
  je     L247
  cmpq   $0x3,-0x28(%rbp)
  ja     L16
  cmpq   $0x1,-0x28(%rbp)
  je     L88
  cmpq   $0x2,-0x28(%rbp)
  jne    L16
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x2,-0x18(%rbp)
  addq   $0x8,-0x10(%rbp)
  subq   $0x2,-0x28(%rbp)
  jmp    L16
L247:
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x2,-0x18(%rbp)
  addq   $0x8,-0x10(%rbp)
  subq   $0x2,-0x28(%rbp)
L88:
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
  jmp    L16
L180:
  mov    -0x10(%rbp),%rax
  xor    -0x18(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  jne    L126
  cmpq   $0x0,-0x28(%rbp)
  je     L153
  mov    -0x18(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  je     L153
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
  jmp    L153
L217:
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x2,-0x18(%rbp)
  addq   $0x8,-0x10(%rbp)
  subq   $0x2,-0x28(%rbp)
L153:
  cmpq   $0x1,-0x28(%rbp)
  ja     L217
  cmpq   $0x0,-0x28(%rbp)
  je     L16
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
  jmp    L16
L57:
  mov    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mesh_write@plt>
  addq   $0x1,-0x18(%rbp)
  addq   $0x4,-0x10(%rbp)
  subq   $0x1,-0x28(%rbp)
L126:
  cmpq   $0x0,-0x28(%rbp)
  jne    L57
L16:
  cmpq   $0x0,-0x28(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x18(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  cmp    %rax,%rdx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  nop
  leave
  ret
```

assistant: ```c
void mesh_memcpy(uintptr_t dst, const void *__restrict__ src, size_t size) {
  size_t n, aligned_n, i;
  uintptr_t d;
  const uint8_t *s;
  n = size;
  d = dst;
  s = (const uint8_t *)src;
  if (!(((uintptr_t)d ^ (uintptr_t)s) & 3)) {
    if (n && (((uintptr_t)d) & 1)) {
      mesh_write(d, s, 1);
      d++;
      s++;
      n--;
    }
    if (((uintptr_t)d) & 2) {
      if (n > 1) {
        *((uint16_t *)d) = *((const uint16_t *)s);
        d += 2;
        s += 2;
        n -= 2;
      } else if (n == 1) {
        mesh_write(d, s, 1);
        d++;
        s++;
        n--;
      }
    }
    aligned_n = n & (~3);
    for (i = 0; i < aligned_n;) {
      if (aligned_n - i >= 8) {
        mesh_write(d, s, 8);
        d += 8, s += 8, n -= 8, i += 8;
      } else {
        mesh_write(d, s, 4);
        d += 4, s += 4, n -= 4, i += 8;
      }
    }
    switch (n) {
    case 2:
      mesh_write(d, s, 2);
      d += 2;
      s += 2;
      n -= 2;
      break;
    case 3:
      mesh_write(d, s, 2);
      d += 2;
      s += 2;
      n -= 2;
    case 1:
      mesh_write(d, s, 1);
      d++;
      s++;
      n--;
    }
  } else if (!(((uintptr_t)d ^ (uintptr_t)s) & 1)) {
    if (n && ((uintptr_t)d) & 1) {
      mesh_write(d, s, 1);
      d++;
      s++;
      n--;
    }
    while (n > 1) {
      mesh_write(d, s, 2);
      d += 2;
      s += 2;
      n -= 2;
    }
    if (n) {
      mesh_write(d, s, 1);
      d++;
      s++;
      n--;
    }
  } else {
    while (n) {
      mesh_write(d, s, 1);
      d++;
      s++;
      n--;
    }
  }
  assert(n == 0);
  assert((uintptr_t)dst + size == (uintptr_t)d);
  assert((uintptr_t)src + size == (uintptr_t)s);
}
```