// GlobalUint looks up the value of a global UintFlag, returns
// 0 if not found
16650
func (c *Context) GlobalUint(name string) uint {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupUint(name, fs)
	}
	return 0
}
249749
func WriteUint(w io.ByteWriter, mag uint64) (int, error) {
	return writeSignMag(w, mag, 0)
}
1041644
func newGlobal() *Global {
	return &Global{
		MainThread: nil,
		Registry:   newLTable(0, 32),
		Global:     newLTable(0, 64),
		builtinMts: make(map[int]LValue),
		tempFiles:  make([]*os.File, 0, 10),
	}
}
1092002
func (cmd *CLI) DefineUint64Flag(name string, value uint64, usage string) *uint64 {
	p := new(uint64)
	cmd.DefineUint64FlagVar(p, name, value, usage)
	return p
}
1226287
func (c *Context) GlobalInt(name string) int {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupInt(name, fs)
	}
	return 0
}
1260514
func (c *Context) GlobalStringSlice(name string) []string {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupStringSlice(name, fs)
	}
	return nil
}
1195450
func (d *Context) ToUint(index int) uint {
	return uint(C.duk_to_uint(d.duk_context, C.duk_idx_t(index)))
}
301732
func DecodeUint(b []byte) ([]byte, uint64, error) {
	if len(b) < 8 {
		return nil, 0, errors.New("insufficient bytes to decode value")
	}

	v := binary.BigEndian.Uint64(b[:8])
	b = b[8:]
	return b, v, nil
}
775525
func (m Module) Global(name string) (DevicePtr, int64, error) {
	var d C.CUdeviceptr
	var size C.size_t
	cstr := C.CString(name)
	defer C.free(unsafe.Pointer(cstr))
	if err := result(C.cuModuleGetGlobal(&d, &size, m.mod, cstr)); err != nil {
		return 0, 0, err
	}
	return DevicePtr(d), int64(size), nil
}
932426
func (c *Context) GlobalFloat64(name string) float64 {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupFloat64(name, fs)
	}
	return 0
}
1267590
func asUint(param string) uint64 {

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

	return i
}
868343
func (r *Store) GetUintDefault(key string, def uint) uint {
	if v, err := r.GetUint(key); err == nil {
		return v
	}

	return def
}
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))
}
787958
func (d *defaulter) AsUint(v Valuer, dv uint) uint {
	value, err := v.Value()
	if err != nil {
		d.logValuerError(err)
		return dv
	}
	uivalue, err := strconv.ParseUint(value, 10, 0)
	if err != nil {
		d.logFormatError("uint", err)
		return dv
	}
	return uint(uivalue)
}
579188
func (c *Context) GlobalIntSlice(name string) []int {
	return lookupIntSlice(name, c.globalSet)
}
1089507
func NewUint32(v uint32) Value {
	return MakeTrusted(Uint32, strconv.AppendUint(nil, uint64(v), 10))
}
536734
func UInt() gopter.Gen {
	return UInt64Range(0, math.MaxUint32).
		Map(uint64ToUint).
		WithShrinker(UIntShrinker)
}