// MinInt64N returns the smallest int64 in the set provided.
// If no values are provided, MinInt64 returns 0.
327796
func MinInt64N(v ...int64) int64 {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return MinInt64(v[0], v[1])
	default:
		l := len(v) / 2
		return MinInt64N(MinInt64N(v[:l]...), MinInt64N(v[l:]...))
	}
}
26304
func MaxUint32N(v ...uint32) uint32 {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return MaxUint32(v[0], v[1])
	default:
		l := len(v) / 2
		return MaxUint32N(MaxUint32N(v[:l]...), MaxUint32N(v[l:]...))
	}
}
107830
func (c *transfer) N() (n int64) {
	if c == nil {
		return 0
	}
	n = atomic.LoadInt64(&c.n)
	return
}
1206506
func Min(a, b []float64) {
	b = b[:len(a)]

	for i, v := range a {
		bv := b[i]
		if bv < v {
			a[i] = bv
		}
	}
}
342662
func Argmin(a []float64) int {
	var f float64
	var min int
	var set bool
	for i, v := range a {
		if !set {
			f = v
			min = i
			set = true

			continue
		}

		// TODO: Maybe error instead of this?
		if math.IsNaN(v) || math.IsInf(v, -1) {
			min = i
			f = v
			break
		}

		if v < f {
			min = i
			f = v
		}
	}
	return min
}
499602
func (r *Rand) Intn(n int) int {
	if n <= 0 {
		panic("invalid argument to Intn")
	}
	if n <= 1<<31-1 {
		return int(r.Int31n(int32(n)))
	}
	return int(r.Int63n(int64(n)))
}
731318
func maxUint64(ints ...uint64) uint64 {
	maxInt := ints[0]
	for i := 1; i < len(ints); i++ {
		if ints[i] > maxInt {
			maxInt = ints[i]
		}
	}

	return maxInt
}
457534
func CountLeadZero64(value uint64) (uint) {
    var count uint = 0

    if (value >> 32) == 0 {
        count += 32
    } else {
        value >>= 32;
    }

    return count + CountLeadZero32(uint32(value))
}
945599
func minIndex(slice []float64) int {
	if len(slice) == 0 {
		return -1
	}
	min := slice[0]
	minIndex := 0
	for index := 0; index < len(slice); index++ {
		if slice[index] < min {
			min = slice[index]
			minIndex = index
		}
	}
	return minIndex
}
1187420
func (s *SummarizedCounter) SetN(v int64) *SummarizedCounter {
	s.N = &v
	return s
}
167071
func (dec *Decoder) Int64Null(v **int64) error {
	err := dec.decodeInt64Null(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
401546
func MinN(v ...int) int {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return Min(v[0], v[1])
	default:
		l := len(v) / 2
		return MinN(MinN(v[:l]...), MinN(v[l:]...))
	}
}
782387
func (pcg *Pcg64x32) NextN(bounds uint32) uint32 {
  threshold := (0 - bounds) % bounds
  for {
    result := pcg.Next()
    if result >= threshold {
      return result % bounds;
    }
  }
}
667433
func (lr *LockedRand) Uint64() (n uint64) {
	lr.lk.Lock()
	n = lr.r.Uint64()
	lr.lk.Unlock()
	return
}
132459
func Int64(v []byte, err error) (int64, error) {
	if err != nil {
		return 0, err
	} else if v == nil || len(v) == 0 {
		return 0, nil
	} else if len(v) != 8 {
		return 0, errIntNumber
	}

	return int64(binary.LittleEndian.Uint64(v)), nil
}
689769
func SetMinInt(min int64) integerRuleOpt {
	return func(i *rpc.IntegerRule) {
		i.Minimum = min
		i.HasMin = true
	}
}
861850
func minUint64(ints ...uint64) uint64 {
	minInt := ints[0]
	for i := 1; i < len(ints); i++ {
		if ints[i] < minInt {
			minInt = ints[i]
		}
	}

	return minInt
}