applyChanMask implemented in C