private static void removeJsrInstructions(ConstantPool pool, BasicBlock block, DataPoint data) {
    ListStack<VarType> stack = data.getStack();

    InstructionSequence seq = block.getSeq();
    for (int i = 0; i < seq.length(); i++) {
      Instruction instr = seq.getInstr(i);

      VarType var = null;
      if (instr.opcode == CodeConstants.opc_astore || instr.opcode == CodeConstants.opc_pop) {
        var = stack.getByOffset(-1);
      }

      InstructionImpact.stepTypes(data, instr, pool);

      switch (instr.opcode) {
        case CodeConstants.opc_jsr, CodeConstants.opc_ret -> {
          seq.removeInstruction(i);
          i--;
        }
        case CodeConstants.opc_astore, CodeConstants.opc_pop -> {
          if (var.getType() == CodeConstants.TYPE_ADDRESS) {
            seq.removeInstruction(i);
            i--;
          }
        }
      }
    }

    block.mark = 1;

    for (int i = 0; i < block.getSuccessors().size(); i++) {
      BasicBlock suc = block.getSuccessors().get(i);
      if (suc.mark != 1) {
        removeJsrInstructions(pool, suc, data.copy());
      }
    }

    for (int i = 0; i < block.getSuccessorExceptions().size(); i++) {
      BasicBlock suc = block.getSuccessorExceptions().get(i);
      if (suc.mark != 1) {
        DataPoint point = data.copy();
        point.getStack().clear();
        point.getStack().push(new VarType(CodeConstants.TYPE_OBJECT, 0, null));
        removeJsrInstructions(pool, suc, point);
      }
    }
  }
private static void removeJsrInstructions(ConstantPool pool, BasicBlock block, DataPoint data)