def as_twos_comp(value: int) ->int:
    """Interpret number as 32-bit twos comp value."""
    if value & 2147483648 != 0:
        flipped_value = ~value & 4294967295
        return -(flipped_value + 1)
    else:
        return value
