def uint2int64(value):
    """
    Convert an unsigned 64 bits integer into a signed 64 bits integer.

    >>> print(uint2int64(1))
    1
    >>> print(uint2int64(2**64 + 1))  # ignore bits larger than 64 bits
    1
    >>> print(uint2int64(18446744073709551615))
    -1
    >>> print(uint2int64(18446744073709551614))
    -2
    """
    value = value & 18446744073709551615
    if value & 9223372036854775808:
        return value - 18446744073709551616
    else:
        return value
