void bitmap_set_atomic(unsigned long *map, long start, long nr)
{
    unsigned long *p = map + BIT_WORD(start);
    const long size = start + nr;
    int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG);
    unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start);
    /* First word */
    if (nr - bits_to_set > 0) {
        atomic_or(p, mask_to_set);
        nr -= bits_to_set;
        bits_to_set = BITS_PER_LONG;
        mask_to_set = ~0UL;
        p++;
    }
    /* Full words */
    if (bits_to_set == BITS_PER_LONG) {
        while (nr >= BITS_PER_LONG) {
            *p = ~0UL;
            nr -= BITS_PER_LONG;
            p++;
        }
    }
    /* Last word */
    if (nr) {
        mask_to_set &= BITMAP_LAST_WORD_MASK(size);
        atomic_or(p, mask_to_set);
    } else {
        /* If we avoided the full barrier in atomic_or(), issue a
         * barrier to account for the assignments in the while loop.
         */
        smp_mb();
    }
}
void bitmap_set_atomic(unsigned long *map, long start, long nr)
{
    unsigned long *p = map + BIT_WORD(start);
    const long size = start + nr;
    int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG);
    unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start);
    
    if (nr - bits_to_set > 0) {
        atomic_or(p, mask_to_set);
        nr -= bits_to_set;
        bits_to_set = BITS_PER_LONG;
        mask_to_set = ~0UL;
        p++;
    }
    
    if (bits_to_set == BITS_PER_LONG) {
        while (nr >= BITS_PER_LONG) {
            *p = ~0UL;
            nr -= BITS_PER_LONG;
            p++;
        }
    }
    
    if (nr) {
        mask_to_set &= BITMAP_LAST_WORD_MASK(size);
        atomic_or(p, mask_to_set);
    } else {
        


        smp_mb();
    }
}
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);
    
    if (VAR_2 - VAR_5 > 0) {
        atomic_or(VAR_3, VAR_6);
        VAR_2 -= VAR_5;
        VAR_5 = BITS_PER_LONG;
        VAR_6 = ~0UL;
        VAR_3++;
    }
    
    if (VAR_5 == BITS_PER_LONG) {
        while (VAR_2 >= BITS_PER_LONG) {
            *VAR_3 = ~0UL;
            VAR_2 -= BITS_PER_LONG;
            VAR_3++;
        }
    }
    
    if (VAR_2) {
        VAR_6 &= BITMAP_LAST_WORD_MASK(VAR_4);
        atomic_or(VAR_3, VAR_6);
    } else {
        


        smp_mb();
    }
}
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); if (VAR_2 - VAR_5 > 0) { atomic_or(VAR_3, VAR_6); VAR_2 -= VAR_5; VAR_5 = BITS_PER_LONG; VAR_6 = ~0UL; VAR_3++; } if (VAR_5 == BITS_PER_LONG) { while (VAR_2 >= BITS_PER_LONG) { *VAR_3 = ~0UL; VAR_2 -= BITS_PER_LONG; VAR_3++; } } if (VAR_2) { VAR_6 &= BITMAP_LAST_WORD_MASK(VAR_4); atomic_or(VAR_3, VAR_6); } else { smp_mb(); } }