if (dis.next == null || last < dis.next.first) {
if (dis.next == null || last < dis.next.firstLevel) {
    BddTree bddtree_addrange_rec(BddTree t, BddTree prev,                                 int first, int last, boolean fixed, int id)    {        if (first < 0 || last < 0 || last < first)            return null;        /* Empty tree -> build one */        if (t == null) {            t = bddtree_new(id);            t.first = first;            t.fixed = fixed;            t.seq = new int[last - first + 1];            t.last = last;            update_seq(t);            t.prev = prev;            return t;        }        /* Check for identity */        if (first == t.first && last == t.last)            return t;        /* Inside this section -> insert in next level */        if (first >= t.first && last <= t.last) {            t.nextlevel =                bddtree_addrange_rec(t.nextlevel, null, first, last, fixed, id);            return t;        }        /* Before this section -> insert */        if (last < t.first) {            BddTree tnew = bddtree_new(id);            tnew.first = first;            tnew.last = last;            tnew.fixed = fixed;            tnew.seq = new int[last - first + 1];            update_seq(tnew);            tnew.next = t;            tnew.prev = t.prev;            t.prev = tnew;            return tnew;        }        /* After this this section -> go to next */        if (first > t.last) {            t.next = bddtree_addrange_rec(t.next, t, first, last, fixed, id);            return t;        }        /* Covering this section -> insert above this level */        if (first <= t.first) {            BddTree tnew;            BddTree dis = t;            while (true) {                /* Partial cover ->error */                if (last >= dis.first && last < dis.last)                    return null;                if (dis.next == null || last < dis.next.first) {                    tnew = bddtree_new(id);                    tnew.first = first;                    tnew.last = last;                    tnew.fixed = fixed;                    tnew.seq = new int[last - first + 1];                    update_seq(tnew);                    tnew.nextlevel = t;                    tnew.next = dis.next;                    tnew.prev = t.prev;                    if (dis.next != null)                        dis.next.prev = tnew;                    dis.next = null;                    t.prev = null;                    return tnew;                }                dis = dis.next;            }        }        return null;    }