user: Converte this assembly snippet into its equivalent C code:

```asm
<bitfill_unaligned>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    0x50(%rsp),%eax
  test   %eax,%eax
  jne    L19
L71:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  mov    %rsi,%rbx
  mov    $0xffffffffffffffff,%rsi
  mov    %rdi,%r15
  mov    %edx,%r14d
  mov    %r9d,%r13d
  mov    %rcx,%rbp
  mov    %r8d,%r12d
  call   <FB_SHIFT_HIGH@plt>
  mov    0x50(%rsp),%ecx
  xor    %edx,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  mov    $0xffffffffffffffff,%rsi
  add    %r14d,%ecx
  mov    %ecx,%eax
  mov    %ecx,0x4(%rsp)
  divl   0x58(%rsp)
  call   <FB_SHIFT_HIGH@plt>
  mov    0x4(%rsp),%ecx
  cmp    0x58(%rsp),%ecx
  not    %rax
  mov    0x8(%rsp),%r9
  mov    %rax,%r15
  ja     L69
  mov    %r9,%rax
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  and    %r15,%rax
  test   %r15,%r15
  cmovne %rax,%r9
  mov    %r9,%rdx
  call   <comp@plt>
  mov    %rax,(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L69:
  test   %r9,%r9
  jne    L108
L66:
  mov    0x50(%rsp),%eax
  xor    %edx,%edx
  divl   0x58(%rsp)
  mov    %eax,%edx
  cmp    $0x3,%eax
  jbe    L98
  lea    -0x4(%rax),%esi
  shr    $0x2,%esi
  add    $0x1,%esi
  shl    $0x5,%rsi
  add    %rbx,%rsi
  xchg   %ax,%ax
L65:
  mov    %rbp,%rdx
  mov    %r12d,%ecx
  mov    %rbp,(%rbx)
  add    $0x20,%rbx
  shl    %cl,%rdx
  mov    %r13d,%ecx
  shr    %cl,%rbp
  mov    %r12d,%ecx
  or     %rbp,%rdx
  mov    %rdx,%rbp
  mov    %rdx,-0x18(%rbx)
  shl    %cl,%rbp
  mov    %r13d,%ecx
  shr    %cl,%rdx
  mov    %r12d,%ecx
  or     %rdx,%rbp
  mov    %rbp,%rdx
  mov    %rbp,-0x10(%rbx)
  shl    %cl,%rdx
  mov    %r13d,%ecx
  shr    %cl,%rbp
  mov    %r12d,%ecx
  or     %rbp,%rdx
  mov    %rdx,%rbp
  mov    %rdx,-0x8(%rbx)
  shl    %cl,%rbp
  mov    %r13d,%ecx
  shr    %cl,%rdx
  or     %rdx,%rbp
  cmp    %rsi,%rbx
  jne    L65
  and    $0x3,%eax
  mov    %eax,%edx
L25:
  mov    %rsi,%rbx
  test   %edx,%edx
  je     L107
  lea    (%rsi,%rdx,8),%rbx
L72:
  mov    %rbp,%rax
  mov    %r12d,%ecx
  add    $0x8,%rsi
  mov    %rbp,-0x8(%rsi)
  shl    %cl,%rax
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rax,%rbp
  cmp    %rsi,%rbx
  jne    L72
L107:
  test   %r15,%r15
  je     L71
  mov    (%rbx),%rsi
  mov    %r15,%rdx
  mov    %rbp,%rdi
  call   <comp@plt>
  mov    %rax,(%rbx)
  jmp    L71
  xchg   %ax,%ax
L108:
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  mov    %r9,%rdx
  add    $0x8,%rbx
  call   <comp@plt>
  mov    %r12d,%ecx
  mov    %rax,-0x8(%rbx)
  mov    %rbp,%rax
  shl    %cl,%rax
  mov    %r13d,%ecx
  shr    %cl,%rbp
  or     %rax,%rbp
  mov    0x58(%rsp),%eax
  sub    %r14d,%eax
  sub    %eax,0x50(%rsp)
  jmp    L66
  nopl   0x0(%rax,%rax,1)
L98:
  mov    %rbx,%rsi
  jmp    L25
```

assistant: ```c
void bitfill_unaligned(struct fb_info *p, 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(p, ~0UL, dst_idx);
  last = ~(FB_SHIFT_HIGH(p, ~0UL, (dst_idx + n) % bits));
  if (dst_idx + n <= bits) {
    if (last)
      first &= last;
    *dst = comp(pat, *dst, first);
  } else {
    if (first) {
      *dst = comp(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(pat, *dst, last);
  }
}
```