How do you implement the inverse of bit shift operations in C? : <p>When reverse engineering C code that uses bit shift operations, I'm confused on the methodology behind getting the inverse the code below.</p>

<pre><code>unsigned char red = 37;
unsigned char blue = 100;
unsigned char green = 77
unsigned short us = (red &lt;&lt; 8) + (blue);
us = (us &lt;&lt; 5 ) | (us &gt;&gt; 11);
unsigned int threebytes = (us &lt;&lt; 8) + green;
</code></pre>

<p>Since NOT is the operation for inverting bits, I assumed I could implement a NOT to invert the bits at each line or at the end of the code, however, my result doesn't match up with the expected output which leads me to believe that I've come to a misunderstanding. What am I not understanding about reverse engineering?</p>
