public static @NotNull Map<PsiElement, PsiVariable> getWritesBeforeReads(@NotNull ControlFlow flow,
                                                                  @NotNull Set<? extends PsiVariable> writeVars,
                                                                  @NotNull Set<? extends PsiVariable> readVars,
                                                                  final int stopPoint) {
    Map<PsiElement, PsiVariable> writes = new LinkedHashMap<>();
    List<Instruction> instructions = flow.getInstructions();

    for (int i = 0; i < instructions.size(); i++) {
      Instruction instruction = instructions.get(i);
      if (!(instruction instanceof WriteVariableInstruction)) continue;

      PsiVariable writtenVar = ((WriteVariableInstruction)instruction).variable;
      if (!writeVars.contains(writtenVar)) continue;

      if (readBeforeStopPoint(flow, readVars, i, stopPoint)) writes.put(flow.getElement(i), writtenVar);
    }

    return writes;
  }
public static @NotNull Map<PsiElement, PsiVariable> getWritesBeforeReads(@NotNull ControlFlow flow,
                                                                  @NotNull Set<? extends PsiVariable> writeVars,
                                                                  @NotNull Set<? extends PsiVariable> readVars,
                                                                  final int stopPoint)