user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fgen_copy_partial_bitstring>:
  endbr64
  test   %ecx,%ecx
  je     L328
  test   %edx,%edx
  lea    0x7(%rdx),%r9d
  push   %rbp
  mov    %ecx,%eax
  cmovns %edx,%r9d
  push   %rbx
  mov    %rdi,%r8
  sar    $0x3,%r9d
  mov    %r9d,%ecx
  and    $0x7,%edx
  je     L437
  movslq %r9d,%r11
  mov    %edx,%ecx
  mov    %eax,%ebp
  lea    (%rsi,%r11,1),%r10
  add    %rdi,%r11
  mov    $0x1,%edi
  mov    %edi,%ebx
  shl    %cl,%ebx
  mov    %ebx,%ecx
  not    %ebx
  and    (%r10),%bl
  mov    %bl,(%r10)
  and    (%r11),%cl
  or     %ecx,%ebx
  mov    %bl,(%r10)
  sub    $0x1,%ebp
  je     L116
  lea    0x1(%rdx),%ecx
  cmp    $0x7,%edx
  je     L271
  mov    %edi,%ebp
  shl    %cl,%ebp
  mov    %ebp,%ecx
  not    %ebp
  and    %ebp,%ebx
  mov    %eax,%ebp
  mov    %bl,(%r10)
  and    (%r11),%cl
  or     %ecx,%ebx
  mov    %bl,(%r10)
  sub    $0x2,%ebp
  je     L116
  lea    0x2(%rdx),%ecx
  cmp    $0x6,%edx
  je     L271
  mov    %edi,%ebp
  shl    %cl,%ebp
  mov    %ebp,%ecx
  not    %ebp
  and    %ebp,%ebx
  mov    %eax,%ebp
  mov    %bl,(%r10)
  and    (%r11),%cl
  or     %ecx,%ebx
  mov    %bl,(%r10)
  sub    $0x3,%ebp
  je     L116
  lea    0x3(%rdx),%ecx
  cmp    $0x5,%edx
  je     L271
  shl    %cl,%edi
  mov    %edi,%ecx
  not    %edi
  and    %ebx,%edi
  mov    %eax,%ebx
  mov    %dil,(%r10)
  and    (%r11),%cl
  or     %ecx,%edi
  mov    %dil,(%r10)
  sub    $0x4,%ebx
  je     L116
  lea    0x4(%rdx),%ecx
  cmp    $0x4,%edx
  je     L382
  mov    $0x1,%ebx
  mov    %ebx,%ebp
  shl    %cl,%ebp
  mov    %ebp,%ecx
  not    %ebp
  and    %ebp,%edi
  mov    %eax,%ebp
  mov    %dil,(%r10)
  and    (%r11),%cl
  or     %ecx,%edi
  mov    %dil,(%r10)
  sub    $0x5,%ebp
  je     L116
  lea    0x5(%rdx),%ecx
  cmp    $0x3,%edx
  je     L271
  shl    %cl,%ebx
  mov    %ebx,%edx
  not    %edx
  and    %edi,%edx
  mov    %dl,(%r10)
  and    (%r11),%bl
  or     %edx,%ebx
  mov    %eax,%edx
  mov    %bl,(%r10)
  sub    $0x6,%edx
  je     L116
  cmp    $0x6,%ecx
  jne    L290
  and    $0x7f,%ebx
  mov    %bl,(%r10)
  movzbl (%r11),%edx
  and    $0xffffff80,%edx
  or     %ebx,%edx
  mov    %dl,(%r10)
  sub    $0x7,%eax
  je     L116
L26:
  lea    0x1(%r9),%ecx
L437:
  cmp    $0x7,%eax
  jle    L187
  movslq %ecx,%rdx
  lea    (%rsi,%rdx,1),%rdi
  and    $0x3,%edi
  je     L138
  lea    0x1(%rsi),%r9d
  jmp    L414
  nop
L46:
  add    %r9d,%edi
  add    $0x1,%rdx
  and    $0x3,%edi
  je     L138
L414:
  movzbl (%r8,%rdx,1),%ecx
  sub    $0x8,%eax
  mov    %edx,%edi
  mov    %cl,(%rsi,%rdx,1)
  lea    0x1(%rdx),%ecx
  cmp    $0x7,%eax
  jg     L46
L187:
  test   %eax,%eax
  jle    L116
  movslq %ecx,%rcx
  add    %rcx,%rsi
  add    %r8,%rcx
  movzbl (%rsi),%edi
  and    $0xfffffffe,%edi
  mov    %dil,(%rsi)
  movzbl (%rcx),%edx
  and    $0x1,%edx
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x1,%eax
  je     L116
  and    $0xfffffffd,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%edi
  and    $0x2,%edi
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x2,%eax
  je     L116
  and    $0xfffffffb,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%edi
  and    $0x4,%edi
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x3,%eax
  je     L116
  and    $0xfffffff7,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%edi
  and    $0x8,%edi
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x4,%eax
  je     L116
  and    $0xffffffef,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%edi
  and    $0x10,%edi
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x5,%eax
  je     L116
  and    $0xffffffdf,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%edi
  and    $0x20,%edi
  or     %edi,%edx
  mov    %dl,(%rsi)
  cmp    $0x6,%eax
  je     L116
  and    $0xffffffbf,%edx
  mov    %dl,(%rsi)
  movzbl (%rcx),%eax
  and    $0x40,%eax
  or     %edx,%eax
  mov    %al,(%rsi)
L116:
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L328:
  ret
  nopl   0x0(%rax)
L138:
  mov    %eax,%edx
  cmp    $0x1f,%eax
  jle    L380
  movslq %ecx,%rdx
  lea    (%rsi,%rdx,1),%r10
  lea    0x4(%rdx),%rdi
  lea    (%r8,%rdi,1),%r11
  mov    %r10,%r9
  sub    %r11,%r9
  cmp    $0x8,%r9
  jbe    L304
  cmp    $0x7f,%eax
  jle    L304
  lea    -0x20(%rax),%r11d
  lea    (%r8,%rdx,1),%rdi
  xor    %edx,%edx
  mov    %r11d,%ebx
  shr    $0x5,%ebx
  add    $0x1,%ebx
  mov    %ebx,%r9d
  shr    $0x2,%r9d
  shl    $0x4,%r9
  nopl   0x0(%rax)
L388:
  movdqu (%rdi,%rdx,1),%xmm0
  movups %xmm0,(%r10,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%r9
  jne    L388
  mov    %ebx,%edi
  mov    %eax,%r9d
  and    $0xfffffffc,%edi
  mov    %edi,%edx
  shl    $0x5,%edx
  sub    %edx,%r9d
  lea    (%rcx,%rdi,4),%edx
  cmp    %edi,%ebx
  je     L32
  movslq %edx,%rdi
  mov    (%r8,%rdi,1),%r10d
  mov    %r10d,(%rsi,%rdi,1)
  lea    -0x20(%r9),%r10d
  lea    0x4(%rdx),%edi
  cmp    $0x1f,%r10d
  jle    L32
  movslq %edi,%rdi
  add    $0x8,%edx
  mov    (%r8,%rdi,1),%r10d
  mov    %r10d,(%rsi,%rdi,1)
  cmp    $0x5f,%r9d
  jle    L32
  movslq %edx,%rdx
  mov    (%r8,%rdx,1),%edi
  mov    %edi,(%rsi,%rdx,1)
L32:
  mov    %r11d,%edi
  xor    %r9d,%r9d
  shr    $0x5,%edi
  mov    %edi,%edx
  neg    %edx
  shl    $0x5,%edx
  cmp    $0x1f,%eax
  cmovle %r9d,%edx
  shl    $0x2,%edi
  add    %r11d,%edx
  cmp    $0x1f,%eax
  cmovle %r9d,%edi
  mov    %edx,%eax
  lea    0x4(%rcx,%rdi,1),%ecx
  cmp    $0x7,%edx
  jle    L187
L380:
  movslq %ecx,%rax
  lea    0x1(%rcx),%r10d
  movzbl (%r8,%rax,1),%edi
  mov    %dil,(%rsi,%rax,1)
  lea    -0x8(%rdx),%edi
  cmp    $0x7,%edi
  jle    L1
  movslq %r10d,%rax
  add    $0x2,%ecx
  movzbl (%r8,%rax,1),%r9d
  mov    %r9b,(%rsi,%rax,1)
  cmp    $0x17,%edx
  jle    L1
  movslq %ecx,%rcx
  movzbl (%r8,%rcx,1),%eax
  mov    %al,(%rsi,%rcx,1)
L1:
  mov    %edi,%ecx
  xor    %r9d,%r9d
  shr    $0x3,%ecx
  mov    %ecx,%eax
  neg    %eax
  shl    $0x3,%eax
  cmp    $0x7,%edx
  cmovle %r9d,%eax
  add    %edi,%eax
  cmp    $0x7,%edx
  cmovle %r9d,%ecx
  add    %r10d,%ecx
  jmp    L187
  nopl   0x0(%rax)
L271:
  mov    %ebp,%eax
  jmp    L26
L382:
  mov    %ebx,%eax
  jmp    L26
L290:
  mov    %edx,%eax
  jmp    L26
L304:
  mov    %eax,%r9d
  jmp    L199
  nopw   0x0(%rax,%rax,1)
L361:
  add    $0x4,%rdi
L199:
  mov    (%r8,%rdx,1),%r10d
  sub    $0x20,%r9d
  mov    %r10d,(%rsi,%rdx,1)
  mov    %rdi,%rdx
  cmp    $0x1f,%r9d
  jg     L361
  lea    -0x20(%rax),%r11d
  jmp    L32
```

assistant: ```c
void fgen_copy_partial_bitstring(const unsigned char *src, unsigned char *dest, int bitoffset, int number_of_bits) {
  int i, offset;
  if (number_of_bits == 0)
    return;
  offset = bitoffset / 8;
  if ((bitoffset & 7) != 0) {
    for (i = bitoffset & 7; i < 8; i++) {
      dest[offset] &= ~(1 << i);
      dest[offset] |= src[offset] & (1 << i);
      number_of_bits--;
      if (number_of_bits == 0)
        return;
    }
    offset++;
  }
  while (number_of_bits >= 8 && (((unsigned int)(&dest[offset])) & 3) != 0) {
    dest[offset] = src[offset];
    number_of_bits -= 8;
    offset++;
  }
  while (number_of_bits >= 32) {
    *(unsigned int *)&dest[offset] = *(unsigned int *)&src[offset];
    number_of_bits -= 32;
    offset += 4;
  }
  while (number_of_bits >= 8) {
    dest[offset] = src[offset];
    number_of_bits -= 8;
    offset++;
  }
  for (i = 0; i < number_of_bits; i++) {
    dest[offset] &= ~(1 << i);
    dest[offset] |= src[offset] & (1 << i);
  }
}
```