+ // The squares occupied by enemy pieces (not defended by pawns) will be
+ // counted two times instead of one. The shift (almost) guarantees that
+ // intersection of the shifted value with b is zero so that after or-ing
+ // the count of 1s bits is increased by the number of affected squares.
+ b |= Us == WHITE ? ((b & pos.pieces_of_color(Them)) >> 1)
+ : ((b & pos.pieces_of_color(Them)) << 1);
+