private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) {
    out.write(
        codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit());
  }
Helper method that encodes any of the three-unit register-range formats.
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/InstructionCodec.java