private InsnList filterMoveReturnAddressInsns(InsnList insns) {
    int sz;
    int newSz = 0;

    // First see if we need to filter, and if so what the new size will be
    sz = insns.size();
    for (int i = 0; i < sz; i++) {
      if (insns.get(i).getOpcode() != Rops.MOVE_RETURN_ADDRESS) {
        newSz++;
      }
    }

    if (newSz == sz) {
      return insns;
    }

    // Make a new list without the MOVE_RETURN_ADDRESS insns
    InsnList newInsns = new InsnList(newSz);

    int newIndex = 0;
    for (int i = 0; i < sz; i++) {
      Insn insn = insns.get(i);
      if (insn.getOpcode() != Rops.MOVE_RETURN_ADDRESS) {
        newInsns.set(newIndex++, insn);
      }
    }

    newInsns.setImmutable();
    return newInsns;
  }
Removes all {@code move-return-address} instructions, returning a new {@code InsnList} if
necessary. The {@code move-return-address} insns are dead code after subroutines have been
inlined.

@param insns {@code InsnList} that may contain {@code move-return-address} insns
@return {@code InsnList} with {@code move-return-address} removed
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/Ropper.java