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

```asm
<bitfill_unaligned_rev>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0x18(%rsp)
  test   %r9d,%r9d
  jne    L107
L74:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L107:
  mov    %rdi,%rbx
  mov    %esi,%r15d
  mov    %rdx,%rbp
  mov    %ecx,%r12d
  mov    %r8d,%r13d
  mov    %r9d,%r14d
  mov    $0xffffffffffffffff,%rdi
  call   <FB_SHIFT_HIGH@plt>
  mov    %rax,0x8(%rsp)
  add    %r14d,%r15d
  mov    0x60(%rsp),%esi
  mov    %esi,0x1c(%rsp)
  mov    %r15d,%eax
  mov    $0x0,%edx
  div    %esi
  mov    %edx,%esi
  mov    $0xffffffffffffffff,%rdi
  call   <FB_SHIFT_HIGH@plt>
  mov    %rax,%rsi
  not    %rsi
  mov    %rsi,0x10(%rsp)
  cmp    0x60(%rsp),%r15d
  ja     L84
  mov    0x8(%rsp),%rdi
  mov    %rdi,%rax
  and    %rsi,%rax
  test   %rsi,%rsi
  cmove  %rdi,%rax
  mov    %rax,%rdx
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  xor    %rsi,%rdi
  call   <comp@plt>
  mov    %rax,(%rbx)
  jmp    L74
L84:
  cmpq   $0x0,0x8(%rsp)
  jne    L106
L12:
  mov    %r14d,%eax
  mov    $0x0,%edx
  divl   0x1c(%rsp)
  mov    %eax,%edx
  cmp    $0x3,%eax
  jbe    L58
  lea    -0x4(%rax),%esi
  shr    $0x2,%esi
  add    $0x1,%esi
  mov    %esi,%esi
  shl    $0x5,%rsi
  add    %rbx,%rsi
L27:
  xor    %rbp,(%rbx)
  mov    %rbp,%rdi
  mov    %r12d,%ecx
  shl    %cl,%rdi
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rbp,%rdi
  xor    %rdi,0x8(%rbx)
  mov    %rdi,%rbp
  mov    %r12d,%ecx
  shl    %cl,%rbp
  mov    %r13d,%ecx
  shr    %cl,%rdi
  or     %rdi,%rbp
  xor    %rbp,0x10(%rbx)
  mov    %rbp,%rdx
  mov    %r12d,%ecx
  shl    %cl,%rdx
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rbp,%rdx
  add    $0x20,%rbx
  xor    %rdx,-0x8(%rbx)
  mov    %rdx,%rbp
  mov    %r12d,%ecx
  shl    %cl,%rbp
  mov    %r13d,%ecx
  shr    %cl,%rdx
  or     %rdx,%rbp
  cmp    %rbx,%rsi
  jne    L27
  and    $0x3,%eax
  mov    %eax,%edx
L58:
  lea    -0x1(%rdx),%eax
  test   %edx,%edx
  je     L63
  mov    (%rbx),%rdx
L80:
  xor    %rbp,%rdx
  mov    %rbp,%rsi
  mov    %r12d,%ecx
  shl    %cl,%rsi
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rsi,%rbp
  sub    $0x1,%eax
  cmp    $0xffffffff,%eax
  jne    L80
  mov    %rdx,(%rbx)
L63:
  cmpq   $0x0,0x10(%rsp)
  je     L74
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  xor    %rsi,%rdi
  mov    0x10(%rsp),%rdx
  call   <comp@plt>
  mov    %rax,(%rbx)
  jmp    L74
L106:
  mov    (%rbx),%rsi
  mov    %rsi,%rdi
  xor    %rbp,%rdi
  mov    0x8(%rsp),%rdx
  call   <comp@plt>
  mov    %rax,(%rbx)
  add    $0x8,%rbx
  mov    %rbp,%rax
  mov    %r12d,%ecx
  shl    %cl,%rax
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rax,%rbp
  mov    0x60(%rsp),%eax
  sub    0x18(%rsp),%eax
  sub    %eax,%r14d
  jmp    L12
```

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);
  }
}
```