user: 请从给定的汇编指令推导出C源代码:

```asm
<bitfill_unaligned_rev>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %r9d,-0x30(%rbp)
  cmpl   $0x0,-0x30(%rbp)
  je     L26
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  mov    $0xffffffffffffffff,%rdi
  call   <FB_SHIFT_HIGH@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  mov    0x10(%rbp),%ecx
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%eax
  mov    %eax,%esi
  mov    $0xffffffffffffffff,%rdi
  call   <FB_SHIFT_HIGH@plt>
  not    %rax
  mov    %rax,-0x8(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %eax,%edx
  mov    0x10(%rbp),%eax
  cmp    %eax,%edx
  ja     L88
  cmpq   $0x0,-0x8(%rbp)
  je     L16
  mov    -0x8(%rbp),%rax
  and    %rax,-0x10(%rbp)
L16:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  xor    -0x28(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <comp@plt>
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  jmp    L24
L88:
  cmpq   $0x0,-0x10(%rbp)
  je     L3
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  xor    -0x28(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <comp@plt>
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  addq   $0x8,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
  mov    0x10(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  sub    %eax,-0x30(%rbp)
L3:
  mov    0x10(%rbp),%edi
  mov    -0x30(%rbp),%eax
  mov    $0x0,%edx
  div    %edi
  mov    %eax,-0x30(%rbp)
  jmp    L91
L93:
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rdx
  xor    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rdx
  xor    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rdx
  xor    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rdx
  xor    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
  subl   $0x4,-0x30(%rbp)
L91:
  cmpl   $0x3,-0x30(%rbp)
  ja     L93
  jmp    L21
L81:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  xor    -0x28(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x2c(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  or     %rsi,%rax
  mov    %rax,-0x28(%rbp)
L21:
  mov    -0x30(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  test   %eax,%eax
  jne    L81
  cmpq   $0x0,-0x8(%rbp)
  je     L24
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  xor    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <comp@plt>
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  jmp    L24
L26:
  nop
L24:
  leave
  ret
```

assistant: ```c
void bitfill_unaligned_rev(unsigned long *dst, int dst_idx, unsigned long pat, int left, int right, unsigned n, int bits) {
  unsigned long first, last;
  if (!n)
    return;
  first = FB_SHIFT_HIGH(~0UL, dst_idx);
  last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx + n) % bits));
  if (dst_idx + n <= bits) {
    if (last)
      first &= last;
    *dst = comp(*dst ^ pat, *dst, first);
  } else {
    if (first != 0UL) {
      *dst = comp(*dst ^ pat, *dst, first);
      dst++;
      pat = pat << left | pat >> right;
      n -= bits - dst_idx;
    }
    n /= bits;
    while (n >= 4) {
      *dst++ ^= pat;
      pat = pat << left | pat >> right;
      *dst++ ^= pat;
      pat = pat << left | pat >> right;
      *dst++ ^= pat;
      pat = pat << left | pat >> right;
      *dst++ ^= pat;
      pat = pat << left | pat >> right;
      n -= 4;
    }
    while (n--) {
      *dst ^= pat;
      pat = pat << left | pat >> right;
    }
    if (last)
      *dst = comp(*dst ^ pat, *dst, last);
  }
}
```