public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) {
    boolean category1 = dest.getCategory() == 1;
    boolean reference = dest.getType().isReference();
    int destReg = dest.getReg();
    int srcReg = src.getReg();
    Dop opcode;

    if ((srcReg | destReg) < 16) {
      opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE);
    } else if (destReg < 256) {
      opcode =
          reference
              ? Dops.MOVE_OBJECT_FROM16
              : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16);
    } else {
      opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16);
    }

    return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src));
  }
Makes a move instruction, appropriate and ideal for the given arguments.

@param position {@code non-null;} source position information
@param dest {@code non-null;} destination register
@param src {@code non-null;} source register
@return {@code non-null;} an appropriately-constructed instance
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/DalvInsn.java