void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first)

{

    unsigned i, bit;

    uint64_t pos;



    hbi->hb = hb;

    pos = first >> hb->granularity;


    hbi->pos = pos >> BITS_PER_LEVEL;

    hbi->granularity = hb->granularity;



    for (i = HBITMAP_LEVELS; i-- > 0; ) {

        bit = pos & (BITS_PER_LONG - 1);

        pos >>= BITS_PER_LEVEL;



        /* Drop bits representing items before first.  */

        hbi->cur[i] = hb->levels[i][pos] & ~((1UL << bit) - 1);



        /* We have already added level i+1, so the lowest set bit has

         * been processed.  Clear it.

         */

        if (i != HBITMAP_LEVELS - 1) {

            hbi->cur[i] &= ~(1UL << bit);

        }

    }

}
void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first)

{

    unsigned i, bit;

    uint64_t pos;



    hbi->hb = hb;

    pos = first >> hb->granularity;


    hbi->pos = pos >> BITS_PER_LEVEL;

    hbi->granularity = hb->granularity;



    for (i = HBITMAP_LEVELS; i-- > 0; ) {

        bit = pos & (BITS_PER_LONG - 1);

        pos >>= BITS_PER_LEVEL;



        

        hbi->cur[i] = hb->levels[i][pos] & ~((1UL << bit) - 1);



        





        if (i != HBITMAP_LEVELS - 1) {

            hbi->cur[i] &= ~(1UL << bit);

        }

    }

}
void FUNC_0(HBitmapIter *VAR_0, const HBitmap *VAR_1, uint64_t VAR_2)

{

    unsigned VAR_3, VAR_4;

    uint64_t pos;



    VAR_0->VAR_1 = VAR_1;

    pos = VAR_2 >> VAR_1->granularity;


    VAR_0->pos = pos >> BITS_PER_LEVEL;

    VAR_0->granularity = VAR_1->granularity;



    for (VAR_3 = HBITMAP_LEVELS; VAR_3-- > 0; ) {

        VAR_4 = pos & (BITS_PER_LONG - 1);

        pos >>= BITS_PER_LEVEL;



        

        VAR_0->cur[VAR_3] = VAR_1->levels[VAR_3][pos] & ~((1UL << VAR_4) - 1);



        





        if (VAR_3 != HBITMAP_LEVELS - 1) {

            VAR_0->cur[VAR_3] &= ~(1UL << VAR_4);

        }

    }

}
void FUNC_0(HBitmapIter *VAR_0, const HBitmap *VAR_1, uint64_t VAR_2)
{ unsigned VAR_3, VAR_4; uint64_t pos; VAR_0->VAR_1 = VAR_1; pos = VAR_2 >> VAR_1->granularity; VAR_0->pos = pos >> BITS_PER_LEVEL; VAR_0->granularity = VAR_1->granularity; for (VAR_3 = HBITMAP_LEVELS; VAR_3-- > 0; ) { VAR_4 = pos & (BITS_PER_LONG - 1); pos >>= BITS_PER_LEVEL; VAR_0->cur[VAR_3] = VAR_1->levels[VAR_3][pos] & ~((1UL << VAR_4) - 1); if (VAR_3 != HBITMAP_LEVELS - 1) { VAR_0->cur[VAR_3] &= ~(1UL << VAR_4); } } }