private void recCountUsed(BaseBlock b, List<BaseBlock> next) {
        List<Statement> inBB = b.getStatements();
        Statement curS = inBB.get(inBB.size()-1);

        List<Statement> before  = new LinkedList<Statement>();
        if(usedOut.get(curS) != null)
            before.addAll(usedOut.get(curS));
        usedOut.put(curS, new LinkedList<Statement>());

        if(next != null) {
            List<Statement> nextSts = new LinkedList<Statement>();//statements, which follow the last statement of b
            for (BaseBlock bb : next)
                nextSts.add(bb.getStatements().get(0));

            //---------latest--------------------
            countLatest(curS, nextSts);

            funcUsedOut(curS, nextSts);//count OUT[B] = ^(s from succ(b)) IN[s]  ~ out[last st of b]
        } else funcUsedOut(curS, null);

        if(ifIsChanged(before, usedOut.get(curS)))
            isChanged = true;
        before.clear();
        if(usedIn.get(curS) != null)
            before.addAll(usedIn.get(curS));
        usedIn.put(curS, new LinkedList<Statement>());

        funcUsedIn(curS);//IN[B] -fills expectedIn for curS

        if(ifIsChanged(before, usedIn.get(curS)))
            isChanged = true;

        int i = 0;
        for (i = inBB.size()-2; i >= 0; i--) {
            Statement nextS = inBB.get(i);

            //------latest-----------------
            countLatest(nextS, curS);

            before.clear();
            if(usedOut.get(nextS) != null)
                before.addAll(usedOut.get(nextS));

            usedOut.put(nextS, new LinkedList<Statement>());
            //--count-expOut-for-cur------
            if(usedIn.get(curS) != null)
                for(Statement l: usedIn.get(curS))
                    usedOut.get(nextS).add(l);


            if(ifIsChanged(before, usedOut.get(nextS)))
                isChanged = true;

            curS = nextS;
            //--count-expIn-for-cur-------

            if(usedIn.get(curS) != null)
                before.addAll(usedIn.get(curS));
            usedIn.put(curS, new LinkedList<Statement>());

            funcUsedIn(curS);//IN[B] -fills expectedIn for curS

            if(ifIsChanged(before, usedIn.get(curS)))
                isChanged = true;
        }

        markBB.remove(b); markBB.put(b, true);
        for(BaseBlock c: cfg.prevBB(b)) {
            if(!markBB.get(c))//count)//&& !markBB.get(b)
                recCountUsed(c, cfg.nextBB(c));         //!!!если в nextBB есть с непосчитанными Statements, то не выполняем
        }
    }