static inline int nm_widen(NM self, u128_t max, u128_t *last) {
    u128_t mask, neta, bcst;
    int cmp = u128_cmp(self->neta, max);

    while(cmp < 0) {
        /* attempt widening by one bit */
        mask = u128_lsh(self->mask, 1);
        neta = u128_and(self->neta, mask);
        bcst = u128_or(self->neta, u128_neg(mask));
        /* check ranges */
        if(u128_cmp(neta, self->neta) < 0)
            break;
        cmp = u128_cmp(bcst, max);
        if(cmp > 0)
            break;
        /* successful attempt */
        self->mask = mask;
        *last = bcst;
        status("widen %016llx %016llx/%d", self->neta.h, self->neta.l, cidr(self->mask));
        if(cmp == 0)
            break;
    }
    return cmp;
}
static inline int nm_widen(NM self, u128_t max, u128_t *last) {
    u128_t mask, neta, bcst;
    int cmp = u128_cmp(self->neta, max);

    while(cmp < 0) {
         
        mask = u128_lsh(self->mask, 1);
        neta = u128_and(self->neta, mask);
        bcst = u128_or(self->neta, u128_neg(mask));
         
        if(u128_cmp(neta, self->neta) < 0)
            break;
        cmp = u128_cmp(bcst, max);
        if(cmp > 0)
            break;
         
        self->mask = mask;
        *last = bcst;
        status("widen %016llx %016llx/%d", self->neta.h, self->neta.l, cidr(self->mask));
        if(cmp == 0)
            break;
    }
    return cmp;
}