code: func ReadInt(r io.ByteReader) (ret int64, n int, err error) {
  	pos, sigs, mag, n, err := readSignMag(r)
  	if err != nil {
  		return
  	}
  	if pos {
  		if sigs > 63 {
  			err = ErrOverflow
  		} else {
  			ret = int64(mag)
  		}
  	} else {
  		if mag > uint64(-math.MinInt64) {
  			err = ErrUnderflow
  		} else {
  			ret = int64(-mag)
  		}
  	}
  	return
  }
docs: // ReadInt decodes a cmpbin-encoded number from a ByteReader. It returns the
  // decoded value and the number of bytes read. The error may be
  // Err{Over,Under}flow if the number is out of bounds. It may also return an
  // error if the ByteReader returns an error.