To reverse the bits, process from right to left (using to get the current bit, then shifting right). Simultaneously build the result from left to right (shifting the result left and adding the new bit).
Initialize . For each of the 32 bits: shift left by 1 (making room for the next bit), extract the rightmost bit of using , add that bit to using OR (), then shift right by 1.
After 32 iterations, you have processed all bits of and built the reversed result. The key is synchronizing two shifts: left for the result, right for the input.