@Override
  public int compareTo(RegisterSpec other) {
    if (this.reg < other.reg) {
      return -1;
    } else if (this.reg > other.reg) {
      return 1;
    } else if (this == other) {
      return 0;
    }

    int compare = type.getType().compareTo(other.type.getType());

    if (compare != 0) {
      return compare;
    }

    if (this.local == null) {
      return (other.local == null) ? 0 : -1;
    } else if (other.local == null) {
      return 1;
    }

    return this.local.compareTo(other.local);
  }
Compares by (in priority order) register number, unwrapped type (that is types not {@link
TypeBearer}s, and local info.

@param other {@code non-null;} spec to compare to
@return {@code -1..1;} standard result of comparison
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RegisterSpec.java