transformUint32Bool function
Replaces a single bit in a 32-bit unsigned integer.
Implementation
int transformUint32Bool(int uint32, int shift, bool newValue) {
return ((0xFFFFFFFF ^ (0x1 << shift)) & uint32) |
((newValue ? 1 : 0) << shift);
}