int (@NotNull ControlFlow flow, int offset) { List<Instruction> instructions = flow.getInstructions(); while (true) { if (offset >= instructions.size()) break; Instruction instruction = instructions.get(offset); if (!(instruction instanceof GoToInstruction) || ((GoToInstruction)instruction).isReturn) break; offset = ((BranchingInstruction)instruction).offset; } return offset; }