extract out shared isl_multi_*_check_range