// getUint returns the 32 bytes at the specified address interpreted as a uint.
488246
func (mw *memoryWrapper) getUint(addr int64) *big.Int {
	if mw.memory.Len() < int(addr)+32 {
		// TODO(karalabe): We can't js-throw from Go inside duktape inside Go. The Go
		// runtime goes belly up https://github.com/golang/go/issues/15639.
		log.Warn("Tracer accessed out of bound memory", "available", mw.memory.Len(), "offset", addr, "size", 32)
		return new(big.Int)
	}
	return new(big.Int).SetBytes(mw.memory.GetPtr(addr, 32))
}
1034266
func readUint32(data []byte) uint32 {
	var ret uint32
	buf := bytes.NewBuffer(data)
	binary.Read(buf, binary.LittleEndian, &ret)
	return ret
}
868343
func (r *Store) GetUintDefault(key string, def uint) uint {
	if v, err := r.GetUint(key); err == nil {
		return v
	}

	return def
}
1267590
func asUint(param string) uint64 {

	i, err := strconv.ParseUint(param, 0, 64)
	panicIf(err)

	return i
}
596980
func (u Uint32) Get() (uint32, error) {
	if !u.Present() {
		var zero uint32
		return zero, errors.New("value not present")
	}
	return *u.value, nil
}
776172
func (s StringStringMap) GetUint32(key string) (uint32, error) {
	return s.getUint32(key, false)
}
641564
func (r *Reader) ReadUint() uint64 {
	tag := r.readByte()
	decoder := uintDecoders[tag]
	if decoder == nil {
		castError(tag, "uint64")
	}
	return decoder(r)
}
782785
func ReadUInt32(r io.Reader, byteOrder binary.ByteOrder) (uint32, error) {
	var buf [4]byte
	if _, err := io.ReadFull(r, buf[:]); err != nil {
		return 0, err
	}
	return byteOrder.Uint32(buf[:]), nil
}
77151
func ParseUint(s []byte, base int, bitSize int) (n uint64, err error) {
	if len(s) == 1 {
		switch s[0] {
		case '0':
			return 0, nil
		case '1':
			return 1, nil
		case '2':
			return 2, nil
		case '3':
			return 3, nil
		case '4':
			return 4, nil
		case '5':
			return 5, nil
		case '6':
			return 6, nil
		case '7':
			return 7, nil
		case '8':
			return 8, nil
		case '9':
			return 9, nil
		}
	}
	return internal.ParseUint(s, base, bitSize)
}
223243
func MinUintN(v ...uint) uint {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return MinUint(v[0], v[1])
	default:
		l := len(v) / 2
		return MinUintN(MinUintN(v[:l]...), MinUintN(v[l:]...))
	}
}
1260803
func (tag PluginStructTag) GetUint() uint64 {
	tagValue, tagSet := reflect.StructTag(tag).Lookup(PluginStructTagDefault)
	if !tagSet || len(tagValue) == 0 {
		return 0
	}

	value, err := tstrings.AtoU64(tagValue)
	if err != nil {
		panic(err)
	}
	return value
}
16650
func (c *Context) GlobalUint(name string) uint {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupUint(name, fs)
	}
	return 0
}
1038127
func ParseUint(s []byte, base int, bitSize int) (n uint64, err error) {
	var cutoff, maxVal uint64

	if bitSize == 0 {
		bitSize = int(IntSize)
	}

	s0 := s
	switch {
	case len(s) < 1:
		err = ErrSyntax
		goto Error

	case 2 <= base && base <= 36:
		// valid base; nothing to do

	case base == 0:
		// Look for octal, hex prefix.
		switch {
		case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'):
			base = 16
			s = s[2:]
			if len(s) < 1 {
				err = ErrSyntax
				goto Error
			}
		case s[0] == '0':
			base = 8
		default:
			base = 10
		}

	default:
		err = errors.New("invalid base " + strconv.Itoa(base))
		goto Error
	}

	n = 0
	cutoff = cutoff64(base)
	maxVal = 1<<uint(bitSize) - 1

	for i := 0; i < len(s); i++ {
		var v byte
		d := s[i]
		switch {
		case '0' <= d && d <= '9':
			v = d - '0'
		case 'a' <= d && d <= 'z':
			v = d - 'a' + 10
		case 'A' <= d && d <= 'Z':
			v = d - 'A' + 10
		default:
			n = 0
			err = ErrSyntax
			goto Error
		}
		if int(v) >= base {
			n = 0
			err = ErrSyntax
			goto Error
		}

		if n >= cutoff {
			// n*base overflows
			n = 1<<64 - 1
			err = ErrRange
			goto Error
		}
		n *= uint64(base)

		n1 := n + uint64(v)
		if n1 < n || n1 > maxVal {
			// n+v overflows
			n = 1<<64 - 1
			err = ErrRange
			goto Error
		}
		n = n1
	}

	return n, nil

Error:
	return n, &NumError{"ParseUint", string(s0), err}
}
1358068
func (u Uint) Get() (uint, error) {
	if !u.Present() {
		var zero uint
		return zero, errors.New("value not present")
	}
	return *u.value, nil
}
1323123
func (m *Manager) GetUint32(key string) uint32 {
	return cast.ToUint32(m.Get(key))
}
1169078
func (e *Entity) GetUint64(name string) (uint64, bool) {
	x, ok := e.Get(name).(uint64)
	return x, ok
}
7031
func (m *HashMap) GetUintKey(key uintptr) (value interface{}, ok bool) {
	// inline getUintptrHash()
	bh := reflect.SliceHeader{
		Data: uintptr(unsafe.Pointer(&key)),
		Len:  intSizeBytes,
		Cap:  intSizeBytes,
	}
	buf := *(*[]byte)(unsafe.Pointer(&bh))
	h := uintptr(siphash.Hash(sipHashKey1, sipHashKey2, buf))

	data, element := m.indexElement(h)
	if data == nil {
		return nil, false
	}

	// inline HashMap.searchItem()
	for element != nil {
		if element.keyHash == h && element.key == key {
			return element.Value(), true
		}

		if element.keyHash > h {
			return nil, false
		}

		element = element.Next()
	}
	return nil, false
}