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 & 4294967295
    if value & 2147483648:
        v = value - 4294967296
    else:
        v = value
    return v
