public static void removeGoTos(ControlFlowGraph graph) {
    for (BasicBlock block : graph.getBlocks()) {
      Instruction instr = block.getLastInstruction();

      if (instr != null && instr.opcode == CodeConstants.opc_goto) {
        block.getSeq().removeLast();
      }
    }

    removeEmptyBlocks(graph);
  }
public static void removeGoTos(ControlFlowGraph graph)