Example of c code using bit masking functions