It can't be done always: flag1 and flag2 must be nonzero powers of two. In that case, we can transform it to: !~(x|~(flag1|flag2)) = !~(x|constant) The -2147483648 case has trouble with the sign hack detector and I couldn't trigger it.
It can't be done always: flag1 and flag2 must be nonzero powers of two. In that case, we can transform it to: !~(x|~(flag1|flag2)) = !~(x|constant) The -2147483648 case has trouble with the sign hack detector and I couldn't trigger it.