You stated the condition for a match as ($A & $B) == 1 where
$A and $B are (64-bit, unsigned) integers.
Let $As = $A >> 1 and $Bs = $B >> 1.
Isn't then the original condition equivalent to ($As & $Bs) == 0 ?
For a given $A (and $As), what other $B (and $Bs) does satisfy that condition than $Bs = ~$As?