+ // Add a small bonus for safe pawn pushes
+ b = pos.pieces(Us, PAWN) & ~TRank7BB;
+ b = shift_bb<Up>(b | (shift_bb<Up>(b & TRank2BB) & ~pos.pieces()));
+
+ b &= ~pos.pieces()
+ & ~ei.attackedBy[Them][PAWN]
+ & (ei.attackedBy[Us][ALL_PIECES] | ~ei.attackedBy[Them][ALL_PIECES]);
+
+ if (b)
+ score += popcount<Full>(b) * PawnSafePush;
+
+ // Add another bonus if the pawn push attacks an enemy piece
+ b = (shift_bb<Left>(b) | shift_bb<Right>(b))
+ & pos.pieces(Them)
+ & ~ei.attackedBy[Us][PAWN];
+
+ if (b)
+ score += popcount<Max15>(b) * PawnAttackThreat;
+