// ZeroReg generates "XORQ reg, reg" instructions
168101
func ZeroReg(ctx context, reg *register) string {
	var dt OpDataType
	if reg.typ == XMM_REG {
		dt = OpDataType{OP_XMM, InstrData{}, XMM_2X_F64}

	} else {
		dt = OpDataType{OP_DATA, InstrData{signed: false, size: reg.width / 8}, XMM_INVALID}
	}
	return instrRegReg(ctx, GetInstr(I_XOR, dt), reg, reg, false)
}
402060
func (q MatchQuery) ZeroTermsQuery(zeroTermsQuery string) MatchQuery {
	q.zeroTermsQuery = zeroTermsQuery
	return q
}
455074
func Regproceduresend(db XODB, v0 pgtypes.Regprocedure) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.regproceduresend($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
1354836
func unaryOpNeg(rate int8, in Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(UnaryOpUgenName, rate, UnaryOpNeg, numOutputs, in)
}
1140995
func ZeroOf(in interface{}) interface{} {
	if in == nil {
		return nil
	}

	return reflect.Zero(reflect.TypeOf(in)).Interface()
}
1279154
func (s *Schema) ZeroValue() interface{} {
	// If it's a set then we'll do a bit of extra work to provide the
	// right hashing function in our empty value.
	if s.Type == TypeSet {
		setFunc := s.Set
		if setFunc == nil {
			// Default set function uses the schema to hash the whole value
			elem := s.Elem
			switch t := elem.(type) {
			case *Schema:
				setFunc = HashSchema(t)
			case *Resource:
				setFunc = HashResource(t)
			default:
				panic("invalid set element type")
			}
		}
		return &Set{F: setFunc}
	} else {
		return s.Type.Zero()
	}
}
1203292
func LinearReg(inReal []float64, inTimePeriod int) []float64 {

	outReal := make([]float64, len(inReal))

	inTimePeriodF := float64(inTimePeriod)
	lookbackTotal := inTimePeriod
	startIdx := lookbackTotal
	outIdx := startIdx - 1
	today := startIdx - 1
	sumX := inTimePeriodF * (inTimePeriodF - 1) * 0.5
	sumXSqr := inTimePeriodF * (inTimePeriodF - 1) * (2*inTimePeriodF - 1) / 6
	divisor := sumX*sumX - inTimePeriodF*sumXSqr
	//initialize values of sumY and sumXY over first (inTimePeriod) input values
	sumXY := 0.0
	sumY := 0.0
	i := inTimePeriod
	for i != 0 {
		i--
		tempValue1 := inReal[today-i]
		sumY += tempValue1
		sumXY += float64(i) * tempValue1
	}
	for today < len(inReal) {
		//sumX and sumXY are already available for first output value
		if today > startIdx-1 {
			tempValue2 := inReal[today-inTimePeriod]
			sumXY += sumY - inTimePeriodF*tempValue2
			sumY += inReal[today] - tempValue2
		}
		m := (inTimePeriodF*sumXY - sumX*sumY) / divisor
		b := (sumY - m*sumX) / inTimePeriodF
		outReal[outIdx] = b + m*(inTimePeriodF-1)
		outIdx++
		today++
	}
	return outReal
}
1184373
func (regs *DwarfRegisters) AddReg(idx uint64, reg *DwarfRegister) {
	if idx >= uint64(len(regs.Regs)) {
		newRegs := make([]*DwarfRegister, idx+1)
		copy(newRegs, regs.Regs)
		regs.Regs = newRegs
	}
	regs.Regs[idx] = reg
}
912298
func AppendEflagReg(regs []Register, name string, value uint64) []Register {
	return appendFlagReg(regs, name, value, eflagsDescription, 64)
}
469128
func RegisterFieldDecoderFunc(typ string, field string, fun DecoderFunc) {
	RegisterFieldDecoder(typ, field, &funcDecoder{fun})
}
360002
func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.Zerof(t, i, msg, args...) {
		return
	}
	t.FailNow()
}
323686
func (t *StandardTokenizerImpl) zzRefill() (bool, error) {
	// first: make room (if you can)
	if t.zzStartRead > 0 {
		t.zzEndRead += t.zzFinalHighSurrogate
		t.zzFinalHighSurrogate = 0
		copy(t.zzBuffer, t.zzBuffer[t.zzStartRead:t.zzEndRead])

		// translate stored positions
		t.zzEndRead -= t.zzStartRead
		t.zzCurrentPos -= t.zzStartRead
		t.zzMarkedPos -= t.zzStartRead
		t.zzStartRead = 0
	}

	// fill the buffer with new input
	var requested = len(t.zzBuffer) - t.zzEndRead - t.zzFinalHighSurrogate
	var totalRead = 0
	var err error
	for totalRead < requested && err != io.EOF {
		var numRead int
		if numRead, err = readRunes(t.zzReader.(io.RuneReader),
			t.zzBuffer[t.zzEndRead+totalRead:]); err != nil && err != io.EOF {
			return false, err
		}
		totalRead += numRead
	}

	if totalRead > 0 {
		t.zzEndRead += totalRead
		if totalRead == requested { // possibly more input available
			panic("niy")
		}
		return false, nil
	}

	assert(totalRead == 0 && err == io.EOF)
	return true, nil
}
1008548
func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.Zero(t, i, msgAndArgs...) {
		return
	}
	t.FailNow()
}
1000264
func NewRegexpQuery(name string, regexp string) RegexpQuery {
	return RegexpQuery{name: name, regexp: regexp}
}
851720
func (l *Lexer) indexRegexp(r *regexp.Regexp) int {
	loc := r.FindStringIndex(l.input[l.pos:])
	if loc == nil {
		return -1
	}
	return loc[0]
}
99770
func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) {
		return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...)
	}
	return true
}
1056010
func builtinRegexp(args []types.Datum, _ context.Context) (d types.Datum, err error) {
	// TODO: We don't need to compile pattern if it has been compiled or it is static.
	if args[0].IsNull() || args[1].IsNull() {
		return
	}

	targetStr, err := args[0].ToString()
	if err != nil {
		return d, errors.Errorf("non-string Expression in LIKE: %v (Value of type %T)", args[0], args[0])
	}
	patternStr, err := args[1].ToString()
	if err != nil {
		return d, errors.Errorf("non-string Expression in LIKE: %v (Value of type %T)", args[1], args[1])
	}
	re, err := regexp.Compile(patternStr)
	if err != nil {
		return d, errors.Trace(err)
	}
	d.SetInt64(boolToInt64(re.MatchString(targetStr)))
	return
}