text:
package take14

import (
	"fmt"
	"math/rand"
)

const RESIGN_VALUE = -32768
const MAX_VALUE = 32767

var nodesNum int
var depthEnd int = 2 // 1 // 3 はまだ遅い

type CuttingType int

const (
	CuttingNone        = CuttingType(0)
	CuttingKingCapture = CuttingType(1)
)

// Search - 探索部
func Search(pPosSys *PositionSystem) Move {

	nodesNum = 0
	curDepth := 0
	//fmt.Printf("Search: depth=%d/%d nodesNum=%d\n", curDepth, depthEnd, nodesNum)

	bestMove, bestVal := search2(pPosSys, curDepth)

	// 評価値出力（＾～＾）
	G.Chat.Print("info depth %d nodes %d score cp %d currmove %s pv %s\n",
		curDepth, nodesNum, bestVal, bestMove.ToCode(), bestMove.ToCode())

	// ゲーム向けの軽い乱数
	return bestMove
}

// search2 - 探索部
func search2(pPosSys *PositionSystem, curDepth int) (Move, int16) {
	//fmt.Printf("Search2: depth=%d/%d nodesNum=%d\n", curDepth, depthEnd, nodesNum)

	// 指し手生成
	// 探索中に削除される指し手も入ってるかも
	move_list := GenMoveList(pPosSys, pPosSys.PPosition[POS_LAYER_MAIN])
	move_length := len(move_list)
	//fmt.Printf("%d/%d move_length=%d\n", curDepth, depthEnd, move_length)

	if move_length == 0 {
		return RESIGN_MOVE, RESIGN_VALUE
	}

	// 同じ価値のベストムーブがいっぱいあるかも（＾～＾）
	var bestMoveList []Move
	var bestMove = RESIGN_MOVE
	// 最初に最低値を入れておけば、更新されるだろ（＾～＾）
	var bestVal int16 = RESIGN_VALUE

	// 相手の評価値
	var opponentWorstVal int16 = MAX_VALUE
	var younger_sibling_move = RESIGN_MOVE
	// 探索終了
	var cutting = CuttingNone

	// その手を指してみるぜ（＾～＾）
	for i, move := range move_list {
		// G.Chat.Debug("move=%s\n", move.ToCode())

		// 盤をコピーしておきます
		pPosCopy := NewPosition()
		copyBoard(pPosSys.PPosition[0], pPosCopy)

		// DoMove と UndoMove を繰り返していると、ずれてくる（＾～＾）
		if pPosSys.PPosition[POS_LAYER_MAIN].IsEmptySq(move.GetSource()) {
			// 強制終了した局面（＾～＾）
			G.Chat.Debug(pPosSys.PPosition[POS_LAYER_MAIN].Sprint(
				pPosSys.phase,
				pPosSys.StartMovesNum,
				pPosSys.OffsetMovesIndex,
				pPosSys.createMovesText()))
			// あの駒、どこにいんの（＾～＾）？
			G.Chat.Debug(pPosSys.PPosition[POS_LAYER_MAIN].SprintLocation())
			panic(fmt.Errorf("Move.Source(%d) has empty square. i=%d/%d. younger_sibling_move=%s",
				move.GetSource(), i, move_length, younger_sibling_move.ToCode()))
		}

		pPosSys.DoMove(pPosSys.PPosition[POS_LAYER_MAIN], move)
		nodesNum += 1

		// 取った駒は棋譜の１手前に記録されています
		captured := pPosSys.CapturedList[pPosSys.OffsetMovesIndex-1]

		// 玉を取るのは最善手
		if What(captured) == PIECE_TYPE_K {
			bestMove = move
			bestVal = pPosSys.PPosition[POS_LAYER_MAIN].MaterialValue
			cutting = CuttingKingCapture
		} else {
			if curDepth < depthEnd {
				// 再帰
				_, opponentVal := search2(pPosSys, curDepth+1)
				// 再帰直後（＾～＾）
				// G.Chat.Debug(pPosSys.Sprint(POS_LAYER_MAIN))

				if opponentVal < opponentWorstVal {
					// より低い価値が見つかったら更新
					bestMoveList = nil
					bestMoveList = append(bestMoveList, move)
					opponentWorstVal = opponentVal
				} else if opponentVal == opponentWorstVal {
					// 最低値が並んだら配列の要素として追加
					bestMoveList = append(bestMoveList, move)
				}

			} else {
				// 葉ノードでは、相手の手ではなく、自分の局面に点数を付けます

				// 自玉と相手玉のどちらが有利な場所にいるか比較
				control_val := EvalControlVal(pPosSys)
				materialVal := pPosSys.PPosition[POS_LAYER_MAIN].MaterialValue

				leafVal := materialVal + int16(control_val)

				//fmt.Printf("move=%s leafVal=%6d materialVal=%6d(%s) control_val=%6d\n", move.ToCode(), leafVal, materialVal, captured.ToCode(), control_val)
				if bestVal < leafVal {
					// より高い価値が見つかったら更新
					bestMoveList = nil
					bestMoveList = append(bestMoveList, move)
					bestVal = leafVal
				} else if bestVal == leafVal {
					// 最高値が並んだら配列の要素として追加
					bestMoveList = append(bestMoveList, move)
				}
			}
		}

		pPosSys.UndoMove(pPosSys.PPosition[POS_LAYER_MAIN])

		// 盤と、コピー盤を比較します
		diffBoard(pPosSys.PPosition[0], pPosCopy, pPosSys.PPosition[2], pPosSys.PPosition[3])
		// 異なる箇所を数えます
		errorNum := errorBoard(pPosSys.PPosition[0], pPosCopy, pPosSys.PPosition[2], pPosSys.PPosition[3])
		if errorNum != 0 {
			// 違いのあった局面（＾～＾）
			G.Chat.Debug(pPosSys.SprintDiff(0, 1))
			// あの駒、どこにいんの（＾～＾）？
			G.Chat.Debug(pPosSys.PPosition[0].SprintLocation())
			G.Chat.Debug(pPosCopy.SprintLocation())
			panic(fmt.Errorf("Error: count=%d younger_sibling_move=%s move=%s", errorNum, younger_sibling_move.ToCode(), move.ToCode()))
		}

		younger_sibling_move = move

		if cutting != CuttingNone {
			break
		}
	}

	switch cutting {
	case CuttingKingCapture:
		// 玉取った
	default:
		if curDepth < depthEnd {
			// 葉以外のノード
			// 相手の評価値の逆が、自分の評価値
			bestVal = -opponentWorstVal
		}

		bestmove_length := len(bestMoveList)
		//fmt.Printf("%d/%d bestmove_length=%d\n", curDepth, depthEnd, bestmove_length)
		if bestmove_length > 0 {
			// 0件を避ける（＾～＾）
			bestMove = bestMoveList[rand.Intn(bestmove_length)]
		}

		// 評価値出力（＾～＾）
		// G.Chat.Print("info depth 0 nodes %d score cp %d currmove %s pv %s\n", nodesNum, bestVal, bestMove.ToCode(), bestMove.ToCode())

	}

	return bestMove, bestVal
}


text:
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package vdl

// Naming conventions to distinguish this package from reflect:
//   tt - refers to *Type
//   vv - refers to *Value
//   rt - refers to reflect.Type
//   rv - refers to reflect.Value

import (
	"errors"
	"fmt"
	"reflect"
)

var (
	ErrFieldNoExist = errors.New("field doesn't exist")

	errTargetInvalid    = errors.New("invalid target")
	errTargetUnsettable = errors.New("unsettable target")
	errArrayIndex       = errors.New("array index out of range")
)

// convTarget represents the state and logic for value conversion.
//
// TODO(toddw): Split convTarget apart into reflectTarget and valueTarget.
type convTarget struct {
	// Conceptually this is a disjoint union between the two types of destination
	// values: *Value and reflect.Value.  Only one of the vv and rv fields is
	// ever valid.  We split into two fields and perform "if vv == nil" checks in
	// each method rather than using an interface for performance reasons.
	//
	// The tt field is always non-nil, and represents the type of the value.
	tt *Type
	vv *Value
	rv reflect.Value
}

// TODO(bprosnitz) Remove this -- it exists to get the reflect value for VOM and avoid package dependency cycles.
func (c convTarget) HackGetRv() reflect.Value {
	return c.rv
}

// ReflectTarget returns a conversion Target based on the given reflect.Value.
// Some rules depending on the type of rv:
//   o If rv is a valid *Value, it is filled in directly.
//   o Otherwise rv must be a settable value (i.e. it must be a pointer).
//   o Pointers are followed, and logically "flattened".
//   o New values are automatically created for nil pointers.
//   o Targets convertible to *Type and *Value are filled in directly.
func ReflectTarget(rv reflect.Value) (Target, error) {
	if !rv.IsValid() {
		return nil, errTargetInvalid
	}
	if vv := extractValue(rv); vv.IsValid() {
		return valueConv(vv), nil
	}
	tt, err := TypeFromReflect(rv.Type())
	if err != nil {
		return nil, err
	}
	if !rv.CanSet() && rv.Kind() == reflect.Ptr && !rv.IsNil() {
		// Dereference the pointer a single time to make rv settable.
		rv = rv.Elem()
	}
	target, err := reflectConv(rv, tt)
	if err != nil {
		return nil, err
	}
	return target, nil
}

// ValueTarget returns a conversion Target based on the given Value.
// Returns an error if the given Value isn't valid.
func ValueTarget(vv *Value) (Target, error) {
	if !vv.IsValid() {
		return nil, errTargetInvalid
	}
	return valueConv(vv), nil
}

func reflectConv(rv reflect.Value, tt *Type) (convTarget, error) {
	if !rv.IsValid() {
		return convTarget{}, errTargetInvalid
	}
	if vv := extractValue(rv); vv.IsValid() {
		return valueConv(vv), nil
	}
	if !rv.CanSet() {
		return convTarget{}, errTargetUnsettable
	}
	return convTarget{tt: tt, rv: rv}, nil
}

func valueConv(vv *Value) convTarget {
	return convTarget{tt: vv.Type(), vv: vv}
}

func extractValue(rv reflect.Value) *Value {
	for rv.Kind() == reflect.Ptr && !rv.IsNil() {
		if rv.Type().ConvertibleTo(rtPtrToValue) {
			return rv.Convert(rtPtrToValue).Interface().(*Value)
		}
		rv = rv.Elem()
	}
	return nil
}

// startConvert prepares to fill in c, converting from type ttFrom.  Returns fin
// and fill which are used by finishConvert to finish the conversion; fin
// represents the final target to assign to, and fill represents the target to
// actually fill in.
func startConvert(c convTarget, ttFrom *Type) (fin, fill convTarget, err error) {
	if ttFrom.Kind() == Any {
		return convTarget{}, convTarget{}, fmt.Errorf("can't convert from type %q - either call target.FromNil or target.From* for the element value", ttFrom)
	}
	if !Compatible(c.tt, ttFrom) {
		return convTarget{}, convTarget{}, fmt.Errorf("types %q and %q aren't compatible", c.tt, ttFrom)
	}
	fin = createFinTarget(c, ttFrom)
	fill, err = createFillTarget(fin, ttFrom)
	if err != nil {
		return convTarget{}, convTarget{}, err
	}
	return fin, fill, nil
}

// setZeroVDLValue checks whether rv is convertible to *Value, and if so,
// sets rv to the zero value of ttFrom, returning the resulting value.
func setZeroVDLValue(rv reflect.Value, ttFrom *Type) *Value {
	if rv.Type().ConvertibleTo(rtPtrToValue) {
		vv := rv.Convert(rtPtrToValue).Interface().(*Value)
		if !vv.IsValid() {
			vv = ZeroValue(ttFrom)
			rv.Set(reflect.ValueOf(vv).Convert(rv.Type()))
		}
		return vv
	}
	return nil
}

// createFinTarget returns the fin target for the conversion, flattening
// pointers and creating new non-nil values as necessary.
func createFinTarget(c convTarget, ttFrom *Type) convTarget {
	if c.vv == nil {
		// Create new pointers down to the final non-pointer value.
		for c.rv.Kind() == reflect.Ptr {
			// Handle case where rv is *Value; fill it in directly.
			if vv := setZeroVDLValue(c.rv, ttFrom); vv.IsValid() {
				if vv.Kind() == Optional {
					vv.Assign(NonNilZeroValue(vv.Type()))
					return convTarget{tt: ttFrom, vv: vv.Elem()}
				}
				return convTarget{tt: ttFrom, vv: vv}
			}
			// Set nil pointers to new pointers.
			if c.rv.IsNil() {
				c.rv.Set(reflect.New(c.rv.Type().Elem()))
			}
			// Stop at *Type to allow TypeObject values to be assigned.
			if c.rv.Type().Elem() == rtType {
				return c
			}
			c.rv = c.rv.Elem()
		}
		if c.tt.Kind() == Optional {
			c.tt = c.tt.Elem() // flatten c.tt to match c.rv
		}
	} else {
		// Create a non-nil value for optional types.
		if c.tt.Kind() == Optional {
			c.vv.Assign(NonNilZeroValue(c.tt))
			c.tt, c.vv = c.tt.Elem(), c.vv.Elem()
		}
	}
	return c
}

// createFillTarget returns the fill target for the conversion, creating new
// values of the appropriate type if necessary.  The fill target must be a
// concrete type; if fin has type interface/any, we'll create a concrete type,
// and finishConvert will assign fin from the fill target.  The type we choose
// to create is either a special-case (error or union), or based on the ttFrom
// type we're converting *from*.
//
// If fin is already a concrete type it's used directly as the fill target.
//
// TODO(toddw): The conversion logic is way too complicated, with many similar
// branches; rewrite this entire file..
func createFillTarget(fin convTarget, ttFrom *Type) (convTarget, error) {
	if fin.vv == nil {
		// Handle case where fin.rv is the native error type; create the standard
		// WireError struct to fill in.
		if ni, err := nativeInfoForError(); err == nil && fin.rv.Type() == ni.NativeType {
			return reflectConv(reflect.New(rtWireError).Elem(), ErrorType.Elem())
		}
		// Handle case where fin.rv is a native type; return the wire type as the
		// fill target, and rely on finishConvert to perform the final step of
		// converting from the wire type to the native type.
		//
		// TODO(toddw): This doesn't handle pointer native types.
		if ni := nativeInfoFromNative(fin.rv.Type()); ni != nil {
			tt, err := TypeFromReflect(ni.WireType)
			if err != nil {
				return convTarget{}, err
			}
			return reflectConv(reflect.New(ni.WireType).Elem(), tt)
		}
		if fin.rv.Kind() == reflect.Interface {
			// We're converting into an interface, so we can't just fill into the fin
			// target directly.  Return the appropriate fill value.
			switch {
			case fin.rv.Type() == rtError || ttFrom == ErrorType:
				// Create the standard WireError struct to fill in, with the pointer.
				return reflectConv(reflect.New(rtWireError).Elem(), ErrorType)
			case ttFrom == ErrorType.Elem():
				// Create the standard WireError struct to fill in, without the pointer.
				return reflectConv(reflect.New(rtWireError).Elem(), ErrorType.Elem())
			case fin.tt.Kind() == Union:
				return reflectConv(reflect.New(fin.rv.Type()).Elem(), fin.tt)
			case fin.tt.Kind() != Any:
				return convTarget{}, fmt.Errorf("internal error - cannot convert to Go type %v vdl type %v from %v", fin.rv.Type(), fin.tt, ttFrom)
			}
			// We're converting into any, and ttFrom is the type we're converting
			// *from*.  First handle the special-case *Type.
			if ttFrom.Kind() == TypeObject {
				return reflectConv(reflect.New(rtPtrToType).Elem(), TypeObjectType)
			}
			// Try to create a reflect.Type out of ttFrom, and if it exists, create a real
			// object to fill in.
			if rt := TypeToReflect(ttFrom); rt != nil {
				if rt.Kind() == reflect.Ptr && ttFrom.Kind() == Optional {
					rt = rt.Elem()
				}
				// Handle case where rt is a native type; return the wire type as the
				// fill target, and rely on finishConvert to perform the final step of
				// converting from the wire type to the native type.
				if ni := nativeInfoFromNative(rt); ni != nil {
					return reflectConv(reflect.New(ni.WireType).Elem(), ttFrom)
				}
				rv := reflect.New(rt).Elem()
				for rv.Kind() == reflect.Ptr {
					rv.Set(reflect.New(rv.Type().Elem()))
					rv = rv.Elem()
				}
				return reflectConv(rv, ttFrom)
			}
			// We don't have the type name in our registry, so create a concrete
			// *Value to fill in, based on ttFrom.
			if ttFrom.Kind() == Optional {
				return convTarget{tt: ttFrom, vv: ZeroValue(ttFrom.Elem())}, nil
			}
			return convTarget{tt: ttFrom, vv: ZeroValue(ttFrom)}, nil
		}
		// We're not converting into an interface, so we can fill into the fin
		// target directly.  Assign an appropriate zero value.
		fin.rv.Set(rvSettableZeroValue(fin.rv.Type(), ttFrom))
	} else {
		switch fin.vv.Kind() {
		case Any:
			if ttFrom.Kind() == Optional {
				return convTarget{tt: ttFrom, vv: ZeroValue(ttFrom.Elem())}, nil
			}
			return convTarget{tt: ttFrom, vv: ZeroValue(ttFrom)}, nil
		default:
			fin.vv.Assign(nil) // start with zero item
		}
	}
	return fin, nil
}

// finishConvert finishes converting a value, taking the fin and fill returned
// by startConvert.  This is necessary since interface/any values are assigned
// by value, and can't be filled in by reference.
func finishConvert(fin, fill convTarget) error {
	// The logic here mirrors the logic in createFillTarget.
	if fin.vv == nil {
		// Handle mirrored case in createFillTarget where fin.rv is the native error
		// type; fill.rv is WireError.
		if ni, err := nativeInfoForError(); err == nil && fin.rv.Type() == ni.NativeType {
			return ni.ToNative(fill.rv, fin.rv.Addr())
		}
		// Handle mirrored case in createFillTarget where fin.rv is a native type;
		// fill.rv is the wire type that has been filled in.
		if ni := nativeInfoFromNative(fin.rv.Type()); ni != nil {
			rvFill := fill.rv
			return ni.ToNative(rvFill, fin.rv.Addr())
		}
		if fin.rv.Kind() == reflect.Interface {
			// The fill value may be set to either rv or vv in startConvert above.
			var rvFill reflect.Value
			if fill.vv == nil {
				rvFill = fill.rv
				// Note: this if statement and the one in the else if block do not correctly
				// support the case of optional wiretypes.
				// TODO(bprosnitz) Fix this
				if fill.rv.Type() == rtWireError && fin.rv.Type() != rtWireError {
					// Handle case where fill.rv has type WireError; if error conversions
					// have been registered with the vdl package, we need to convert to
					// the standard error interface.
					if ni, err := nativeInfoForError(); err == nil {
						newNative := reflect.New(ni.NativeType)
						if err := ni.ToNative(fill.rv, newNative); err != nil {
							return err
						}
						rvFill = newNative.Elem()
					}
				} else if ni := nativeInfoFromWire(fill.rv.Type()); ni != nil && fin.rv.Type() != ni.WireType {
					// Handle case where fill.rv is a wire type with a native type; set
					// rvFill to a new native type and call ToNative to fill it in.
					newNative := reflect.New(ni.NativeType)
					if err := ni.ToNative(fill.rv, newNative); err != nil {
						return err
					}
					rvFill = newNative.Elem()
				}
				if fill.tt.Kind() == Optional {
					// Convert rvFill into a pointer if it should be optional.
					if rvFill.CanAddr() {
						rvFill = rvFill.Addr()
					} else {
						rvNew := reflect.New(rvFill.Type())
						rvNew.Elem().Set(rvFill)
						rvFill = rvNew
					}
				}
			} else {
				switch fill.tt.Kind() {
				case Optional:
					rvFill = reflect.ValueOf(OptionalValue(fill.vv))
				default:
					rvFill = reflect.ValueOf(fill.vv)
				}
			}
			if to, from := fin.rv.Type(), rvFill.Type(); !from.AssignableTo(to) {
				return fmt.Errorf("%v not assignable from %v", to, from)
			}
			fin.rv.Set(rvFill)
		}
	} else {
		switch fin.vv.Kind() {
		case Any:
			if fill.tt.Kind() == Optional {
				fin.vv.Assign(OptionalValue(fill.vv))
			} else {
				fin.vv.Assign(fill.vv)
			}
		}
	}
	return nil
}

// rvSettableZeroValue returns a settable zero value corresponding to rt / tt.
// This isn't trivial since VDL and Go define zero values slightly differently.
// In particular in VDL:
//    TypeObject: AnyType
//    Union:      zero value of the type at index 0
// These are translated into Go as follows, with their standard Go zero values:
//    *Type: nil
//    interface: nil
// Thus we must special-case values of these types.
//
// TODO(toddw): This logic is recursive and complicated because our convTarget
// methods don't take the convTarget as a pointer receiver, so we can't mutate
// the target as we decode.  When we split convTarget into separate valueTarget
// and reflectTarget objects, we should also take the target as a pointer
// receiver.  That'll simplify this logic.
func rvSettableZeroValue(rt reflect.Type, tt *Type) reflect.Value {
	rv := reflect.New(rt).Elem()
	// Easy fastpath; if the type doesn't contain inline typeobject or union, the
	// regular Go zero value is good enough.
	if !tt.ContainsKind(WalkInline, kkTypeObjectOrUnion...) {
		return rv
	}
	// Handle typeobject, which has the zero value of AnyType.
	if rtPtrToType.ConvertibleTo(rt) {
		return reflect.ValueOf(AnyType).Convert(rt)
	}
	// Handle composite types with inline subtypes.
	switch {
	case tt.Kind() == Union:
		if nativeInfoFromNative(rt) != nil {
			return rv
		}
		if rt.Kind() == reflect.Struct {
			// Union struct, which represents a single field.
			rv.Field(0).Set(rvSettableZeroValue(rt.Field(0).Type, tt.Field(0).Type))
			return rv
		}
		// Union interface, which represents one of the fields.  Initialize with the
		// zero value of the type at index 0.
		ri, _, err := deriveReflectInfo(rt)
		if err != nil {
			panic(fmt.Errorf("vdl: invalid union type rt: %v tt: %v err: %v", rt, tt, err))
		}
		rv.Set(rvSettableZeroValue(ri.UnionFields[0].RepType, tt.Field(0).Type))
		return rv
	case rt.Kind() == reflect.Array:
		for ix := 0; ix < rt.Len(); ix++ {
			rv.Index(ix).Set(rvSettableZeroValue(rt.Elem(), tt.Elem()))
		}
		return rv
	case rt.Kind() == reflect.Struct:
		for ix := 0; ix < rt.NumField(); ix++ {
			rtField := rt.Field(ix)
			ttField, index := tt.FieldByName(rtField.Name)
			if index < 0 {
				// Ignore fields that aren't described in tt; e.g. unexported fields.
				continue
			}
			rv.Field(ix).Set(rvSettableZeroValue(rtField.Type, ttField.Type))
		}
		return rv
	}
	panic(fmt.Errorf("vdl: rvSettableZeroValue unhandled rt: %v tt: %v", rt, tt))
}

func removeOptional(tt *Type) *Type {
	if tt.Kind() == Optional {
		tt = tt.Elem()
	}
	return tt
}

// makeDirectTarget returns the target representing the underlying value, if the
// underlying value supports direct target access.
func (c convTarget) makeDirectTarget() Target {
	if c.vv == nil {
		rv := c.rv
		if rv.Type().Implements(rtTargeter) {
			if rv.Kind() == reflect.Ptr && rv.IsNil() {
				rv.Set(reflect.New(rv.Type().Elem()))
			}
			return rv.Interface().(Targeter).MakeVDLTarget()
		}
		if rv.CanAddr() {
			rv = rv.Addr()
			if rv.Type().Implements(rtTargeter) {
				return rv.Interface().(Targeter).MakeVDLTarget()
			}
		}
	}
	return nil
}

func (c convTarget) FromNil(tt *Type) error {
	if !tt.CanBeNil() || !c.tt.CanBeNil() {
		return fmt.Errorf("invalid conversion from %v(nil) to %v", tt, c.tt)
	}
	if c.vv == nil {
		// The strategy is to create new pointers down to either a single pointer,
		// or the final interface, and set that to nil.  We create all the pointers
		// to be consistent with our behavior in the non-nil case, where we
		// similarly create all the pointers.  It also makes the tests simpler.
		rv := c.rv
		for rv.Kind() == reflect.Ptr {
			if vv := setZeroVDLValue(rv, tt); vv.IsValid() {
				return nil
			}
			if k := rv.Type().Elem().Kind(); k != reflect.Ptr && k != reflect.Interface {
				break
			}
			// Next elem is a pointer or interface, keep looping.
			if rv.IsNil() {
				rv.Set(reflect.New(rv.Type().Elem()))
			}
			rv = rv.Elem()
		}
		// Now rv.Type is either a single pointer or an interface.  If it is an
		// interface, check to see whether we can create a Go object from tt.
		rt := rv.Type()
		if rv.Kind() == reflect.Interface {
			if rtFromTT := TypeToReflect(tt); rtFromTT != nil {
				rt = rtFromTT
			}
		}
		// Set the zero value of the pointer or interface, which will give us nil of
		// the correct type.
		rv.Set(reflect.Zero(rt))
		return nil
	} else {
		vvNil := ZeroValue(tt)
		if to, from := c.vv.Type(), vvNil; !to.AssignableFrom(from) {
			return fmt.Errorf("%v not assignable from %v", to, from)
		}
		c.vv.Assign(vvNil)
		return nil
	}
}

// FromBool implements the Target interface method.
func (c convTarget) FromBool(src bool, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromBool(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromBool(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromUint implements the Target interface method.
func (c convTarget) FromUint(src uint64, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromUint(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromUint(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromInt implements the Target interface method.
func (c convTarget) FromInt(src int64, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromInt(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromInt(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromFloat implements the Target interface method.
func (c convTarget) FromFloat(src float64, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromFloat(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromFloat(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromBytes implements the Target interface method.
func (c convTarget) FromBytes(src []byte, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromBytes(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromBytes(src, tt); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromString implements the Target interface method.
func (c convTarget) FromString(src string, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromString(src, tt)
	}
	fin, fill, err := startConvert(c, tt)
	if err != nil {
		return err
	}
	if err := fill.fromString(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

// FromEnumLabel implements the Target interface method.
func (c convTarget) FromEnumLabel(src string, tt *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromEnumLabel(src, tt)
	}
	return c.FromString(src, tt)
}

// FromTypeObject implements the Target interface method.
func (c convTarget) FromTypeObject(src *Type) error {
	if target := c.makeDirectTarget(); target != nil {
		return target.FromTypeObject(src)
	}
	fin, fill, err := startConvert(c, TypeObjectType)
	if err != nil {
		return err
	}
	if err := fill.fromTypeObject(src); err != nil {
		return err
	}
	return finishConvert(fin, fill)
}

func (c convTarget) fromBool(src bool) error {
	if c.vv == nil {
		if c.rv.Kind() == reflect.Bool {
			c.rv.SetBool(src)
			return nil
		}
	} else {
		if c.vv.Kind() == Bool {
			c.vv.AssignBool(src)
			return nil
		}
	}
	return fmt.Errorf("invalid conversion from bool to %v", c.tt)
}

func (c convTarget) fromUint(src uint64) error {
	if c.vv == nil {
		switch kind := c.rv.Kind(); kind {
		case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:
			if !overflowUint(src, bitlenR(kind)) {
				c.rv.SetUint(src)
				return nil
			}
		case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
			if isrc, ok := convertUintToInt(src, bitlenR(kind)); ok {
				c.rv.SetInt(isrc)
				return nil
			}
		case reflect.Float32, reflect.Float64:
			if fsrc, ok := convertUintToFloat(src, bitlenR(kind)); ok {
				c.rv.SetFloat(fsrc)
				return nil
			}
		}
	} else {
		switch kind := c.vv.Kind(); kind {
		case Byte, Uint16, Uint32, Uint64:
			if !overflowUint(src, bitlenV(kind)) {
				c.vv.AssignUint(src)
				return nil
			}
		case Int8, Int16, Int32, Int64:
			if isrc, ok := convertUintToInt(src, bitlenV(kind)); ok {
				c.vv.AssignInt(isrc)
				return nil
			}
		case Float32, Float64:
			if fsrc, ok := convertUintToFloat(src, bitlenV(kind)); ok {
				c.vv.AssignFloat(fsrc)
				return nil
			}
		}
	}
	return fmt.Errorf("invalid conversion from uint(%d) to %v", src, c.tt)
}

func (c convTarget) fromInt(src int64) error {
	if c.vv == nil {
		switch kind := c.rv.Kind(); kind {
		case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:
			if usrc, ok := convertIntToUint(src, bitlenR(kind)); ok {
				c.rv.SetUint(usrc)
				return nil
			}
		case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
			if !overflowInt(src, bitlenR(kind)) {
				c.rv.SetInt(src)
				return nil
			}
		case reflect.Float32, reflect.Float64:
			if fsrc, ok := convertIntToFloat(src, bitlenR(kind)); ok {
				c.rv.SetFloat(fsrc)
				return nil
			}
		}
	} else {
		switch kind := c.vv.Kind(); kind {
		case Byte, Uint16, Uint32, Uint64:
			if usrc, ok := convertIntToUint(src, bitlenV(kind)); ok {
				c.vv.AssignUint(usrc)
				return nil
			}
		case Int8, Int16, Int32, Int64:
			if !overflowInt(src, bitlenV(kind)) {
				c.vv.AssignInt(src)
				return nil
			}
		case Float32, Float64:
			if fsrc, ok := convertIntToFloat(src, bitlenV(kind)); ok {
				c.vv.AssignFloat(fsrc)
				return nil
			}
		}
	}
	return fmt.Errorf("invalid conversion from int(%d) to %v", src, c.tt)
}

func (c convTarget) fromFloat(src float64) error {
	if c.vv == nil {
		switch kind := c.rv.Kind(); kind {
		case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:
			if usrc, ok := convertFloatToUint(src, bitlenR(kind)); ok {
				c.rv.SetUint(usrc)
				return nil
			}
		case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
			if isrc, ok := convertFloatToInt(src, bitlenR(kind)); ok {
				c.rv.SetInt(isrc)
				return nil
			}
		case reflect.Float32, reflect.Float64:
			c.rv.SetFloat(convertFloatToFloat(src, bitlenR(kind)))
			return nil
		}
	} else {
		switch kind := c.vv.Kind(); kind {
		case Byte, Uint16, Uint32, Uint64:
			if usrc, ok := convertFloatToUint(src, bitlenV(kind)); ok {
				c.vv.AssignUint(usrc)
				return nil
			}
		case Int8, Int16, Int32, Int64:
			if isrc, ok := convertFloatToInt(src, bitlenV(kind)); ok {
				c.vv.AssignInt(isrc)
				return nil
			}
		case Float32, Float64:
			c.vv.AssignFloat(convertFloatToFloat(src, bitlenV(kind)))
			return nil
		}
	}
	return fmt.Errorf("invalid conversion from float(%g) to %v", src, c.tt)
}

func (c convTarget) fromBytes(src []byte, tt *Type) error {
	if c.tt.IsBytes() && c.tt.Elem() == ByteType {
		return c.fromBytesToBytes(src)
	}
	elemType := tt.Elem()
	for i, b := range src {
		elem, err := c.startElem(i)
		if err != nil {
			return err
		}
		if err := elem.FromUint(uint64(b), elemType); err != nil {
			return err
		}
		if err := c.finishElem(elem); err != nil {
			return err
		}
	}
	return nil
}

func (c convTarget) fromBytesToBytes(src []byte) error {
	if c.vv == nil {
		switch {
		case c.rv.Kind() == reflect.Array:
			if c.rv.Type().Elem() == rtByte && c.rv.Len() == len(src) {
				reflect.Copy(c.rv, reflect.ValueOf(src))
				return nil
			}
		case c.rv.Kind() == reflect.Slice:
			if c.rv.Type().Elem() == rtByte {
				if len(src) == 0 {
					c.rv.SetBytes(nil)
				} else {
					cp := make([]byte, len(src))
					copy(cp, src)
					c.rv.SetBytes(cp)
				}
				return nil
			}
		}
	} else {
		switch c.vv.Kind() {
		case Array:
			if c.vv.Type().Len() == len(src) {
				c.vv.AssignBytes(src)
				return nil
			}
		case List:
			c.vv.AssignBytes(src)
			return nil
		}
	}
	return fmt.Errorf("invalid conversion from bytes to %v", c.tt)
}

// settable exists to avoid a call to reflect.Call() to invoke Set()
// which results in an allocation
type settable interface {
	Set(string) error
}

func (c convTarget) fromString(src string) error {
	if c.vv == nil {
		tt := removeOptional(c.tt)
		switch {
		case tt.Kind() == Enum:
			// Handle special-case enum first, by calling the Assign method.  Note
			// that TypeFromReflect has already validated the Assign method, so we
			// can call without error checking.
			if c.rv.CanAddr() {
				err := c.rv.Addr().Interface().(settable).Set(src)
				if err != nil {
					return err
				}
				return nil
			}
		case c.rv.Kind() == reflect.String:
			c.rv.SetString(src) // TODO(toddw): check utf8
			return nil
		}
	} else {
		switch c.vv.Kind() {
		case String:
			c.vv.AssignString(src) // TODO(toddw): check utf8
			return nil
		case Enum:
			if index := c.vv.Type().EnumIndex(src); index >= 0 {
				c.vv.AssignEnumIndex(index)
				return nil
			}
		}
	}
	return fmt.Errorf("invalid conversion from string or enum to %v", c.tt)
}

func (c convTarget) fromTypeObject(src *Type) error {
	if c.vv == nil {
		if rtPtrToType.ConvertibleTo(c.rv.Type()) {
			c.rv.Set(reflect.ValueOf(src).Convert(c.rv.Type()))
			return nil
		}
	} else {
		if c.vv.Kind() == TypeObject {
			c.vv.AssignTypeObject(src)
			return nil
		}
	}
	return fmt.Errorf("invalid conversion from typeobject to %v", c.tt)
}

// wrappedListTarget is used to implement FinishList for direct targets.
type wrappedListTarget struct {
	ListTarget
	Target Target
}

// StartList implements the Target interface method.
func (c convTarget) StartList(tt *Type, len int) (ListTarget, error) {
	if target := c.makeDirectTarget(); target != nil {
		listTarget, err := target.StartList(tt, len)
		if err != nil {
			return nil, err
		}
		return wrappedListTarget{listTarget, target}, nil
	}
	// TODO(bprosnitz) Re-think allocation strategy and possibly use len (currently unused).
	fin, fill, err := startConvert(c, tt)
	return compConvTarget{fin, fill}, err
}

// FinishList implements the Target interface method.
func (c convTarget) FinishList(x ListTarget) error {
	if wrapped, ok := x.(wrappedListTarget); ok {
		return wrapped.Target.FinishList(wrapped.ListTarget)
	}
	cc := x.(compConvTarget)
	return finishConvert(cc.fin, cc.fill)
}

// wrappedSetTarget is used to implement FinishSet for direct targets.
type wrappedSetTarget struct {
	SetTarget
	Target Target
}

// StartSet implements the Target interface method.
func (c convTarget) StartSet(tt *Type, len int) (SetTarget, error) {
	if target := c.makeDirectTarget(); target != nil {
		setTarget, err := target.StartSet(tt, len)
		if err != nil {
			return nil, err
		}
		return wrappedSetTarget{setTarget, target}, nil
	}
	fin, fill, err := startConvert(c, tt)
	return compConvTarget{fin, fill}, err
}

// FinishSet implements the Target interface method.
func (c convTarget) FinishSet(x SetTarget) error {
	if wrapped, ok := x.(wrappedSetTarget); ok {
		return wrapped.Target.FinishSet(wrapped.SetTarget)
	}
	cc := x.(compConvTarget)
	return finishConvert(cc.fin, cc.fill)
}

// wrappedMapTarget is used to implement FinishMap for direct targets.
type wrappedMapTarget struct {
	MapTarget
	Target Target
}

// StartMap implements the Target interface method.
func (c convTarget) StartMap(tt *Type, len int) (MapTarget, error) {
	if target := c.makeDirectTarget(); target != nil {
		mapTarget, err := target.StartMap(tt, len)
		if err != nil {
			return nil, err
		}
		return wrappedMapTarget{mapTarget, target}, nil
	}
	fin, fill, err := startConvert(c, tt)
	return compConvTarget{fin, fill}, err
}

// FinishMap implements the Target interface method.
func (c convTarget) FinishMap(x MapTarget) error {
	if wrapped, ok := x.(wrappedMapTarget); ok {
		return wrapped.Target.FinishMap(wrapped.MapTarget)
	}
	cc := x.(compConvTarget)
	return finishConvert(cc.fin, cc.fill)
}

// wrappedFieldsTarget is used to implement FinishFields for direct targets.
type wrappedFieldsTarget struct {
	FieldsTarget
	Target Target
}

// StartFields implements the Target interface method.
func (c convTarget) StartFields(tt *Type) (FieldsTarget, error) {
	if target := c.makeDirectTarget(); target != nil {
		fieldsTarget, err := target.StartFields(tt)
		if err != nil {
			return nil, err
		}
		return wrappedFieldsTarget{fieldsTarget, target}, nil
	}
	if c.vv == nil && c.rv.Kind() == reflect.Interface {
		// TODO(bprosnitz) Union targets are not used for explicit union field structs
		// It is possible to generate and use targets in this case. Consider
		// if it is useful.
		ri, _, err := deriveReflectInfo(c.rv.Type())
		if err != nil {
			return nil, err
		}
		if ri.UnionTargetFactory != nil {
			if ni := nativeInfoFromWire(c.rv.Type()); ni == nil {
				// Wire types are not supported by the generated union target.
				rv := c.rv.Addr()
				target, err := ri.UnionTargetFactory.VDLMakeUnionTarget(rv.Interface())
				if err != nil {
					return nil, err
				}
				fieldsTarget, err := target.StartFields(tt)
				if err != nil {
					return nil, err
				}
				return wrappedFieldsTarget{fieldsTarget, target}, nil
			}
		}
	}
	fin, fill, err := startConvert(c, tt)
	return compConvTarget{fin, fill}, err
}

// FinishFields implements the Target interface method.
func (c convTarget) FinishFields(x FieldsTarget) error {
	if wrapped, ok := x.(wrappedFieldsTarget); ok {
		return wrapped.Target.FinishFields(wrapped.FieldsTarget)
	}
	cc := x.(compConvTarget)
	return finishConvert(cc.fin, cc.fill)
}

// compConvTarget represents the state and logic for composite value conversion.
type compConvTarget struct {
	fin, fill convTarget // fields returned by startConvert.
}

// TODO(bprosnitz) Remove this -- it exists to get the reflect value for VOM and avoid package dependency cycles.
func (c compConvTarget) HackGetRv() reflect.Value {
	return c.fin.rv
}

// StartElem implements the ListTarget interface method.
func (cc compConvTarget) StartElem(index int) (elem Target, _ error) {
	return cc.fill.startElem(index)
}

// FinishElem implements the ListTarget interface method.
func (cc compConvTarget) FinishElem(elem Target) error {
	return cc.fill.finishElem(elem.(convTarget))
}

// StartKey implements the SetTarget and MapTarget interface method.
func (cc compConvTarget) StartKey() (key Target, _ error) {
	return cc.fill.startKey()
}

// FinishKeyStartField implements the MapTarget interface method.
func (cc compConvTarget) FinishKeyStartField(key Target) (field Target, _ error) {
	return cc.fill.finishKeyStartField(key.(convTarget))
}

// FinishField implements the MapTarget and FieldsTarget interface method.
func (cc compConvTarget) FinishField(key, field Target) error {
	return cc.fill.finishField(key.(convTarget), field.(convTarget))
}

// StartField implements the FieldsTarget interface method.
func (cc compConvTarget) StartField(name string) (key, field Target, _ error) {
	var err error
	if key, err = cc.StartKey(); err != nil {
		return nil, nil, err
	}
	if err = key.FromString(name, StringType); err != nil {
		return nil, nil, err
	}
	if field, err = cc.FinishKeyStartField(key); err != nil {
		return nil, nil, err
	}
	return
}

// ZeroField implements the FieldsTarget interface method.
func (cc compConvTarget) ZeroField(name string) error {
	key, field, err := cc.StartField(name)
	if err != nil {
		return err
	}
	tt := cc.fill.tt
	if tt.Kind() == Optional {
		tt = tt.Elem()
	}
	var ztt *Type
	switch tt.Kind() {
	case Struct, Union:
		fld, index := tt.FieldByName(name)
		if index < 0 {
			return ErrFieldNoExist
		}
		ztt = fld.Type
	case Map:
		ztt = tt.Elem()
	case Set:
		ztt = TypeOf(struct{}{})
	}
	if err := FromValue(field, ZeroValue(ztt)); err != nil {
		return err
	}
	return cc.FinishField(key, field)
}

// FinishKey implements the SetTarget interface method.
func (cc compConvTarget) FinishKey(key Target) error {
	field, err := cc.FinishKeyStartField(key)
	if err != nil {
		return err
	}
	return cc.FinishField(key, field)
}

func (c convTarget) startElem(index int) (convTarget, error) {
	if c.vv == nil {
		tt := removeOptional(c.tt)
		switch c.rv.Kind() {
		case reflect.Array:
			if index >= c.rv.Len() {
				return convTarget{}, errArrayIndex
			}
			return reflectConv(c.rv.Index(index), tt.Elem())
		case reflect.Slice:
			newlen := index + 1
			if newlen < c.rv.Len() {
				newlen = c.rv.Len()
			}
			if newlen > c.rv.Cap() {
				rvNew := reflect.MakeSlice(c.rv.Type(), newlen, newlen*2)
				reflect.Copy(rvNew, c.rv)
				c.rv.Set(rvNew)
			} else {
				c.rv.SetLen(newlen)
			}
			return reflectConv(c.rv.Index(index), tt.Elem())
		}
	} else {
		switch c.vv.Kind() {
		case Array:
			if index >= c.vv.Len() {
				return convTarget{}, errArrayIndex
			}
			return valueConv(c.vv.Index(index)), nil
		case List:
			newlen := index + 1
			if newlen < c.vv.Len() {
				newlen = c.vv.Len()
			}
			c.vv.AssignLen(newlen)
			return valueConv(c.vv.Index(index)), nil
		}
	}
	return convTarget{}, fmt.Errorf("type %v doesn't support StartElem", c.tt)
}

func (c convTarget) finishElem(elem convTarget) error {
	if c.vv == nil {
		switch c.rv.Kind() {
		case reflect.Array, reflect.Slice:
			return nil
		}
	} else {
		switch c.vv.Kind() {
		case Array, List:
			return nil
		}
	}
	return fmt.Errorf("type %v doesn't support FinishElem", c.tt)
}

func (c convTarget) startKey() (convTarget, error) {
	if c.vv == nil {
		tt := removeOptional(c.tt)
		switch c.rv.Kind() {
		case reflect.Map:
			return reflectConv(rvSettableZeroValue(c.rv.Type().Key(), tt.Key()), tt.Key())
		case reflect.Struct, reflect.Interface:
			// The key for struct and union is the field name, which is a string.
			return reflectConv(reflect.New(rtString).Elem(), StringType)
		}
	} else {
		switch c.vv.Kind() {
		case Set, Map:
			return valueConv(ZeroValue(c.vv.Type().Key())), nil
		case Struct, Union:
			// The key for struct and union is the field name, which is a string.
			return valueConv(ZeroValue(StringType)), nil
		}
	}
	return convTarget{}, fmt.Errorf("type %v doesn't support StartKey", c.tt)
}

func (c convTarget) finishKeyStartField(key convTarget) (convTarget, error) {
	// There are various special-cases regarding bool values below.  These are to
	// handle different representations of sets; the following types are all
	// convertible to each other:
	//   set[string], map[string]bool, struct{X, Y, Z bool}
	//
	// To deal with these cases in a uniform manner, we return a bool field for
	// set[string], and initialize bool fields to true.
	if c.vv == nil {
		tt := removeOptional(c.tt)
		switch c.rv.Kind() {
		case reflect.Map:
			var ttField *Type
			var rvField reflect.Value
			switch rtField := c.rv.Type().Elem(); {
			case tt.Kind() == Set:
				// The map actually represents a set
				ttField = BoolType
				rvField = reflect.New(rtBool).Elem()
				rvField.SetBool(true)
			case rtField.Kind() == reflect.Bool:
				ttField = tt.Elem()
				rvField = reflect.New(rtField).Elem()
				rvField.SetBool(true)
			default:
				// TODO(toddw): This doesn't work correctly for map[_]any.
				ttField = tt.Elem()
				rvField = rvSettableZeroValue(rtField, ttField)
			}
			return reflectConv(rvField, ttField)
		case reflect.Struct:
			fieldName := key.rv.String()
			if tt.Kind() == Union {
				// Special-case: the fill target is a union concrete field struct.  This
				// means that we should only return a field if the field name matches.
				existingName := c.rv.Interface().(namer).Name()
				if existingName != fieldName {
					return convTarget{}, ErrFieldNoExist
				}
				ttField, _ := tt.FieldByName(fieldName)
				return reflectConv(c.rv.FieldByName("Value"), ttField.Type)
			}
			// TODO(toddw): How should we handle anonymous (aka embedded) fields?
			// Note that unexported embedded fields may themselves have exported
			// fields.  See https://github.com/golang/go/issues/12367
			rvField := c.rv.FieldByName(fieldName)
			ttField, index := tt.FieldByName(fieldName)
			if !rvField.IsValid() || index < 0 {
				// TODO(toddw): Add a way to track extra and missing fields.
				return convTarget{}, ErrFieldNoExist
			}
			if rvField.Kind() == reflect.Bool {
				rvField.SetBool(true)
			}
			return reflectConv(rvField, ttField.Type)
		case reflect.Interface:
			if tt.Kind() == Union {
				ri, _, err := deriveReflectInfo(c.rv.Type())
				if err != nil {
					return convTarget{}, err
				}
				ttField, index := tt.FieldByName(key.rv.String())
				fld, found := ri.UnionFields[index].RepType.FieldByName("Value")
				if !found {
					return convTarget{}, fmt.Errorf("concrete union type %q missing required Value field", ri.UnionFields[index].RepType)
				}
				rvValue := reflect.New(fld.Type).Elem()
				return reflectConv(rvValue, ttField.Type)
			}
		}
	} else {
		switch c.vv.Kind() {
		case Set:
			return valueConv(BoolValue(nil, true)), nil
		case Map:
			vvField := ZeroValue(c.vv.Type().Elem())
			if vvField.Kind() == Bool {
				vvField.AssignBool(true)
			}
			return valueConv(vvField), nil
		case Struct:
			_, index := c.vv.Type().FieldByName(key.vv.RawString())
			if index < 0 {
				// TODO(toddw): Add a way to track extra and missing fields.
				return convTarget{}, ErrFieldNoExist
			}
			vvField := c.vv.StructField(index)
			if vvField.Kind() == Bool {
				vvField.AssignBool(true)
			}
			return valueConv(vvField), nil
		case Union:
			f, index := c.vv.Type().FieldByName(key.vv.RawString())
			if index < 0 {
				return convTarget{}, ErrFieldNoExist
			}
			vvField := ZeroValue(f.Type)
			return valueConv(vvField), nil
		}
	}
	return convTarget{}, fmt.Errorf("type %v doesn't support FinishKeyStartField", c.tt)
}

func (c convTarget) finishField(key, field convTarget) error {
	// The special-case handling of bool fields matches the special-cases in
	// FinishKeyStartField.
	if c.vv == nil {
		tt := removeOptional(c.tt)
		switch c.rv.Kind() {
		case reflect.Map:
			rvField := field.rv
			if tt.Kind() == Set {
				// The map actually represents a set
				if !field.rv.Bool() {
					return fmt.Errorf("%v can only be converted from true fields", tt)
				}
				rvField = reflect.Zero(c.rv.Type().Elem())
			}
			if c.rv.IsNil() {
				c.rv.Set(reflect.MakeMap(c.rv.Type()))
			}
			c.rv.SetMapIndex(key.rv, rvField)
			return nil
		case reflect.Struct:
			return nil
		case reflect.Interface:
			if tt.Kind() == Union {
				ri, _, err := deriveReflectInfo(c.rv.Type())
				if err != nil {
					return err
				}
				_, index := c.tt.FieldByName(key.rv.String())
				rvField := reflect.New(ri.UnionFields[index].RepType).Elem()
				rvField.FieldByName("Value").Set(field.rv)
				c.rv.Set(rvField)
				return nil
			}
		}
	} else {
		switch c.vv.Kind() {
		case Set:
			if !field.vv.Bool() {
				return fmt.Errorf("%v can only be converted from true fields", c.vv.Type())
			}
			c.vv.AssignSetKey(key.vv)
			return nil
		case Map:
			c.vv.AssignMapIndex(key.vv, field.vv)
			return nil
		case Struct:
			return nil
		case Union:
			_, index := c.vv.Type().FieldByName(key.vv.RawString())
			c.vv.AssignField(index, field.vv)
			return nil
		}
	}
	return fmt.Errorf("type %v doesn't support FinishField", c.tt)
}

license_type: permissive

branch_name: refs/heads/master

extension: go


text:
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

type Page struct {
	Data         interface{}
	templatePath string
}

func (p Page) formatJsonData() interface{} {
	switch p.Data.(type) {
	case Idea:
		return map[string]string{"Idea": fmt.Sprintf("%s", p.Data.(Idea))}
	default:
		return p.Data
	}
}

func (p Page) renderJson(w http.ResponseWriter) {
	data := p.formatJsonData()
	json.NewEncoder(w).Encode(data)
}

func (p Page) renderHtml(w http.ResponseWriter) {
	err := bootstrap.ExecuteTemplate(w, p.templatePath, p)
	if err != nil {
		fmt.Println(err)
	}
}

license: MIT

repository: madsroskar/IdeaGenerator

repo_name: madsroskar/IdeaGenerator

gha_license_id: MIT

gha_language: Go


text:
package geo

import (
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
)

var mp = NewMultiPoint(p, p2)

func TestMultiPoint_GeometryType(t *testing.T) {
	assert.Equal(t, "MultiPoint", mp.GeometryType(), "MultiPoint GeometryType failed")
}

func TestMultiPoint_SRID(t *testing.T) {
	assert.Equal(t, 4326, mp.SRID(), "MultiPoint SRID failed")
}

func TestMultiPoint_AsText(t *testing.T) {
	asText := fmt.Sprintf("MULTIPOINT (%f %f %f, %f %f %f)", p.Lat(), p.Lon(), p.Alt(), p2.Lat(), p2.Lon(), p2.Alt())
	assert.Equal(t, asText, mp.AsText(), "MultiPoint AsText failed")
}

func TestMultiPoint_IsEmpty(t *testing.T) {
	assert.False(t, mp.IsEmpty(), "MultiPoint IsEmpty failed")
}

func TestMultiPoint_Is3D(t *testing.T) {
	assert.True(t, mp.Is3D(), "MultiPoint Is3D failed")
}

func TestMultiPoint_NumGeometries(t *testing.T) {
	assert.Equal(t, 2, len(mp), "MultiPoint NumGeometries failed")
}

func TestMultiPoint_GeometryN(t *testing.T) {
	assert.Equal(t, p, mp.GeometryN(0), "MultiPoint GeometryN failed")
}


text:
LICENSE = "GPL"
PV = "0.0+cvs${SRCDATE}"
SECTION = "x11/libs"
PRIORITY = "optional"
DEPENDS = "x11 recordext xext"
DESCRIPTION = "X Test Extension: client side library"
PR = "r3"

SRC_URI = "cvs://anoncvs:anoncvs@pdx.freedesktop.org/cvs/xlibs;module=Xtst"
S = "${WORKDIR}/Xtst"

inherit autotools pkgconfig

do_stage() {
	autotools_stage_all
}

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn

extension: bb


text:
// Copyright (c) quickfixengine.org  All rights reserved.
//
// This file may be distributed under the terms of the quickfixengine.org
// license as defined by quickfixengine.org and appearing in the file
// LICENSE included in the packaging of this file.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE.
//
// See http://www.quickfixengine.org/LICENSE for licensing information.
//
// Contact ask@quickfixengine.org if any conditions of this licensing
// are not clear to you.

package quickfix

import (
	"testing"

	"github.com/stretchr/testify/suite"
)

type NotSessionTimeTestSuite struct {
	SessionSuiteRig
}

func TestNotSessionTime(t *testing.T) {
	suite.Run(t, new(NotSessionTimeTestSuite))
}

func (s *NotSessionTimeTestSuite) SetupTest() {
	s.Init()
	s.session.State = notSessionTime{}
}

func (s *NotSessionTimeTestSuite) TestPreliminary() {
	s.False(s.session.IsLoggedOn())
	s.False(s.session.IsConnected())
	s.False(s.session.IsSessionTime())
}

func (s *NotSessionTimeTestSuite) TestDisconnected() {
	s.session.Disconnected(s.session)
	s.State(notSessionTime{})
}

func (s *NotSessionTimeTestSuite) TestStop() {
	s.session.Stop(s.session)
	s.Stopped()
}

repository: artex-io/quickfix-go

repo_name: artex-io/quickfix-go

gha_license_id: NOASSERTION


text:
@inproceedings{gungor2018recurrent,
 author = {Güngör, Onur and Üsküdarlı, Suzan and Güngör, Tunga},
 booktitle = {2018 26th Signal Processing and Communications Applications Conference (SIU)},
 organization = {IEEE},
 pages = {1--4},
 title = {Recurrent neural networks for Turkish named entity recognition},
 year = {2018}
}

branch_name: refs/heads/main

gha_language: Jupyter Notebook

extension: bib


text:
@phdthesis{osborne_bayesian_2010,
	title = {Bayesian {Gaussian} {Processes} for {Sequential} {Prediction}, {Optimisation} and {Quadrature}},
	abstract = {We develop a family of Bayesian algorithms built around Gaussian processes for various problems posed by sensor networks. We firstly introduce an iterative Gaussian process for multi-sensor inference problems, and show how our algorithm is able to cope with data that may be noisy, missing, delayed and/or correlated. Our algorithm can also effectively manage data that features changepoints, such as sensor faults. Extensions to our algorithm allow us to tackle some of the decision problems faced in sensor networks, including observation scheduling. Along these lines, we also propose a general method of global optimisation, Gaussian process global optimisation (GPGO), and demonstrate how it may be used for sensor placement.

Our algorithms operate within a complete Bayesian probabilistic framework. As such, we show how the hyperparameters of our system can be marginalised by use of Bayesian quadrature, a principled method of approximate integration. Similar tech niques also allow us to produce full posterior distributions for any hyperparameters of interest, such as the location of changepoints. We frame the selection of the positions of the hyperparameter samples required by Bayesian quadrature as a decision prob lem, with the aim of minimising the uncertainty we possess about the values of the integrals we are approximating. Taking this approach, we have developed sampling for Bayesian quadrature (SBQ), a principled competitor to Monte Carlo methods.

We conclude by testing our proposals on real weather sensor networks. We further benchmark GPGO on a wide range of canonical test problems, over which it achieves a significant improvement on its competitors. Finally, the efficacy of SBQ is demonstrated in the context of both prediction and optimisation.},
	school = {PhD thesis, University of Oxford},
	author = {Osborne, Michael},
	year = {2010},
	file = {2160/full_thesis.pdf}
}

repository: mosb/robots-www

repo_name: mosb/robots-www

gha_language: TeX


text:
SUMMARY = "Read, Write and Edit Meta Information!"
HOMEPAGE = "http://www.sno.phy.queensu.ca/~phil/exiftool/"

LICENSE = "GPLv1"
LIC_FILES_CHKSUM = "file://perl-Image-ExifTool.spec;beginline=5;endline=5;md5=ffefffc98dab025cb49489bd4d88ee10"

SRC_URI = "http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-${PV}.tar.gz"
SRC_URI[md5sum] = "8c8a42d71a2cf2d5c151ce74da98ab8f"
SRC_URI[sha256sum] = "f959f3436fb4e42f7561ad56771454670f95110b0bcd099c1bc72eefb4de23e1"

S = "${WORKDIR}/Image-ExifTool-${PV}"

inherit cpan

repository: koenkooi/meta-photography

repo_name: koenkooi/meta-photography

gha_language: C


text:
require nandlogical_${PV}.bb

inherit klibc

do_compile() {
        ${CC} ${CFLAGS} ${LDFLAGS} -static -I${STAGING_INCDIR} nandlogical.c -o nandlogical
}

FILESPATHPKG =. "nandlogical:"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
# - Try to find SDL
# You can set SDL_ROOT to specify a certain directory to look in first.
# Once done this will define
#  SDL_FOUND - System has SDL
#  SDL_INCLUDE_DIRS - The SDL include directories
#  SDL_LIBRARIES - The libraries needed to use SDL
# It also adds an imported target named `3ds::SDL`, Linking against it is
# equivalent to:
# target_link_libraries(mytarget ${SDL_LIBRARY})
# target_include_directories(mytarget PRIVATE ${SDL_INCLUDE_DIRS})

if (NOT 3DS)
    message(FATAL_ERROR "This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.")
endif ()

include(LibFindMacros)
include(try_add_imported_target)

libfind_package(SDL CITRO3D)
libfind_package(SDL PNG)
libfind_package(SDL JPEG)
libfind_package(SDL Freetype)

set(_SDL_SEARCHES)

# Search SDL_ROOT first if it is set.
if (SDL_ROOT)
    set(_SDL_SEARCH_ROOT
            PATHS ${SDL_ROOT}
            NO_DEFAULT_PATH
            NO_CMAKE_FIND_ROOT_PATH)
    list(APPEND _SDL_SEARCHES _SDL_SEARCH_ROOT)
endif ()

# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc.
set(_SDL_SEARCH_NORMAL
        PATHS /
        NO_DEFAULT_PATH
        ONLY_CMAKE_FIND_ROOT_PATH)
list(APPEND _SDL_SEARCHES _SDL_SEARCH_NORMAL)

# find every sdl library
foreach (search ${_SDL_SEARCHES})
    find_path(SDL_INCLUDE_DIR NAMES SDL/SDL.h
            ${${search}}
            PATH_SUFFIXES include/)
    find_library(SDL_LIBRARY NAMES libSDL.a libSDLmain.a ${${search}} PATH_SUFFIXES lib)
    find_library(SDL_IMG_LIBRARY NAMES libSDL_image.a ${${search}} PATH_SUFFIXES lib)
    find_library(SDL_GFX_LIBRARY NAMES libSDL_gfx.a ${${search}} PATH_SUFFIXES lib)
    find_library(SDL_TTF_LIBRARY NAMES libSDL_ttf.a ${${search}} PATH_SUFFIXES lib)
    find_library(SDL_MIXER_LIBRARY NAMES libSDL_mixer.a ${${search}} PATH_SUFFIXES lib)
endforeach ()

# setup each lib to be imported
set(SDL_PROCESS_INCLUDES SDL_INCLUDE_DIR)
set(SDL_IMG_PROCESS_INCLUDES SDL_INCLUDE_DIR)
set(SDL_GFX_PROCESS_INCLUDES SDL_INCLUDE_DIR)
set(SDL_TTF_PROCESS_INCLUDES SDL_INCLUDE_DIR)
set(SDL_MIXER_PROCESS_INCLUDES SDL_INCLUDE_DIR)

set(SDL_PROCESS_LIBS SDL_LIBRARY)
set(SDL_IMG_PROCESS_LIBS SDL_IMG_LIBRARY)
set(SDL_GFX_PROCESS_LIBS SDL_GFX_LIBRARY)
set(SDL_TTF_PROCESS_LIBS SDL_TTF_LIBRARY)
set(SDL_MIXER_PROCESS_LIBS SDL_MIXER_LIBRARY)

libfind_process(SDL)
libfind_process(SDL_IMG)
libfind_process(SDL_TTF)
libfind_process(SDL_MIXER)

try_add_imported_target(SDL)
try_add_imported_target(SDL_IMG)
try_add_imported_target(SDL_TTF)
try_add_imported_target(SDL_MIXER)

extension: cmake


text:
package txtproc

import (
	"context"

	"github.com/opentracing/opentracing-go"
)

// BadWordsData is a struct to map what data to be compared, replaced to what
// and other information you want to carry for example the primary key, etc.
type ReplacerData struct {
	StringToCompare   string
	StringReplacement string
}

// ReplacerDataSeeder is a collection of string (bad words) that need to be replaced.
// This is like an `map[string]string` where string to compare and string replacement can be fetch using `Get` method.
// By defining the interface (rather than using Go map type), we can implement using the best approach we can imagine.
// For example, by always querying into Redis rather than
// This can be implemented using database, in-memory, or anything.
// By having this interface, we can just load/query what we need in that time, not pre-loading all data from database
// to Go map (but you can still do it).
type ReplacerDataSeeder interface {
	// Get data from database (in-memory, or SQL or noSql) by sequence.
	// This function will be called `Total()/PerBatch()` times,
	// and the `batch` will be contain value range between 1 - `Total()/PerBatch()`
	// You can treat `batch` as the offset limit, for example:
	// Total = 100, PerBatch = 10, it will iterate between 1 to (100/10 = 10).
	// More example, when Total = 100, PerBatch = 100, it will iterate once only.
	// It your responsibility to tune how many data fetched per batch, as it will only matter with query speed.
	// You can query SQL something like this:
	// offset = (batch - 1) * PerBatch()
	// SELECT * FROM bad_words LIMIT :PerBatch() OFFSET :offset ORDER BY id DESC;
	// Function will return `strToCompare` as the compared string, and `replacement` as the replacement string.
	// It is up to you whether you want to return partial replacement like 'f*ck' or full replacement like '****'
	Get(ctx context.Context, batch int64) (dataReplacer []ReplacerData, err error)

	// Total returns the number of total data that need to be checked in collection of bad words.
	Total(ctx context.Context) int64

	// PerBatch will return how many data retrieved per `Get`.
	PerBatch(ctx context.Context) int64
}

// replacerDataDefault will be used when no `ReplacerDataSeeder` passed in `WordReplacerConfig`
type replacerDataDefault struct{}

// Get will not return any string
func (r replacerDataDefault) Get(ctx context.Context, _ int64) (dataReplacer []ReplacerData, err error) {
	span, ctx := opentracing.StartSpanFromContext(ctx, "replacerDataDefault.Get")
	defer func() {
		ctx.Done()
		span.Finish()
	}()

	dataReplacer = []ReplacerData{}
	return
}

// Total will always return 1 on default, so it will not do any iteration
func (r replacerDataDefault) Total(ctx context.Context) int64 {
	span, ctx := opentracing.StartSpanFromContext(ctx, "replacerDataDefault.Total")
	defer func() {
		ctx.Done()
		span.Finish()
	}()

	return 0
}

// PerBatch return 1 since Total only return 1. So the iteration will be 0 (total/per batch = 0/1 = 0).
func (r replacerDataDefault) PerBatch(ctx context.Context) int64 {
	span, ctx := opentracing.StartSpanFromContext(ctx, "replacerDataDefault.PerBatch")
	defer func() {
		ctx.Done()
		span.Finish()
	}()

	return 1
}

// newReplacerDataDefault default value for replace the data
func newReplacerDataDefault() ReplacerDataSeeder {
	return &replacerDataDefault{}
}

repository: yusufsyaifudin/txtproc

repo_name: yusufsyaifudin/txtproc


text:
SECTION = "devel/chicken"
DESCRIPTION = "Modular Arithmetic on Finite Fields"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://modular-arithmetic.meta;md5=8a309ca2cce7edd505254fe4b3955d3b"
DEPENDS_append_class-cross = " chicken-egg-numbers-cross chicken-egg-matchable-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-numbers-crosssdk chicken-egg-matchable-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-numbers nativesdk-chicken-egg-matchable chicken-egg-numbers-crosssdk chicken-egg-matchable-crosssdk"
DEPENDS = " chicken-egg-numbers chicken-egg-matchable chicken-egg-numbers-cross chicken-egg-matchable-cross"
RDEPENDS_${PN} = " chicken-egg-numbers chicken-egg-matchable"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/modular-arithmetic/modular-arithmetic-${PV}.tar.gz"

SRC_URI[md5sum] = "c718f932a17e070d0900480526fcd0e6"
SRC_URI[sha256sum] = "ec5fca12cf36bd800595a1956f8d6ca421b9395da3cf15e8805d14251dd749b4"

S = "${WORKDIR}/modular-arithmetic-${PV}"

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
SUMMARY = "GCNano kernel drivers"
LICENSE = "GPL-1.0-only & MIT"
# Note get md5sum with: $ head -n 53 Makefile | md5sum
LIC_FILES_CHKSUM = "file://Makefile;endline=53;md5=bdbf89578a2a891bdb74233b3587d75c"

SRC_URI = "git://github.com/STMicroelectronics/gcnano-binaries;protocol=https;branch=gcnano-${GCNANO_VERSION}-binaries"
SRCREV = "5d02efd5cb4cfa85307633891f3cf87550a8bc1d"

GCNANO_VERSION = "6.4.13"
GCNANO_SUBVERSION = "stm32mp"
GCNANO_RELEASE = "r1"

PV = "${GCNANO_VERSION}-${GCNANO_SUBVERSION}-${GCNANO_RELEASE}"

S = "${WORKDIR}/git/${BPN}"

include gcnano-driver-stm32mp.inc

# ---------------------------------
# Configure archiver use
# ---------------------------------
include ${@oe.utils.ifelse(d.getVar('ST_ARCHIVER_ENABLE') == '1', 'gcnano-driver-stm32mp-archiver.inc','')}

branch_name: refs/heads/mickledore


text:
inherit esw_examples features_check

REQUIRED_DISTRO_FEATURES = "ipipsu"

ESW_COMPONENT_SRC = "/XilinxProcessorIPLib/drivers/ipipsu/examples/"

repository: fullstackfpga/meta-xilinx

repo_name: fullstackfpga/meta-xilinx


text:
package gorgonzola

import (
	"net"
)

// Holds the local address
var localAddress string

func init() {
	localAddress = guessLocalAddress()
}

// Guess the local IP
func guessLocalAddress() string {
	addrs, err := net.InterfaceAddrs()
	if err != nil {
		panic("No network-interfaces found!")
	}

	for _, a := range addrs {
		if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
			if ipnet.IP.To4() != nil {
				return ipnet.IP.String()
			}
		}
	}

	// no IP found, this cannot work!
	panic("No IP found!")
}

// Map the localhost (IPv4, IPv6) address to the exposed IP
func remap(address string) string {
	if address == "127.0.0.1" || address == "::1" {
		return localAddress
	}
	return address
}

// Clear the port information from ip:port
func stripAddress(remoteAddress string) (string, error) {
	ip, _, err := net.SplitHostPort(remoteAddress)
	return remap(ip), err
}


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.26.0
// 	protoc        v3.17.3
// source: service.proto

package pb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type BaseResponse struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

func (x *BaseResponse) Reset() {
	*x = BaseResponse{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *BaseResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*BaseResponse) ProtoMessage() {}

func (x *BaseResponse) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use BaseResponse.ProtoReflect.Descriptor instead.
func (*BaseResponse) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{0}
}

func (x *BaseResponse) GetSuccess() bool {
	if x != nil {
		return x.Success
	}
	return false
}

type ChunkInfo struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Index    uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Size     uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	Offset   uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	CheckSum string `protobuf:"bytes,4,opt,name=checkSum,proto3" json:"checkSum,omitempty"`
	Path     string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	FolderId uint64 `protobuf:"varint,6,opt,name=folderId,proto3" json:"folderId,omitempty"`
}

func (x *ChunkInfo) Reset() {
	*x = ChunkInfo{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *ChunkInfo) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ChunkInfo) ProtoMessage() {}

func (x *ChunkInfo) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ChunkInfo.ProtoReflect.Descriptor instead.
func (*ChunkInfo) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{1}
}

func (x *ChunkInfo) GetIndex() uint64 {
	if x != nil {
		return x.Index
	}
	return 0
}

func (x *ChunkInfo) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

func (x *ChunkInfo) GetOffset() uint64 {
	if x != nil {
		return x.Offset
	}
	return 0
}

func (x *ChunkInfo) GetCheckSum() string {
	if x != nil {
		return x.CheckSum
	}
	return ""
}

func (x *ChunkInfo) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

func (x *ChunkInfo) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

type CheckResult struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

func (x *CheckResult) Reset() {
	*x = CheckResult{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[2]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *CheckResult) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CheckResult) ProtoMessage() {}

func (x *CheckResult) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[2]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CheckResult.ProtoReflect.Descriptor instead.
func (*CheckResult) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{2}
}

func (x *CheckResult) GetSuccess() bool {
	if x != nil {
		return x.Success
	}
	return false
}

type Chunk struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Index     uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Size      uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	Offset    uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	Path      string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
	FolderId  uint64 `protobuf:"varint,5,opt,name=folderId,proto3" json:"folderId,omitempty"`
	LastChunk bool   `protobuf:"varint,6,opt,name=LastChunk,proto3" json:"LastChunk,omitempty"`
	Data      []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
}

func (x *Chunk) Reset() {
	*x = Chunk{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[3]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *Chunk) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Chunk) ProtoMessage() {}

func (x *Chunk) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[3]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Chunk.ProtoReflect.Descriptor instead.
func (*Chunk) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{3}
}

func (x *Chunk) GetIndex() uint64 {
	if x != nil {
		return x.Index
	}
	return 0
}

func (x *Chunk) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

func (x *Chunk) GetOffset() uint64 {
	if x != nil {
		return x.Offset
	}
	return 0
}

func (x *Chunk) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

func (x *Chunk) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

func (x *Chunk) GetLastChunk() bool {
	if x != nil {
		return x.LastChunk
	}
	return false
}

func (x *Chunk) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

type SyncChunkResult struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

func (x *SyncChunkResult) Reset() {
	*x = SyncChunkResult{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[4]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *SyncChunkResult) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SyncChunkResult) ProtoMessage() {}

func (x *SyncChunkResult) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[4]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SyncChunkResult.ProtoReflect.Descriptor instead.
func (*SyncChunkResult) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{4}
}

func (x *SyncChunkResult) GetSuccess() bool {
	if x != nil {
		return x.Success
	}
	return false
}

type RemoteFiles struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Path     string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	FolderId uint64 `protobuf:"varint,2,opt,name=folderId,proto3" json:"folderId,omitempty"`
	Size     uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
}

func (x *RemoteFiles) Reset() {
	*x = RemoteFiles{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[5]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RemoteFiles) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RemoteFiles) ProtoMessage() {}

func (x *RemoteFiles) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[5]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RemoteFiles.ProtoReflect.Descriptor instead.
func (*RemoteFiles) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{5}
}

func (x *RemoteFiles) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

func (x *RemoteFiles) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

func (x *RemoteFiles) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

type RemoteFilesResult struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Files []*RemoteFiles `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
}

func (x *RemoteFilesResult) Reset() {
	*x = RemoteFilesResult{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[6]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RemoteFilesResult) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RemoteFilesResult) ProtoMessage() {}

func (x *RemoteFilesResult) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[6]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RemoteFilesResult.ProtoReflect.Descriptor instead.
func (*RemoteFilesResult) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{6}
}

func (x *RemoteFilesResult) GetFiles() []*RemoteFiles {
	if x != nil {
		return x.Files
	}
	return nil
}

type RemoteFilesMessage struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	FolderId uint64 `protobuf:"varint,1,opt,name=folderId,proto3" json:"folderId,omitempty"`
}

func (x *RemoteFilesMessage) Reset() {
	*x = RemoteFilesMessage{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[7]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RemoteFilesMessage) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RemoteFilesMessage) ProtoMessage() {}

func (x *RemoteFilesMessage) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[7]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RemoteFilesMessage.ProtoReflect.Descriptor instead.
func (*RemoteFilesMessage) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{7}
}

func (x *RemoteFilesMessage) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

type GetRemoteChunkInfoMessage struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Path     string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	FolderId uint64 `protobuf:"varint,2,opt,name=folderId,proto3" json:"folderId,omitempty"`
	Size     uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	Offset   uint64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
}

func (x *GetRemoteChunkInfoMessage) Reset() {
	*x = GetRemoteChunkInfoMessage{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[8]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *GetRemoteChunkInfoMessage) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*GetRemoteChunkInfoMessage) ProtoMessage() {}

func (x *GetRemoteChunkInfoMessage) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[8]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use GetRemoteChunkInfoMessage.ProtoReflect.Descriptor instead.
func (*GetRemoteChunkInfoMessage) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{8}
}

func (x *GetRemoteChunkInfoMessage) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

func (x *GetRemoteChunkInfoMessage) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

func (x *GetRemoteChunkInfoMessage) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

func (x *GetRemoteChunkInfoMessage) GetOffset() uint64 {
	if x != nil {
		return x.Offset
	}
	return 0
}

type RemoteChunkInfo struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	LastChunk bool   `protobuf:"varint,1,opt,name=LastChunk,proto3" json:"LastChunk,omitempty"`
	Checksum  string `protobuf:"bytes,2,opt,name=Checksum,proto3" json:"Checksum,omitempty"`
}

func (x *RemoteChunkInfo) Reset() {
	*x = RemoteChunkInfo{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[9]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RemoteChunkInfo) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RemoteChunkInfo) ProtoMessage() {}

func (x *RemoteChunkInfo) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[9]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RemoteChunkInfo.ProtoReflect.Descriptor instead.
func (*RemoteChunkInfo) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{9}
}

func (x *RemoteChunkInfo) GetLastChunk() bool {
	if x != nil {
		return x.LastChunk
	}
	return false
}

func (x *RemoteChunkInfo) GetChecksum() string {
	if x != nil {
		return x.Checksum
	}
	return ""
}

type GetRemoteChunkMessage struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Size     uint64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	Offset   uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Path     string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	FolderId uint64 `protobuf:"varint,4,opt,name=folderId,proto3" json:"folderId,omitempty"`
}

func (x *GetRemoteChunkMessage) Reset() {
	*x = GetRemoteChunkMessage{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[10]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *GetRemoteChunkMessage) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*GetRemoteChunkMessage) ProtoMessage() {}

func (x *GetRemoteChunkMessage) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[10]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use GetRemoteChunkMessage.ProtoReflect.Descriptor instead.
func (*GetRemoteChunkMessage) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{10}
}

func (x *GetRemoteChunkMessage) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

func (x *GetRemoteChunkMessage) GetOffset() uint64 {
	if x != nil {
		return x.Offset
	}
	return 0
}

func (x *GetRemoteChunkMessage) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

func (x *GetRemoteChunkMessage) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

type RemoteChunk struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (x *RemoteChunk) Reset() {
	*x = RemoteChunk{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[11]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RemoteChunk) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RemoteChunk) ProtoMessage() {}

func (x *RemoteChunk) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[11]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RemoteChunk.ProtoReflect.Descriptor instead.
func (*RemoteChunk) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{11}
}

func (x *RemoteChunk) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

type SyncFileItem struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}

func (x *SyncFileItem) Reset() {
	*x = SyncFileItem{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[12]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *SyncFileItem) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SyncFileItem) ProtoMessage() {}

func (x *SyncFileItem) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[12]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SyncFileItem.ProtoReflect.Descriptor instead.
func (*SyncFileItem) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{12}
}

func (x *SyncFileItem) GetPath() string {
	if x != nil {
		return x.Path
	}
	return ""
}

type SyncFileListMessage struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Folder   []*SyncFileItem `protobuf:"bytes,1,rep,name=folder,proto3" json:"folder,omitempty"`
	File     []*SyncFileItem `protobuf:"bytes,2,rep,name=file,proto3" json:"file,omitempty"`
	FolderId uint64          `protobuf:"varint,3,opt,name=folderId,proto3" json:"folderId,omitempty"`
}

func (x *SyncFileListMessage) Reset() {
	*x = SyncFileListMessage{}
	if protoimpl.UnsafeEnabled {
		mi := &file_service_proto_msgTypes[13]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *SyncFileListMessage) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SyncFileListMessage) ProtoMessage() {}

func (x *SyncFileListMessage) ProtoReflect() protoreflect.Message {
	mi := &file_service_proto_msgTypes[13]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SyncFileListMessage.ProtoReflect.Descriptor instead.
func (*SyncFileListMessage) Descriptor() ([]byte, []int) {
	return file_service_proto_rawDescGZIP(), []int{13}
}

func (x *SyncFileListMessage) GetFolder() []*SyncFileItem {
	if x != nil {
		return x.Folder
	}
	return nil
}

func (x *SyncFileListMessage) GetFile() []*SyncFileItem {
	if x != nil {
		return x.File
	}
	return nil
}

func (x *SyncFileListMessage) GetFolderId() uint64 {
	if x != nil {
		return x.FolderId
	}
	return 0
}

var File_service_proto protoreflect.FileDescriptor

var file_service_proto_rawDesc = []byte{
	0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
	0x28, 0x0a, 0x0c, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
	0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
	0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x68,
	0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78,
	0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a,
	0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a,
	0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
	0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65,
	0x63, 0x6b, 0x53, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65,
	0x63, 0x6b, 0x53, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20,
	0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x6c,
	0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66, 0x6f, 0x6c,
	0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
	0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18,
	0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xab,
	0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65,
	0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12,
	0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69,
	0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01,
	0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
	0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a,
	0x0a, 0x08, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
	0x52, 0x08, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x61,
	0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x4c,
	0x61, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
	0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x0f,
	0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
	0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
	0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x51, 0x0a, 0x0b, 0x52, 0x65, 0x6d,
	0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08,
	0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08,
	0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65,
	0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x37, 0x0a, 0x11,
	0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c,
	0x74, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
	0x32, 0x0c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x05,
	0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46,
	0x69, 0x6c, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66,
	0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66,
	0x6f, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65,
	0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x4d, 0x65, 0x73,
	0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
	0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x6c, 0x64,
	0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66, 0x6f, 0x6c, 0x64,
	0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01,
	0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73,
	0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
	0x22, 0x4b, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x49,
	0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b,
	0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e,
	0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20,
	0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x73, 0x0a,
	0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d,
	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01,
	0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66,
	0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73,
	0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
	0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72,
	0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72,
	0x49, 0x64, 0x22, 0x21, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e,
	0x6b, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
	0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x22, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c,
	0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20,
	0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x7b, 0x0a, 0x13, 0x53, 0x79, 0x6e,
	0x63, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
	0x12, 0x25, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
	0x32, 0x0d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52,
	0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18,
	0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c, 0x65,
	0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f,
	0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66, 0x6f,
	0x6c, 0x64, 0x65, 0x72, 0x49, 0x64, 0x32, 0xde, 0x02, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x53,
	0x79, 0x6e, 0x63, 0x12, 0x28, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x68, 0x75, 0x6e,
	0x6b, 0x12, 0x0a, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x0c, 0x2e,
	0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x2b, 0x0a,
	0x0d, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x06,
	0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x10, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x75,
	0x6e, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0f, 0x52, 0x65,
	0x61, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x13, 0x2e,
	0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61,
	0x67, 0x65, 0x1a, 0x12, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73,
	0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x52,
	0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e,
	0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68,
	0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x10,
	0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f,
	0x22, 0x00, 0x12, 0x3c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46,
	0x69, 0x6c, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65,
	0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
	0x1a, 0x0c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x00,
	0x12, 0x35, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74,
	0x12, 0x14, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d,
	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73,
	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_service_proto_rawDescOnce sync.Once
	file_service_proto_rawDescData = file_service_proto_rawDesc
)

func file_service_proto_rawDescGZIP() []byte {
	file_service_proto_rawDescOnce.Do(func() {
		file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData)
	})
	return file_service_proto_rawDescData
}

var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_service_proto_goTypes = []interface{}{
	(*BaseResponse)(nil),              // 0: BaseResponse
	(*ChunkInfo)(nil),                 // 1: ChunkInfo
	(*CheckResult)(nil),               // 2: CheckResult
	(*Chunk)(nil),                     // 3: Chunk
	(*SyncChunkResult)(nil),           // 4: SyncChunkResult
	(*RemoteFiles)(nil),               // 5: RemoteFiles
	(*RemoteFilesResult)(nil),         // 6: RemoteFilesResult
	(*RemoteFilesMessage)(nil),        // 7: RemoteFilesMessage
	(*GetRemoteChunkInfoMessage)(nil), // 8: GetRemoteChunkInfoMessage
	(*RemoteChunkInfo)(nil),           // 9: RemoteChunkInfo
	(*GetRemoteChunkMessage)(nil),     // 10: GetRemoteChunkMessage
	(*RemoteChunk)(nil),               // 11: RemoteChunk
	(*SyncFileItem)(nil),              // 12: SyncFileItem
	(*SyncFileListMessage)(nil),       // 13: SyncFileListMessage
}
var file_service_proto_depIdxs = []int32{
	5,  // 0: RemoteFilesResult.files:type_name -> RemoteFiles
	12, // 1: SyncFileListMessage.folder:type_name -> SyncFileItem
	12, // 2: SyncFileListMessage.file:type_name -> SyncFileItem
	1,  // 3: FileSync.CheckChunk:input_type -> ChunkInfo
	3,  // 4: FileSync.SyncFileChunk:input_type -> Chunk
	7,  // 5: FileSync.ReadFolderFiles:input_type -> RemoteFilesMessage
	8,  // 6: FileSync.GetRemoteFileChunkInfo:input_type -> GetRemoteChunkInfoMessage
	10, // 7: FileSync.GetRemoteFileChunk:input_type -> GetRemoteChunkMessage
	13, // 8: FileSync.SyncFileList:input_type -> SyncFileListMessage
	2,  // 9: FileSync.CheckChunk:output_type -> CheckResult
	4,  // 10: FileSync.SyncFileChunk:output_type -> SyncChunkResult
	6,  // 11: FileSync.ReadFolderFiles:output_type -> RemoteFilesResult
	9,  // 12: FileSync.GetRemoteFileChunkInfo:output_type -> RemoteChunkInfo
	11, // 13: FileSync.GetRemoteFileChunk:output_type -> RemoteChunk
	0,  // 14: FileSync.SyncFileList:output_type -> BaseResponse
	9,  // [9:15] is the sub-list for method output_type
	3,  // [3:9] is the sub-list for method input_type
	3,  // [3:3] is the sub-list for extension type_name
	3,  // [3:3] is the sub-list for extension extendee
	0,  // [0:3] is the sub-list for field type_name
}

func init() { file_service_proto_init() }
func file_service_proto_init() {
	if File_service_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*BaseResponse); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*ChunkInfo); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*CheckResult); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*Chunk); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*SyncChunkResult); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RemoteFiles); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RemoteFilesResult); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RemoteFilesMessage); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*GetRemoteChunkInfoMessage); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RemoteChunkInfo); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*GetRemoteChunkMessage); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RemoteChunk); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*SyncFileItem); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*SyncFileListMessage); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_service_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   14,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_service_proto_goTypes,
		DependencyIndexes: file_service_proto_depIdxs,
		MessageInfos:      file_service_proto_msgTypes,
	}.Build()
	File_service_proto = out.File
	file_service_proto_rawDesc = nil
	file_service_proto_goTypes = nil
	file_service_proto_depIdxs = nil
}

repository: Project-XPolaris/YouSync-Server

repo_name: Project-XPolaris/YouSync-Server


text:
package internal

import (
	"unsafe"
)

func f683(ctx *Context, l0 int32, l1 int32) {
	var l2 int32
	_ = l2
	var s0i32 int32
	_ = s0i32
	var s1i32 int32
	_ = s1i32
	var s2i32 int32
	_ = s2i32
	var s3i32 int32
	_ = s3i32
	var s1i64 int64
	_ = s1i64
	s0i32 = l0
	s0i32 = *(*int32)(unsafe.Pointer(&ctx.Mem[int(s0i32+0)]))
	l0 = s0i32
	s0i32 = *(*int32)(unsafe.Pointer(&ctx.Mem[int(s0i32+28)]))
	l2 = s0i32
	s1i32 = 1
	if s0i32 >= s1i32 {
		s0i32 = 1
	} else {
		s0i32 = 0
	}
	if s0i32 != 0 {
		s0i32 = l1
		if s0i32 == 0 {
			s0i32 = 1
		} else {
			s0i32 = 0
		}
		if s0i32 != 0 {
			goto lbl0
		}
		s0i32 = l1
		s1i32 = l0
		s1i32 = *(*int32)(unsafe.Pointer(&ctx.Mem[int(s1i32+20)]))
		s2i32 = l2
		s3i32 = 3
		s2i32 = s2i32 << (uint32(s3i32) & 31)
		s1i32 = s1i32 + s2i32
		s2i32 = -8
		s1i32 = s1i32 + s2i32
		s1i64 = *(*int64)(unsafe.Pointer(&ctx.Mem[int(s1i32+0)]))
		*(*uint64)(unsafe.Pointer(&ctx.Mem[int(s0i32+0)])) = uint64(s1i64)
		return
	}
	s0i32 = l1
	if s0i32 == 0 {
		s0i32 = 1
	} else {
		s0i32 = 0
	}
	if s0i32 != 0 {
		goto lbl0
	}
	s0i32 = l1
	s1i64 = 0
	*(*uint64)(unsafe.Pointer(&ctx.Mem[int(s0i32+0)])) = uint64(s1i64)
lbl0:
}

repository: chrsan/shadow

repo_name: chrsan/shadow