// getInt32Slice copies []int32 from p as a new slice.
// This behavior differs from the implementation in pointer_unsafe.go.
430276
func (p pointer) getInt32Slice() []int32 {
	if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
		// raw int32 type
		return p.v.Elem().Interface().([]int32)
	}
	// an enum
	// Allocate a []int32, then assign []enum's values into it.
	// Note: we can't convert []enum to []int32.
	slice := p.v.Elem()
	s := make([]int32, slice.Len())
	for i := 0; i < slice.Len(); i++ {
		s[i] = int32(slice.Index(i).Int())
	}
	return s
}
971367
func TryToInt64Slice(i interface{}) (r []int64, err error) {
	switch v := i.(type) {
	case []int:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index] = int64(value)
		}
	case []int32:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index] = int64(value)
		}
	case []int64:
		r = v
	case *[]int64:
		r = *v
	case []string:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index], err = TryToInt64(value)
			if err != nil {
				return
			}
		}
	default:
		err = castError(i, "[]int64")
	}
	return
}
1336403
func StringToInt64Slice(s, sep string) []int64 {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int64, len(fields))
	for i, f := range fields {
		slice[i] = ToInt64(f)
	}
	return slice
}
965090
func StringToInt32Slice(s, sep string) []int32 {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int32, len(fields))
	for i, f := range fields {
		slice[i] = ToInt32(f)
	}
	return slice
}
744657
func StringToIntSlice(s, sep string) []int {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int, len(fields))
	for i, f := range fields {
		slice[i] = ToInt(f)
	}
	return slice
}
1189422
func ByteSliceToUint64Slice(in []byte) ([]uint64, error) {
	buffer := bytes.NewBuffer(in)

	out := make([]uint64, len(in)/8)
	err := binary.Read(buffer, STORE_ENDIAN, &out)
	if err != nil {
		return nil, err
	}
	return out, nil
}
9579
func (h *HLLPP) getIndex(k uint32, p uint8) uint32 {
	if k&1 > 0 {
		return sliceBits32(k, 6+h.pp, 1+6+h.pp-p)
	} else {
		return sliceBits32(k, h.pp, 1+h.pp-p)
	}
}
389840
func Int32Value(val string) (*wrappers.Int32Value, error) {
	parsedVal, err := Int32(val)
	return &wrappers.Int32Value{Value: parsedVal}, err
}
861069
func Int32(name rune, value int32, helpvalue ...string) *int32 {
	return CommandLine.Int32(name, value, helpvalue...)
}
1190076
func Uint64Slice(src []uint64) []*uint64 {
	dst := make([]*uint64, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}
762480
func Int32(v int32) *int32 {
	p := new(int32)
	*p = v
	return p
}
861872
func Int32Slice(val, sep string) ([]int32, error) {
	s := strings.Split(val, sep)
	values := make([]int32, len(s))
	for i, v := range s {
		value, err := Int32(v)
		if err != nil {
			return values, err
		}
		values[i] = value
	}
	return values, nil
}
1181492
func (a *Array) Int32(i int32) *Array {
	a.buf = enc.AppendInt32(enc.AppendArrayDelim(a.buf), i)
	return a
}
597933
func InStringSlice(sl []string, val string) bool {
	for _, s := range sl {
		if s == val {
			return true
		}
	}

	return false
}
365179
func Uint32Slice(src []uint32) []*uint32 {
	dst := make([]*uint32, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}
121686
func (p pointer) setInt32Slice(v []int32) {
	if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
		// raw int32 type
		p.v.Elem().Set(reflect.ValueOf(v))
		return
	}
	// an enum
	// Allocate a []enum, then assign []int32's values into it.
	// Note: we can't convert []enum to []int32.
	slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v))
	for i, x := range v {
		slice.Index(i).SetInt(int64(x))
	}
	p.v.Elem().Set(slice)
}
935989
func IntSlice(s Interface) []int {
	slice := make([]int, 0)
	for _, item := range s.List() {
		v, ok := item.(int)
		if !ok {
			continue
		}

		slice = append(slice, v)
	}
	return slice
}