factor new code out to a SimplifyBranchOnICmpChain helper function.