public RegisterSpec withReg(int newReg) {
    if (reg == newReg) {
      return this;
    }

    return makeLocalOptional(newReg, type, local);
  }
Returns an instance that is identical to this one, except that the register number is replaced
by the given one.

@param newReg {@code >= 0;} the new register number
@return {@code non-null;} an appropriately-constructed instance
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RegisterSpec.java