if (!HASREF(r)) {
if (!HASREF(r) || MARKED(r)) {
    void addref_rec(int r, boolean[] dep) {        if (r < 2)            return;        if (!HASREF(r)) {            bddfreenum--;            /* Detect variable dependencies for the interaction matrix */            dep[VARr(r) & ~MARK_MASK] = true;            /* Make sure the nodenum field is updated. Used in the initial GBC */            levels[VARr(r) & ~MARK_MASK].nodenum++;            addref_rec(LOW(r), dep);            addref_rec(HIGH(r), dep);        } else {            int n;            /* Update (from previously found) variable dependencies            * for the interaction matrix */            for (n = 0; n < bddvarnum; n++)                dep[n]                    |= imatrixDepends(iactmtx, VARr(r) & ~MARK_MASK, n);        }        INCREF(r);    }