>>184
int bit_count(int x)
{
int i, count = 0;
for (i = 0; i < 16; i++, x >>= 1)
if (x & 1)
count++;
return count;
}