// Int64 generates a random number on [0, 2^64-1]-interval.
176855
func (m *MT19937) Int64() uint64 {

	var (
		i int
		x uint64
	)

	mag01 := [2]uint64{0, MatrixA}

	if m.mti >= NN { /* generate NN words at one time */

		/* if Seed() has not been called, */
		/* a default initial seed is used */
		if m.mti == NN+1 {
			m.Seed(5489)
		}

		for i = 0; i < NN-MM; i++ {
			x = (m.mt[i] & UM) | (m.mt[i+1] & LM)
			m.mt[i] = m.mt[i+MM] ^ (x >> 1) ^ mag01[(int)(x&1)]
		}
		for ; i < NN-1; i++ {
			x = (m.mt[i] & UM) | (m.mt[i+1] & LM)
			m.mt[i] = m.mt[i+(MM-NN)] ^ (x >> 1) ^ mag01[(int)(x&1)]
		}
		x = (m.mt[NN-1] & UM) | (m.mt[0] & LM)
		m.mt[NN-1] = m.mt[MM-1] ^ (x >> 1) ^ mag01[(int)(x&1)]

		m.mti = 0
	}

	x = m.mt[m.mti]
	m.mti++

	x ^= (x >> 29) & 0x5555555555555555
	x ^= (x << 17) & 0x71D67FFFEDA60000
	x ^= (x << 37) & 0xFFF7EEE000000000
	x ^= (x >> 43)

	return x
}
822240
func (c Context) Ints64(key string, i []int64) Context {
	c.l.context = enc.AppendInts64(enc.AppendKey(c.l.context, key), i)
	return c
}
1337684
func SumInt64(s []int64) (sum int64) {
	for _, v := range s {
		sum += v
	}
	return
}
129150
func (c *Config) Int64(key string) (int64, error) {
	return strconv.ParseInt(c.get(key), 10, 64)
}
632361
func (dec *Decoder) Int64(v *int64) error {
	err := dec.decodeInt64(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
805159
func parseInt64(d []byte) (n int64) {
	if len(d) == 0 {
		return -1
	}
	for _, dec := range d {
		if dec < ascii_0 || dec > ascii_9 {
			return -1
		}
		n = n*10 + (int64(dec) - ascii_0)
	}
	return n
}
1227676
func (w *ByteWriter) WriteInt64(val int64, offset int) (int, error) {
	return w.WriteVal(val, offset)
}
656062
func (ung UniformGenerator) Int64() int64 {
	ung.mu.Lock()
	defer ung.mu.Unlock()
	return ung.rd.Int63()
}
268854
func (p *parserMixin) Int64() (target *int64) {
	target = new(int64)
	p.Int64Var(target)
	return
}
147662
func (g *Graph) Int64(def ...int64) int64 {
	n, ok := _int64f(g.String())
	if !ok {
		if len(def) == 0 {
			return 0
		}
		return def[0]
	}
	return n
}
1229082
func (enc *Encoder) encodeInt64(n int64) ([]byte, error) {
	enc.buf = strconv.AppendInt(enc.buf, n, 10)
	return enc.buf, nil
}
295008
func (t *Tag) Int64(i int) (int64, error) {
	if t.format != IntVal {
		return 0, t.typeErr(IntVal)
	}
	return t.intVals[i], nil
}
1086695
func Int64(short string, long string, value int64, usage string) *int64 {
	flagVar := value
	return Int64Var(&flagVar, short, long, value, usage)
}
1005683
func (h Hash) Int64(key string) (int64, error) {
	if value, ok := h[key]; ok {
		return value.Int64()
	}
	return 0, errors.New(ErrInvalidKey, errorMessages, key)
}
423176
func (e *Encoder) EncodeInt64(n int64) error {
	return e.write8(codes.Int64, uint64(n))
}
1072129
func (r *Reply) Int64() (int64, error) {
	if r.Type == ErrorReply {
		return 0, r.Err
	}
	if r.Type != IntegerReply {
		s, err := r.Str()
		if err == nil {
			i64, err := strconv.ParseInt(s, 10, 64)
			if err != nil {
				return 0, errors.New("failed to parse integer value from string value")
			} else {
				return i64, nil
			}
		}

		return 0, errors.New("integer value is not available for this reply type")
	}

	return r.int, nil
}
1004841
func Int64R() (int64, error) {
	i, err := randDevInt64("/dev/random")
	return i, e.Forward(err)
}