private static void edgeSplitMoveExceptionsAndResults(SsaMethod ssaMeth) {
    ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks();

    /*
     * New blocks are added to the end of the block list during
     * this iteration.
     */
    for (int i = blocks.size() - 1; i >= 0; i--) {
      SsaBasicBlock block = blocks.get(i);

      /*
       * Any block that starts with a move-exception and has more than
       * one predecessor...
       */
      if (!block.isExitBlock()
          && block.getPredecessors().cardinality() > 1
          && block.getInsns().get(0).isMoveException()) {

        // block.getPredecessors() is changed in the loop below.
        BitSet preds = (BitSet) block.getPredecessors().clone();
        for (int j = preds.nextSetBit(0); j >= 0; j = preds.nextSetBit(j + 1)) {
          SsaBasicBlock predecessor = blocks.get(j);
          SsaBasicBlock zNode = predecessor.insertNewSuccessor(block);

          /*
           * Make sure to place the move-exception as the
           * first insn.
           */
          zNode.getInsns().add(0, block.getInsns().get(0).clone());
        }

        // Remove the move-exception from the original block.
        block.getInsns().remove(0);
      }
    }
  }
In ROP form, move-exception must occur as the first insn in a block immediately succeeding the
insn that could thrown an exception. We may need room to insert move insns later, so make sure
to split any block that starts with a move-exception such that there is a unique move-exception
block for each predecessor.

@param ssaMeth method to process
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/SsaConverter.java