user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strrchr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  and    $0xfffffffffffffff8,%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x6c(%rbp),%eax
  cltq
  movabs $0x101010101010101,%rdx
  imul   %rdx,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <__insn_shl@plt>
  sub    $0x1,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  or     -0x20(%rbp),%rax
  mov    %rax,%rbx
  mov    -0x20(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <__insn_v1shrui@plt>
  and    -0x28(%rbp),%rax
  xor    %rbx,%rax
  mov    %rax,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
L57:
  mov    -0x48(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <__insn_v1cmpeqi@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__insn_v1cmpeq@plt>
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L42
  cmpq   $0x0,-0x18(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L2
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <__insn_ctz@plt>
  mov    %eax,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  mov    $0x2,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  and    %rdx,%rax
  mov    %rax,-0x38(%rbp)
L2:
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L42
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <__insn_clz@plt>
  sar    $0x3,%eax
  cltq
  mov    $0x7,%edx
  sub    %rax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
L42:
  cmpq   $0x0,-0x18(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L25
  mov    -0x40(%rbp),%rax
  jmp    L51
L25:
  addq   $0x8,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x48(%rbp)
  jmp    L57
L51:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strrchr(const char *s, int c) {
  const uintptr_t s_int = (uintptr_t)s;
  const uint64_t *p = (const uint64_t *)(s_int & -8);
  const uint64_t goal = 0x0101010101010101ULL * (uint8_t)c;
  const uint64_t before_mask = (__insn_shl(1ULL, (s_int << 3)) - 1);
  uint64_t v = (*p | before_mask) ^ (goal & __insn_v1shrui(before_mask, 1));
  const char *found = NULL;
  uint64_t zero_matches, goal_matches;
  while (1) {
    zero_matches = __insn_v1cmpeqi(v, 0);
    goal_matches = __insn_v1cmpeq(v, goal);
    if (__builtin_expect(goal_matches != 0, 0)) {
      if (__builtin_expect(zero_matches != 0, 0)) {
        int first_nul = __insn_ctz(zero_matches);
        goal_matches &= ((2ULL << first_nul) - 1);
      }
      if (__builtin_expect(goal_matches != 0, 1))
        found = ((char *)p) + 7 - (__insn_clz(goal_matches) >> 3);
    }
    if (__builtin_expect(zero_matches != 0, 0))
      return (char *)found;
    v = *++p;
  }
}
```