Brendan Gregg’s Brilliant Jerks in Engineering is an excellent discussion of the "No Asshole Rule" applied to software engineers.
He posits two kinds of brilliant jerks, the selfless and the selfish. You might call them unempathic and sociopathic, respectively. The former, if they develop some emotional intelligence, are worth saving. The latter are simply toxic and probably need to be fired.