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

```asm
<flip_D1>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  movabs $0x101010101010,%rdi
  and    %rbp,%rdi
  movabs $0x10101010101000,%rbx
  and    %rsi,%rbx
  movabs $0xfefefefefefe000,%rax
  or     %rax,%rbx
  mov    %rdi,%rax
  shl    $0x8,%rax
  add    %rax,%rbx
  movabs $0x1000000000000000,%rax
  and    %rax,%rbx
  jne    L64
L59:
  movabs $0x40201000000,%rdi
  and    %rbp,%rdi
  movabs $0x8040200000000,%rax
  and    %r12,%rax
  movabs $0xff7fbfc00000000,%rdx
  or     %rdx,%rax
  mov    %rdi,%rdx
  shl    $0x9,%rdx
  lea    (%rax,%rdx,1),%rax
  shr    $0x3c,%rax
  jne    L81
L76:
  movabs $0x408000000000,%rdi
  and    %rbp,%rdi
  movabs $0x20400000000000,%rax
  and    %r12,%rax
  movabs $0xfdf800000000000,%rdx
  or     %rdx,%rax
  mov    %rdi,%rdx
  shl    $0x7,%rdx
  lea    (%rax,%rdx,1),%rax
  shr    $0x3c,%rax
  jne    L77
L11:
  movabs $0x700000000000000,%rdi
  and    %rbp,%rdi
  lea    (%r12,%rdi,2),%rax
  bt     $0x3c,%rax
  jb     L74
L61:
  movabs $0x2000000000000000,%rax
  add    %r12,%rax
  and    %rbp,%rax
  movabs $0xc000000000000000,%rdx
  and    %rdx,%rax
  je     L21
  movabs $0xe000000000000000,%rdx
  lea    (%rax,%rdx,1),%rax
  or     %rax,%rbx
L21:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L64:
  call   <last_bit@plt>
  mov    $0x2,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  movabs $0x1000000000000000,%rbx
  sub    %rdx,%rbx
  movabs $0x10101010101000,%rax
  and    %rax,%rbx
  jmp    L59
L81:
  call   <last_bit@plt>
  mov    $0x2,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  movabs $0x1000000000000000,%rax
  sub    %rdx,%rax
  movabs $0x8040200000000,%rdx
  and    %rdx,%rax
  or     %rax,%rbx
  jmp    L76
L77:
  call   <last_bit@plt>
  mov    $0x2,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  movabs $0x1000000000000000,%rax
  sub    %rdx,%rax
  movabs $0x20400000000000,%rdx
  and    %rdx,%rax
  or     %rax,%rbx
  jmp    L11
L74:
  call   <last_bit@plt>
  mov    $0x2,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  movabs $0x1000000000000000,%rax
  sub    %rdx,%rax
  or     %rax,%rbx
  jmp    L61
```

assistant: ```c
unsigned long long flip_D1(const unsigned long long discs_player, const unsigned long long discs_opponent) {
  unsigned long long my_discs, opp_discs, r, flipped = 0ULL;
  my_discs = discs_player & 0X0000101010101010ULL;
  opp_discs = (discs_opponent & 0X0010101010101000ULL) | 0X0FEFEFEFEFEFE000ULL;
  r = ((my_discs << 8) + opp_discs) & 0X1000000000000000ULL;
  if (r != 0) {
    flipped |= (0X1000000000000000ULL - (0X2ULL << last_bit(my_discs))) & 0X0010101010101000ULL;
  }
  my_discs = discs_player & 0X0000040201000000ULL;
  opp_discs = (discs_opponent & 0X0008040200000000ULL) | 0X0FF7FBFC00000000ULL;
  r = ((my_discs << 9) + opp_discs) & 0X1000000000000000ULL;
  if (r != 0) {
    flipped |= (0X1000000000000000ULL - (0X2ULL << last_bit(my_discs))) & 0X0008040200000000ULL;
  }
  my_discs = discs_player & 0X0000408000000000ULL;
  opp_discs = (discs_opponent & 0X0020400000000000ULL) | 0X0FDF800000000000ULL;
  r = ((my_discs << 7) + opp_discs) & 0X1000000000000000ULL;
  if (r != 0) {
    flipped |= (0X1000000000000000ULL - (0X2ULL << last_bit(my_discs))) & 0X0020400000000000ULL;
  }
  my_discs = discs_player & 0X0700000000000000ULL;
  r = ((my_discs << 1) + discs_opponent) & 0X1000000000000000ULL;
  if (r != 0) {
    flipped |= 0X1000000000000000ULL - (0X2ULL << last_bit(my_discs));
  }
  my_discs = discs_player & 0XC000000000000000ULL;
  r = (discs_opponent + 0X2000000000000000ULL) & my_discs;
  if (r != 0) {
    flipped |= (r - 1) & 0XE000000000000000ULL;
  }
  return flipped;
}
```