// PopInt returns a value from the list, it panics if not enough values
// were allocated
6499
func (p *PortList) PopInt() int {
	i, err := strconv.Atoi(p.Pop())
	if err != nil {
		panic(err)
	}
	return i
}
603056
func (d Data) GetInt(key string) int {
	if !d.KeyExists(key) || len(d.Values[key]) == 0 {
		return 0
	}
	str := d.Get(key)
	if result, err := strconv.Atoi(str); err != nil {
		panic(err)
	} else {
		return result
	}
}
811315
func (env *Env) SetInt(key string, value int) {
	env.Set(key, strconv.Itoa(value))
}
1036248
func (b Bitmap32) PopCount() int {
	// http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
	b -= (b >> 1) & 0x55555555
	b = (b>>2)&0x33333333 + b&0x33333333
	b += b >> 4
	b &= 0x0f0f0f0f
	b *= 0x01010101
	return int(byte(b >> 24))
}
1243336
func (s *stack) Pop() (interface{}, error) {
	lv := len(s.values)
	if lv == 0 {
		return nil, errors.New(ErrEmpty, errorMessages)
	}
	v := s.values[lv-1]
	s.values = s.values[:lv-1]
	return v, nil
}
218355
func (h *Ints) Pop() int {
	if h.less == nil {
		PopToLastF(len(h.list), h.list.Less, h.list.Swap)
	} else {
		PopToLastF(len(h.list), h.less, h.list.Swap)
	}

	res := h.list[len(h.list)-1]
	h.list = h.list[:len(h.list)-1]

	return res
}
235984
func Pop(h Interface) interface{} {
	n := h.Len() - 1
	h.Swap(n, 0)
	shuffleDown(h, 0, n)
	return h.Pop()
}
1185305
func (p *parser) popOptions() {
	lastIdx := len(p.optionsStack) - 1
	// get the last item on the stack and then remove it by reslicing
	p.options = p.optionsStack[lastIdx]
	p.optionsStack = p.optionsStack[:lastIdx]
}
336645
func (h *nextRowHeap) Pop() interface{} {
	old := h.nextRowByInputs
	n := len(old)
	x := old[n-1]
	h.nextRowByInputs = old[0 : n-1]
	return x
}
1307149
func (c *Context) GetInt(key string) (i int) {
	if val, ok := c.Get(key); ok && val != nil {
		i, _ = val.(int)
	}
	return
}
856533
func (s Byte) PopAny() (byte, bool) {
	for key := range s {
		s.Delete(key)
		return key, true
	}
	var zeroValue byte
	return zeroValue, false
}
215090
func (b *ByteBuf) PeekInt(offset int) (int, error) {
	if b.Readable() < 4+offset {
		return 0, io.ErrShortBuffer
	}

	start := b.readerIndex + offset
	return Byte2Int(b.buf[start : start+4]), nil
}
1264814
func (s *regexFcd) pushInt(I int) {
	if s.intDepth >= len(s.intStack) {
		expanded := make([]int, s.intDepth*2)
		copy(expanded, s.intStack)
		s.intStack = expanded
	}

	s.intStack[s.intDepth] = I
	s.intDepth++
}
447722
func (s *items) pop() (out Item) {
	index := len(*s) - 1
	out = (*s)[index]
	(*s)[index] = nil
	*s = (*s)[:index]
	return
}
589487
func (dec *Decoder) SliceInt(s *[]int) error {
	err := dec.Array(DecodeArrayFunc(func(dec *Decoder) error {
		var i int
		if err := dec.Int(&i); err != nil {
			return err
		}
		*s = append(*s, i)
		return nil
	}))

	if err != nil {
		return err
	}
	return nil
}
1366155
func (v *Value) ToInt() (val int64, ok bool) {
	switch v.vType {
	case typeInt:
		val, ok = v.value.(int64)
	default:
	}
	return
}
411388
func asInt(param string) (int64, error) {
	i, err := strconv.ParseInt(param, 0, 64)
	if err != nil {
		return 0, ErrBadParameter
	}
	return i, nil
}