private PsiElement @NotNull [] get(@NotNull PsiVariable def, @NotNull PsiElement refOrDef) {
      if (body == null) {
        return PsiElement.EMPTY_ARRAY;
      }

      final boolean [] visited = new boolean[instructions.size() + 1];
      visited [visited.length-1] = true; // stop on the code end
      final boolean defs = defs();
      int elem = defs ? flow.getStartOffset(refOrDef) : flow.getEndOffset(refOrDef);

      // hack: ControlFlow doesn't contains parameters initialization
      if (elem == -1 && def instanceof PsiParameter) {
        elem = 0;
      }

      if (elem != -1) {
        if (!defs && instructions.get(elem) instanceof ReadVariableInstruction) {
          LOG.assertTrue(nNext(elem) == 1);
          LOG.assertTrue(getNext(elem,0) == elem+1);
          elem += 1;
        }

        Set<@NotNull PsiElement> res = new HashSet<>();
        // hack: ControlFlow doesn't contains parameters initialization
        int startIndex = elem;

        IntList workQueue = new IntArrayList();
        workQueue.add(startIndex);
        PsiManager psiManager = body.getManager();

        while (!workQueue.isEmpty()) {
          int index = workQueue.removeInt(workQueue.size() - 1);
          if (visited[index]) {
            continue;
          }
          visited [index] = true;

          if (defs) {
            final Instruction instruction = instructions.get(index);
            processInstruction(res, instruction, index);
            if (instruction instanceof WriteVariableInstruction) {
              WriteVariableInstruction instructionW = (WriteVariableInstruction)instruction;
              if (psiManager.areElementsEquivalent(instructionW.variable, def)) {
                continue;
              }
            }

            // hack: ControlFlow doesn't contains parameters initialization
            if (index == 0 && def instanceof PsiParameter) {
              PsiIdentifier identifier = def.getNameIdentifier();
              if (identifier != null) {
                res.add(identifier);
              }
            }
          }

          final int nNext = nNext (index);
          for (int i = 0; i < nNext; i++) {
            final int prev = getNext(index, i);
            if (!visited [prev]) {
              if (!defs) {
                final Instruction instruction = instructions.get(prev);
                if (instruction instanceof WriteVariableInstruction) {
                  WriteVariableInstruction instructionW = (WriteVariableInstruction)instruction;
                  if (psiManager.areElementsEquivalent(instructionW.variable, def)) {
                    continue;
                  }
                }
                else {
                  processInstruction(res, instruction, prev);
                }
              }
              workQueue.add(prev);
            }
          }
        }
        return PsiUtilCore.toPsiElementArray(res);
      }
      return PsiElement.EMPTY_ARRAY;
    }
private PsiElement @NotNull [] get(@NotNull PsiVariable def, @NotNull PsiElement refOrDef)