// %f: -ddddddd.ddddd
351953
func fmtF(dst io.Writer, neg bool, d decimalSlice, prec int) (n int, err error) {
	a := pool_floatBuffer.Get().(*byteSliceBuffer)
	i := 0

	// sign
	if neg {
		a.bytes[i] = '-'
		i++
	}
	// integer, padded with zeros as needed.
	if d.dp > 0 {
		m := min(d.nd, d.dp)
		copy(a.bytes[i:], d.d[:m])
		i += m
		for ; m < d.dp; m++ {
			a.bytes[i] = '0'
			i++
		}
	} else {
		a.bytes[i] = '0'
		i++
	}

	// fraction
	if prec > 0 {
		a.bytes[i] = '.'
		i++
		for j := 0; j < prec; j++ {
			ch := byte('0')
			if j := d.dp + j; 0 <= j && j < d.nd {
				ch = d.d[j]
			}
			a.bytes[i] = ch
			i++
		}
	}
	n, err = dst.Write(a.bytes[0:i])
	pool_floatBuffer.Put(a)
	return
}
336093
func twoD(p []byte, n int) []byte {
	if n < 10 {
		return append(p, ' ', '0'+byte(n))
	}
	return strconv.AppendInt(p, int64(n), 10)
}
1016150
func IIDFromString(progId string) (clsid *GUID, err error) {
	var guid GUID
	lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId)))
	hr, _, _ := procIIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid)))
	if hr != 0 {
		err = NewError(hr)
	}
	clsid = &guid
	return
}
1115258
func (a *MandrillAPI) InboundDomainAdd(domain string) (InboundDomain, error) {
	return getInboundDomain(a, domain, add_domain_endpoint)
}
681453
func DebugDontPanicf(format string, i ...interface{}) {
	if gLogLevel <= LDebug {
		msg := fmt.Sprintf("%v\n %s", fmt.Sprintf(format, i...), debug.Stack())
		logMessage("PANIC - ", msg)
	}
}
479348
func roundUUIDDownIfOdd(prefix string, context structs.Context) string {
	if context == structs.Jobs {
		return prefix
	}

	// We ignore the count of hyphens when calculating if the prefix is even:
	// E.g "e3671fa4-21"
	numHyphens := strings.Count(prefix, "-")
	l := len(prefix) - numHyphens
	if l%2 == 0 {
		return prefix
	}
	return prefix[:len(prefix)-1]
}
1084287
func (e *FwdEdge) Fwd(c context.Context) (*Attempt, *FwdDep) {
	atmpt := &Attempt{ID: *e.From}
	return atmpt, &FwdDep{
		Depender: ds.KeyForObj(c, atmpt),
		Dependee: *e.To,
	}
}
1039090
func (s *DomainService) GetDomainChildrenID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListDomainChildrenParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListDomainChildren(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", name, l)
	}

	if l.Count == 1 {
		return l.DomainChildren[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.DomainChildren {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
841315
func (s *UpdateFunctionDefinitionInput) SetFunctionDefinitionId(v string) *UpdateFunctionDefinitionInput {
	s.FunctionDefinitionId = &v
	return s
}
445699
func (s *DiskOfferingService) GetDiskOfferingID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListDiskOfferingsParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListDiskOfferings(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", name, l)
	}

	if l.Count == 1 {
		return l.DiskOfferings[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.DiskOfferings {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
650867
func (fs *Goofys) insertInode(parent *Inode, inode *Inode) {
	inode.Id = fs.allocateInodeId()
	parent.insertChildUnlocked(inode)
	fs.inodes[inode.Id] = inode
}
1174355
func (a *Attempt_ID) DMEncoded() string {
	return fmt.Sprintf("%s|%08x", a.Quest, flipMask^a.Id)
}
560516
func (ai *AtomicInt) GetAndAdd(delta int) int {
	newVal := atomic.AddInt64(&ai.val, int64(delta))
	res := int(newVal - int64(delta))
	return res
}
1214252
func (s *GetFunctionDefinitionInput) SetFunctionDefinitionId(v string) *GetFunctionDefinitionInput {
	s.FunctionDefinitionId = &v
	return s
}
666683
func IDFromBytes(b []byte) (ID, error) {
	if _, err := mh.Cast(b); err != nil {
		return ID(""), err
	}
	return ID(b), nil
}
108232
func (w *QWriter) D(n int) {
	bb, ok := w.w.(*ByteBuffer)
	if ok {
		bb.B = strconv.AppendInt(bb.B, int64(n), 10)
	} else {
		w.b = strconv.AppendInt(w.b[:0], int64(n), 10)
		w.Write(w.b)
	}
}
1115876
func JujuXDGDataHomeDir() string {
	JujuXDGDataHomeDir := JujuXDGDataHome()
	if JujuXDGDataHomeDir != "" {
		return JujuXDGDataHomeDir
	}
	JujuXDGDataHomeDir = os.Getenv(JujuXDGDataHomeEnvKey)
	if JujuXDGDataHomeDir == "" {
		if runtime.GOOS == "windows" {
			JujuXDGDataHomeDir = jujuXDGDataHomeWin()
		} else {
			JujuXDGDataHomeDir = jujuXDGDataHomeLinux()
		}
	}
	return JujuXDGDataHomeDir
}