Use ccall for count_ones and bswap