private static int compareVectorRegisters(Register reg1, Register reg2) {
		if (!(reg1.isVectorRegister() && reg2.isVectorRegister())) {
			throw new IllegalArgumentException(
				"compareVectorRegisters can only be applied to vector registers!");
		}
		//want registers sorted in descending order of size
		int sizeComp = Integer.compare(reg2.getBitLength(), reg1.getBitLength());
		if (sizeComp != 0) {
			return sizeComp;
		}
		//want registers sorted in ascending order of offset
		return Integer.compare(reg1.getOffset(), reg2.getOffset());
	}
Compares two vector registers, first by size (descending) and then by offset (ascending).

@param reg1 vector register
@param reg2 vector register
@return result of comparison
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/RegisterManager.java