Replacing AND with a casto to UInt8 can change the condition.
e.g.
0x100 cast to UInt8 is 0, but it should be 1.
0.1 cast to UInt8 is 0, but it should be 1.
Basically we can't cast anything to UInt8 so we completely remove
this optimization.
Closes#47317