private static BlocksRemoveInfo isStartBlock(BlockNode remBlock,BlockNode startBlock){
  List<InsnNode> remInsns=remBlock.getInstructions();
  List<InsnNode> startInsns=startBlock.getInstructions();
  if (remInsns.size() < startInsns.size()) {
    return null;
  }
  int startPos=remInsns.size() - startInsns.size();
  int endPos=0;
  if (!checkInsns(remInsns,startInsns,startPos,null)) {
    if (checkInsns(remInsns,startInsns,0,null)) {
      startPos=0;
      endPos=startInsns.size();
    }
 else {
      boolean found=false;
      for (int i=1; i < startPos; i++) {
        if (checkInsns(remInsns,startInsns,i,null)) {
          startPos=i;
          endPos=startInsns.size() + i;
          found=true;
          break;
        }
      }
      if (!found) {
        return null;
      }
    }
  }
  BlocksPair startPair=new BlocksPair(remBlock,startBlock);
  BlocksRemoveInfo removeInfo=new BlocksRemoveInfo(startPair);
  removeInfo.setStartSplitIndex(startPos);
  removeInfo.setEndSplitIndex(endPos);
  if (endPos != 0) {
    removeInfo.setEnd(startPair);
  }
  if (!checkInsns(remInsns,startInsns,startPos,removeInfo)) {
    return null;
  }
  return removeInfo;
}

private static BlocksRemoveInfo isStartBlock ( BlockNode remBlock , BlockNode startBlock ) { List < InsnNode > remInsns = remBlock . getInstructions ( ) ; List < InsnNode > startInsns = startBlock . getInstructions ( ) ; if ( remInsns . size ( ) < startInsns . size ( ) ) { return null ; } int startPos = remInsns . size ( ) - startInsns . size ( ) ; int endPos = 0 ; if ( ! checkInsns ( remInsns , startInsns , startPos , null ) ) { if ( checkInsns ( remInsns , startInsns , 0 , null ) ) { startPos = 0 ; endPos = startInsns . size ( ) ; } else { boolean found = false ; for ( int i = 1 ; i < startPos ; i ++ ) { if ( checkInsns ( remInsns , startInsns , i , null ) ) { startPos = i ; endPos = startInsns . size ( ) + i ; found = true ; break ; } } if ( ! found ) { return null ; } } } BlocksPair startPair = new BlocksPair ( remBlock , startBlock ) ; BlocksRemoveInfo removeInfo = new BlocksRemoveInfo ( startPair ) ; removeInfo . setStartSplitIndex ( startPos ) ; removeInfo . setEndSplitIndex ( endPos ) ; if ( endPos != 0 ) { removeInfo . setEnd ( startPair ) ; } if ( ! checkInsns ( remInsns , startInsns , startPos , removeInfo ) ) { return null ; } return removeInfo ; }
' finally ' instructions can start in the middle of the first block .
