+ // Reduced depth of the next LMR search
+ int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount), 0);
+
+ if ( !captureOrPromotion
+ && !givesCheck)
+ {
+ // Countermoves based pruning (~20 Elo)
+ if ( lmrDepth < 4 + ((ss-1)->statScore > 0 || (ss-1)->moveCount == 1)
+ && (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold
+ && (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold)
+ continue;
+
+ // Futility pruning: parent node (~5 Elo)
+ if ( lmrDepth < 8
+ && !ss->inCheck
+ && ss->staticEval + 284 + 188 * lmrDepth <= alpha
+ && (*contHist[0])[movedPiece][to_sq(move)]
+ + (*contHist[1])[movedPiece][to_sq(move)]
+ + (*contHist[3])[movedPiece][to_sq(move)]
+ + (*contHist[5])[movedPiece][to_sq(move)] / 2 < 28388)
+ continue;
+
+ // Prune moves with negative SEE (~20 Elo)
+ if (!pos.see_ge(move, Value(-(29 - std::min(lmrDepth, 17)) * lmrDepth * lmrDepth)))
+ continue;
+ }
+ else
+ {
+ // Capture history based pruning when the move doesn't give check
+ if ( !givesCheck
+ && lmrDepth < 1
+ && captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0)
+ continue;
+
+ // Futility pruning for captures
+ if ( !givesCheck
+ && lmrDepth < 6
+ && !(PvNode && abs(bestValue) < 2)
+ && PieceValue[MG][type_of(movedPiece)] >= PieceValue[MG][type_of(pos.piece_on(to_sq(move)))]
+ && !ss->inCheck
+ && ss->staticEval + 178 + 261 * lmrDepth
+ + PieceValue[MG][type_of(pos.piece_on(to_sq(move)))] <= alpha)
+ continue;
+
+ // See based pruning
+ if (!pos.see_ge(move, Value(-202) * depth)) // (~25 Elo)
+ continue;
+ }
+ }