You don't need the first `|0` (the output of `&` is a signed integer already, which is what `|0` casts to), nor the second since shifts do the same. The only `|0` you do need here is the very last one, which is necessary because of how return statements need to be (they are formalized like input parameters are with `x = x|0`).