void bitmap_clear(unsigned long *map, long start, long nr)
{
    unsigned long *p = map + BIT_WORD(start);
    const long size = start + nr;
    int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
    unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
    while (nr - bits_to_clear >= 0) {
        *p &= ~mask_to_clear;
        nr -= bits_to_clear;
        bits_to_clear = BITS_PER_LONG;
        mask_to_clear = ~0UL;
        p++;
    }
    if (nr) {
        mask_to_clear &= BITMAP_LAST_WORD_MASK(size);
        *p &= ~mask_to_clear;
    }
}
void bitmap_clear(unsigned long *map, long start, long nr)
{
    unsigned long *p = map + BIT_WORD(start);
    const long size = start + nr;
    int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
    unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
    while (nr - bits_to_clear >= 0) {
        *p &= ~mask_to_clear;
        nr -= bits_to_clear;
        bits_to_clear = BITS_PER_LONG;
        mask_to_clear = ~0UL;
        p++;
    }
    if (nr) {
        mask_to_clear &= BITMAP_LAST_WORD_MASK(size);
        *p &= ~mask_to_clear;
    }
}
void FUNC_0(unsigned long *VAR_0, long VAR_1, long VAR_2)
{
    unsigned long *VAR_3 = VAR_0 + BIT_WORD(VAR_1);
    const long VAR_4 = VAR_1 + VAR_2;
    int VAR_5 = BITS_PER_LONG - (VAR_1 % BITS_PER_LONG);
    unsigned long VAR_6 = BITMAP_FIRST_WORD_MASK(VAR_1);
    while (VAR_2 - VAR_5 >= 0) {
        *VAR_3 &= ~VAR_6;
        VAR_2 -= VAR_5;
        VAR_5 = BITS_PER_LONG;
        VAR_6 = ~0UL;
        VAR_3++;
    }
    if (VAR_2) {
        VAR_6 &= BITMAP_LAST_WORD_MASK(VAR_4);
        *VAR_3 &= ~VAR_6;
    }
}
void FUNC_0(unsigned long *VAR_0, long VAR_1, long VAR_2)
{ unsigned long *VAR_3 = VAR_0 + BIT_WORD(VAR_1); const long VAR_4 = VAR_1 + VAR_2; int VAR_5 = BITS_PER_LONG - (VAR_1 % BITS_PER_LONG); unsigned long VAR_6 = BITMAP_FIRST_WORD_MASK(VAR_1); while (VAR_2 - VAR_5 >= 0) { *VAR_3 &= ~VAR_6; VAR_2 -= VAR_5; VAR_5 = BITS_PER_LONG; VAR_6 = ~0UL; VAR_3++; } if (VAR_2) { VAR_6 &= BITMAP_LAST_WORD_MASK(VAR_4); *VAR_3 &= ~VAR_6; } }