// Int64Shrinker is a shrinker for int64 numbers
548480
func Int64Shrinker(v interface{}) gopter.Shrink {
	negShrink := int64Shrink{
		original: -v.(int64),
		half:     -v.(int64),
	}
	posShrink := int64Shrink{
		original: v.(int64),
		half:     v.(int64) / 2,
	}
	return gopter.Shrink(negShrink.Next).Interleave(gopter.Shrink(posShrink.Next))
}
579051
func _int64(i interface{}) (int64, bool) {

	switch v := i.(type) {

	case int:
		return int64(v), true
	case int8:
		return int64(v), true
	case int16:
		return int64(v), true
	case int32:
		return int64(v), true
	case int64:
		return v, true
	case uint:
		return int64(v), true
	case uint8:
		return int64(v), true
	case uint16:
		return int64(v), true
	case uint32:
		return int64(v), true
	case uint64:
		return int64(v), true
	}

	return 0, false
}
510956
func (c *ConfigFile) Int64(section, key string) (int64, error) {
	value, err := c.GetValue(section, key)
	if err != nil {
		return 0, err
	}
	return strconv.ParseInt(value, 10, 64)
}
87438
func UInt32Shrinker(v interface{}) gopter.Shrink {
	return UInt64Shrinker(uint64(v.(uint32))).Map(uint64To32)
}
531848
func (tr Row) Int64Err(nn int) (val int64, err error) {
	switch data := tr[nn].(type) {
	case nil:
		// nop
	case int64, int32, int16, int8:
		val = reflect.ValueOf(data).Int()
	case uint64, uint32, uint16, uint8:
		u := reflect.ValueOf(data).Uint()
		if u > math.MaxInt64 {
			err = strconv.ErrRange
		} else {
			val = int64(u)
		}
	case []byte:
		val, err = strconv.ParseInt(string(data), 10, 64)
	case *[]byte:
		val, err = strconv.ParseInt(string(*data), 10, 64)
	default:
		err = os.ErrInvalid
	}
	return
}
954610
func (fs *FlagSet) Int64(names []string, value int64, usage string) *int64 {
	p := new(int64)
	fs.Int64Var(p, names, value, usage)
	return p
}
659573
func (nn NullNumber) Int64() (int64, error) {
	if nn.IsNil() {
		return 0, errors.New("NullNumber is nil")
	}
	return strconv.ParseInt(nn.value.(string), 10, 64)
}
1116083
func Int64() int64 {
	var bs [8]byte
	_, err := io.ReadFull(cryptoRand.Reader, bs[:])
	if err != nil {
		panic("randomness failure: " + err.Error())
	}
	return int64(binary.BigEndian.Uint64(bs[:]))
}
874527
func (ung UniformGenerator) Int64n(n int64) int64 {
	if n <= 0 {
		panic(fmt.Sprintf("Illegal parameter n: %d", n))
	}
	ung.mu.Lock()
	defer ung.mu.Unlock()
	return ung.rd.Int63n(n)
}
1026986
func Int64Value(val string) (*wrappers.Int64Value, error) {
	parsedVal, err := Int64(val)
	return &wrappers.Int64Value{Value: parsedVal}, err
}
553073
func (t *TxStructure) HGetInt64(key []byte, field []byte) (int64, error) {
	value, err := t.HGet(key, field)
	if err != nil || value == nil {
		return 0, errors.Trace(err)
	}

	var n int64
	n, err = strconv.ParseInt(string(value), 10, 64)
	return n, errors.Trace(err)
}
694673
func (c *Config) GetInt64(key string) (i int64, err error) {
	val, ok := (*c)[key]
	if !ok {
		return 0, ErrNoSuchKey
	}
	switch val.(type) {
	case int8:
		return int64(val.(int8)), nil
	case int16:
		return int64(val.(int16)), nil
	case int:
		return int64(val.(int)), nil
	case int32:
		return int64(val.(int32)), nil
	case int64:
		return val.(int64), nil
	case float64:
		// json loads float64 so handle that case
		return int64(val.(float64)), nil
	default:
		return 0, fmt.Errorf("Wrong type for %s (Type:%T Expecting:%T)", key, val, i)
	}
}
593301
func Int64(names []string, value int64, usage string) *int64 {
	return CommandLine.Int64(names, value, usage)
}
344646
func (mmap MarshalMap) Int64Slice(key string) ([]int64, error) {
	return mmap.Int64Array(key)
}
174512
func (v *Value) Int64() (int64, error) {
	n, err := v.Number()

	if err != nil {
		return 0, err
	}

	return n.Int64()
}
1308577
func Int64Slice(src []int64) []*int64 {
	dst := make([]*int64, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}
853057
func (x *Big) Int64() (int64, bool) {
	if debug {
		x.validate()
	}

	if !x.IsFinite() {
		return 0, false
	}

	// x might be too large to fit into an int64 *now*, but rescaling x might
	// shrink it enough. See issue #20.
	if !x.isCompact() {
		xb := x.Int(nil)
		return xb.Int64(), xb.IsInt64()
	}

	u := x.compact
	if x.exp != 0 {
		var ok bool
		if u, ok = scalex(u, x.exp); !ok {
			return 0, false
		}
	}
	su := int64(u)
	if su >= 0 || x.Signbit() && su == -su {
		if x.Signbit() {
			su = -su
		}
		return su, true
	}
	return 0, false
}