Bitwise operation question with shifting involved
Actually, you want to solve it from the LSB side.

First, solve for the 3 LSBs of X; we can see that the 3 LSBits of the left hand side of ((X XOR a)+b)&lt;&lt;3 = (X+c) XOR d doesn't actually depend on X (and there's no propogation anywhere from the higher order bits of X, so they can be ignored for now), so it's effectively a simple equation, easily solved.

Then, solve for the next 3 LSBs of X; again the 6 LSBits left hand side doesn't depend on those bits (it does depend on the 3 LSBits of X, but we already know those); again, that portion of X is easily solved.

So, just keep on iteration until we have all the bits of X.

One thing we can see from this process is that there is always exactly one solution for X for any (a, b, c, d) values.