def trunc32(w):
    """ Return the bottom 32 bits of w as a Python int.
		This creates longs temporarily, but returns an int. """
    w = int(w & 2147483647 | -(w & 2147483648))
    assert type(w) == int
    return w
