this is a for loop that happens 32 times. But, I'm going to explain
the first iteration and
you should be able to work thru yourself for
reminder of the iterations.
for the first iteration, i = 0 and the block is evaluated as
x ^ = 1 << 0
this becomes
x = x ^ ( 1 << 0)
= x ^ 1 (remember 1 << 0 = 1, as we are shift 0 bits)
= -5 ^ 1
= 1111 1111 1111 1111 1111 1111 1111 1011 ( ==> -5)
^
0000 0000 0000 0000 0000 0000 0000 0001 ( ==> 1)
-------------------------------------------
1111 1111 1111 1111 1111 1111 1111 1010 ( ==> -6)
so for the first iteration the result of x is -6
the next iteration is evaluated as
x = x ^ 1 << i (on the second iteration i = 1 and x = -6 from
the above step)
= -6 ^ ( 1 << 1)
and so on