unsigned long find_next_bit(const unsigned long *addr, unsigned long size,

			    unsigned long offset)

{

    const unsigned long *p = addr + BITOP_WORD(offset);

    unsigned long result = offset & ~(BITS_PER_LONG-1);

    unsigned long tmp;



    if (offset >= size) {

        return size;

    }

    size -= result;

    offset %= BITS_PER_LONG;

    if (offset) {

        tmp = *(p++);

        tmp &= (~0UL << offset);

        if (size < BITS_PER_LONG) {

            goto found_first;

        }

        if (tmp) {

            goto found_middle;

        }

        size -= BITS_PER_LONG;

        result += BITS_PER_LONG;

    }

    while (size & ~(BITS_PER_LONG-1)) {

        if ((tmp = *(p++))) {

            goto found_middle;

        }

        result += BITS_PER_LONG;

        size -= BITS_PER_LONG;

    }

    if (!size) {

        return result;

    }

    tmp = *p;



found_first:

    tmp &= (~0UL >> (BITS_PER_LONG - size));

    if (tmp == 0UL) {		/* Are any bits set? */

        return result + size;	/* Nope. */

    }

found_middle:

    return result + bitops_ffsl(tmp);

}

unsigned long find_next_bit(const unsigned long *addr, unsigned long size,

			    unsigned long offset)

{

    const unsigned long *p = addr + BITOP_WORD(offset);

    unsigned long result = offset & ~(BITS_PER_LONG-1);

    unsigned long tmp;



    if (offset >= size) {

        return size;

    }

    size -= result;

    offset %= BITS_PER_LONG;

    if (offset) {

        tmp = *(p++);

        tmp &= (~0UL << offset);

        if (size < BITS_PER_LONG) {

            goto found_first;

        }

        if (tmp) {

            goto found_middle;

        }

        size -= BITS_PER_LONG;

        result += BITS_PER_LONG;

    }

    while (size & ~(BITS_PER_LONG-1)) {

        if ((tmp = *(p++))) {

            goto found_middle;

        }

        result += BITS_PER_LONG;

        size -= BITS_PER_LONG;

    }

    if (!size) {

        return result;

    }

    tmp = *p;



found_first:

    tmp &= (~0UL >> (BITS_PER_LONG - size));

    if (tmp == 0UL) {		

        return result + size;	

    }

found_middle:

    return result + bitops_ffsl(tmp);

}

    return result + bitops_ffsl(tmp);
unsigned long FUNC_0(const unsigned long *VAR_0, unsigned long VAR_1,

			    unsigned long VAR_2)

{

    const unsigned long *VAR_3 = VAR_0 + BITOP_WORD(VAR_2);

    unsigned long VAR_4 = VAR_2 & ~(BITS_PER_LONG-1);

    unsigned long VAR_5;



    if (VAR_2 >= VAR_1) {

        return VAR_1;

    }

    VAR_1 -= VAR_4;

    VAR_2 %= BITS_PER_LONG;

    if (VAR_2) {

        VAR_5 = *(VAR_3++);

        VAR_5 &= (~0UL << VAR_2);

        if (VAR_1 < BITS_PER_LONG) {

            goto found_first;

        }

        if (VAR_5) {

            goto found_middle;

        }

        VAR_1 -= BITS_PER_LONG;

        VAR_4 += BITS_PER_LONG;

    }

    while (VAR_1 & ~(BITS_PER_LONG-1)) {

        if ((VAR_5 = *(VAR_3++))) {

            goto found_middle;

        }

        VAR_4 += BITS_PER_LONG;

        VAR_1 -= BITS_PER_LONG;

    }

    if (!VAR_1) {

        return VAR_4;

    }

    VAR_5 = *VAR_3;



found_first:

    VAR_5 &= (~0UL >> (BITS_PER_LONG - VAR_1));

    if (VAR_5 == 0UL) {		

        return VAR_4 + VAR_1;	

    }

found_middle:

    return VAR_4 + bitops_ffsl(VAR_5);

}

unsigned long FUNC_0(const unsigned long *VAR_0, unsigned long VAR_1,
unsigned long VAR_2)
{ const unsigned long *VAR_3 = VAR_0 + BITOP_WORD(VAR_2); unsigned long VAR_4 = VAR_2 & ~(BITS_PER_LONG-1); unsigned long VAR_5; if (VAR_2 >= VAR_1) { return VAR_1; } VAR_1 -= VAR_4; VAR_2 %= BITS_PER_LONG; if (VAR_2) { VAR_5 = *(VAR_3++); VAR_5 &= (~0UL << VAR_2); if (VAR_1 < BITS_PER_LONG) { goto found_first; } if (VAR_5) { goto found_middle; } VAR_1 -= BITS_PER_LONG; VAR_4 += BITS_PER_LONG; } while (VAR_1 & ~(BITS_PER_LONG-1)) { if ((VAR_5 = *(VAR_3++))) { goto found_middle; } VAR_4 += BITS_PER_LONG; VAR_1 -= BITS_PER_LONG; } if (!VAR_1) { return VAR_4; } VAR_5 = *VAR_3; found_first:
VAR_5 &= (~0UL >> (BITS_PER_LONG - VAR_1)); if (VAR_5 == 0UL) { return VAR_4 + VAR_1; } found_middle:
return VAR_4 + bitops_ffsl(VAR_5); }