static void divideInsideAndOutsideInOneRoot(@NotNull PsiFile root,
                                              long restrictRange,
                                              long priorityRange,
                                              @NotNull Processor<? super DividedElements> processor) {
    long modificationStamp = root.getModificationStamp();
    ConcurrentLongObjectMap<Reference<DividedElements>> cachedMap;
    while (true) {
      CachedStampedMap cache = root.getUserData(CACHED_DIVIDED_ELEMENTS_KEY);
      if (cache != null && cache.modificationStamp == modificationStamp) {
        cachedMap = cache.elements();
        break;
      }
      ((UserDataHolderEx)root).replace(CACHED_DIVIDED_ELEMENTS_KEY, cache, new CachedStampedMap(modificationStamp, ConcurrentCollectionFactory.createConcurrentLongObjectMap()));
    }
    DividedElements cached = SoftReference.dereference(cachedMap.get(restrictRange));
    DividedElements elements;
    if (cached != null && TextRangeScalarUtil.contains(cached.priorityRange, priorityRange)) {
      elements = cached;
    }
    else {
      List<PsiElement> inside = new ArrayList<>();
      LongList insideRanges = new LongArrayList();
      List<PsiElement> outside = new ArrayList<>();
      LongList outsideRanges = new LongArrayList();
      List<PsiElement> parents = new ArrayList<>();
      LongList parentRanges = new LongArrayList();
      divideInsideAndOutsideInOneRoot(root, restrictRange, priorityRange, inside, insideRanges, outside, outsideRanges, parents, parentRanges);
      elements = new DividedElements(root, priorityRange, inside, insideRanges, outside, outsideRanges, parents, parentRanges);
      cachedMap.put(restrictRange, new java.lang.ref.SoftReference<>(elements));
    }
    processor.process(elements);
  }
static void divideInsideAndOutsideInOneRoot(@NotNull PsiFile root,
                                              long restrictRange,
                                              long priorityRange,
                                              @NotNull Processor<? super DividedElements> processor)