user: 请将以下的汇编代码转换成C语言代码:

```asm
<bitcpy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rdi,(%rsp)
  mov    %esi,%r14d
  mov    %rdx,%rbp
  mov    %rdx,0x8(%rsp)
  mov    %ecx,%r15d
  mov    %r8,%rbx
  call   <assert@plt>
  mov    %ebp,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    %r14d,%r12d
  sar    $0x3,%r12d
  movslq %r12d,%r12
  add    %r13,%r12
  mov    %r15d,%eax
  sar    $0x3,%r15d
  movslq %r15d,%r15
  add    %rbp,%r15
  mov    %r14d,%ebp
  and    $0x7,%ebp
  mov    %eax,%r13d
  and    $0x7,%r13d
  or     %eax,%r14d
  test   $0x7,%r14b
  jne    L67
  test   $0x7,%bl
  je     L63
L67:
  movslq %r13d,%rax
  add    %rbx,%rax
  cmp    $0x37,%rax
  jbe    L15
  cmp    %r13d,%ebp
  je     L48
L60:
  test   %ebp,%ebp
  jne    L32
  test   $0x3,%r12b
  je     L40
L32:
  lea    0x0(,%r12,8),%eax
  and    $0x18,%eax
  or     %ebp,%eax
  mov    $0x20,%edx
  sub    %eax,%edx
  mov    %edx,%r14d
  movslq %edx,%rax
  mov    %rax,(%rsp)
  cmp    %rbx,%rax
  setb   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %r15,%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <_bitcpy_short@plt>
  add    %r14d,%ebp
  add    %r14d,%r13d
  sub    (%rsp),%rbx
L40:
  mov    %ebp,%r14d
  sar    $0x3,%r14d
  movslq %r14d,%r14
  add    %r12,%r14
  mov    %r13d,%r12d
  sar    $0x3,%r12d
  movslq %r12d,%r12
  add    %r15,%r12
  and    $0x7,%ebp
  lea    0x0(,%r14,8),%esi
  and    $0x18,%esi
  and    $0x7,%r13d
  lea    0x0(,%r12,8),%eax
  and    $0x18,%eax
  or     %eax,%r13d
  and    $0xfffffffffffffffc,%r14
  and    $0xfffffffffffffffc,%r12
  or     %esi,%ebp
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    %ebx,%r15d
  and    $0xffffffe0,%r15d
  jne    L76
L26:
  lea    0x0(%rbp,%r15,1),%edi
  lea    0x0(%r13,%r15,1),%edx
  mov    %r13d,%ecx
  and    $0x7,%ecx
  sar    $0x3,%edx
  movslq %edx,%rdx
  add    %r12,%rdx
  mov    %ebp,%esi
  and    $0x7,%esi
  sar    $0x3,%edi
  movslq %edi,%rdi
  add    %r14,%rdi
  mov    %ebx,%r8d
  sub    %r15d,%r8d
  call   <_bitcpy_short@plt>
L86:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L63:
  mov    %rbx,%rdx
  shr    $0x3,%rdx
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  call   <memcpy@plt>
  jmp    L67
L15:
  mov    %ebx,%r8d
  mov    %r13d,%ecx
  mov    %r15,%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <_bitcpy_short@plt>
  jmp    L86
L48:
  mov    $0x8,%r14d
  sub    %r13d,%r14d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %r15,%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <_bitcpy_short@plt>
  add    $0x1,%r12
  add    $0x1,%r15
  movslq %r14d,%r14
  sub    %r14,%rbx
  mov    %rbx,%r14
  shr    $0x3,%r14
  mov    %r14d,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  movslq %r14d,%r14
  lea    (%r14,%r15,1),%rdx
  lea    (%r14,%r12,1),%rdi
  mov    %ebx,%r8d
  and    $0x7,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%esi
  call   <_bitcpy_short@plt>
  jmp    L60
L76:
  mov    %r15d,%eax
  sar    $0x5,%eax
  cltq
  lea    (%r12,%rax,4),%rcx
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <_bitcpy_aligned@plt>
  jmp    L26
```

assistant: ```c
void bitcpy(void *dest, int destn, const void *src, int srcn, size_t nbits) {
  assert(dest);
  assert(src);
  assert(0 <= nbits);
  uintptr_t a = (uintptr_t)dest;
  uintptr_t b = (uintptr_t)src;
  a += destn >> 3;
  b += srcn >> 3;
  destn &= 7;
  srcn &= 7;
  if (!destn && !srcn && !(nbits & 7)) {
    memcpy(dest, src, nbits >> 3);
  }
  if (srcn + nbits < 56) {
    _bitcpy_short((unsigned char *)a, destn, (unsigned char *)b, srcn, (int)nbits);
    return;
  }
  if (srcn == destn) {
    int m = 8 - srcn;
    _bitcpy_short((unsigned char *)a, destn, (unsigned char *)b, srcn, m);
    ++a;
    ++b;
    nbits -= m;
    int p = (int)(nbits >> 3);
    memcpy((void *)a, (void *)b, p);
    _bitcpy_short((unsigned char *)a + p, 0, (unsigned char *)b + p, 0, nbits & 7);
  }
  int m = 0;
  if (destn || (a & 3)) {
    m = (int)(32 - (destn + ((a & 3) << 3)));
    assert(m < nbits);
    _bitcpy_short((unsigned char *)a, destn, (unsigned char *)b, srcn, m);
    destn += m;
    srcn += m;
    nbits -= m;
  }
  a += destn >> 3;
  b += srcn >> 3;
  destn = (destn & 7) | (((int)a & 3) << 3);
  srcn = (srcn & 7) | (((int)b & 3) << 3);
  a &= ~3;
  b &= ~3;
  assert(!destn);
  assert((0 <= srcn) && (srcn < 32));
  int p = (int)nbits & ~31;
  if (p) {
    _bitcpy_aligned((int *)a, (const int *)b, srcn, ((const int *)b) + (p >> 5));
  }
  nbits -= p;
  destn += p;
  srcn += p;
  a += destn >> 3;
  b += srcn >> 3;
  destn &= 7;
  srcn &= 7;
  _bitcpy_short((unsigned char *)a, destn, (unsigned char *)b, srcn, (int)nbits);
}
```