public static int CbitZeroLeft(uint u) {
int cbit = 0;
if (0 == (u & 0xFFFF0000)) {
cbit += 16;
u <<= 16;
}
if (0 == (u & 0xFF000000)) {
cbit += 8;
u <<= 8;
}
if (0 == (u & 0xF0000000)) {
cbit += 4;
u <<= 4;
}
if (0 == (u & 0xC0000000)) {
cbit += 2;
u <<= 2;
}
if (0 == (u & 0x80000000)) {
cbit += 1;
u <<= 1;
}
Debug.Assert(0 != (u & 0x80000000));
return cbit;
}