(FUNCTION_NAME): Optimize an `if' if MAX_NEEDED_FROM > 1 && MAX_NEEDED_TO > 1.