def uint2int32(value):
    """
    Convert an unsigned 32 bits integer into a signed 32 bits integer.

    >>> print(uint2int32(1))
    1
    >>> print(uint2int32(2**32 + 1))  # ignore bits larger than 32 bits
    1
    >>> print(uint2int32(4294967295))
    -1
    >>> print(uint2int32(4294967294))
    -2
    >>> print(uint2int32(18446744073709551615))
    -1
    """
    value = value & 0xffffffff
    if value & 0x80000000:
        v = value - 0x100000000
    else:
        v = value
    return v