You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gkr.go
    path of file: ./repos/gnark/constraint/bw6-761
    
    the code of the file until where you have to start completion: // Copyright 2020 ConsenSys Software Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by gnark DO NOT EDIT

package cs

import (
	"fmt"
	"github.com/consensys/gnark-crypto/ecc/bw6-761/fr"
	"github.com/consensys/gnark-crypto/ecc/bw6-761/fr/gkr"
	"github.com/consensys/gnark-crypto/ecc/bw6-761/fr/polynomial"
	fiatshamir "github.com/consensys/gnark-crypto/fiat-shamir"
	"github.com/consensys/gnark-crypto/utils"
	"github.com/consensys/gnark/constraint"
	hint "github.com/consensys/gnark/constraint/solver"
	"github.com/consensys/gnark/std/utils/algo_utils"
	"hash"
	"math/big"
	"sync"
)

type GkrSolvingData struct {
	assignments gkr.WireAssignment
	circuit     gkr.Circuit
	memoryPool  polynomial.Pool
	
    
func GkrSolveHint(info constraint.GkrInfo, solvingData *GkrSolvingData) hint.Hint {
	return func(_ *big.Int, ins, outs []*big.Int) error {
		// assumes assignmentVector is arranged wire first, instance second in order of solution
		circuit := info.Circuit
		nbInstances := info.NbInstances
		offsets := info.AssignmentOffsets()
		assignment, err := solvingData.init(info)
		if err != nil {
			return err
		}
		chunks := circuit.Chunks(nbInstances)

		solveTask := func(chunkOffset int) utils.Task {
			return func(startInChunk, endInChunk int) {
				start := startInChunk + chunkOffset
				end := endInChunk + chunkOffset
				inputs := solvingData.memoryPool.Make(info.MaxNIns)
				dependencyHeads := make([]int, len(circuit))
				for wI, w := range circuit {
					dependencyHeads[wI] = algo_utils.BinarySearchFunc(func(i int) int {
						return w.Dependencies[i].InputInstance
					}, len(w.Dependencies), start)
				}

				for instanceI := start; instanceI < end; instanceI++ {
					for wireI, wire := range circuit {
						if wire.IsInput() {
							if dependencyHeads[wireI] < len(wire.Dependencies) && instanceI == wire.Dependencies[dependencyHeads[wireI]].InputInstance {
								dep := wire.Dependencies[dependencyHeads[wireI]]
								assignment[wireI][instanceI].Set(&assignment[dep.OutputWire][dep.OutputInstance])
								dependencyHeads[wireI]++
							} else {
								assignment[wireI][instanceI].SetBigInt(ins[offsets[wireI]+instanceI-dependencyHeads[wireI]])
							}
						} else {
							// assemble the inputs
							inputIndexes := info.Circuit[wireI].Inputs
							for i, inputI := range inputIndexes {
								inputs[i].Set(&assignment[inputI][instanceI])
							}
							gate := solvingData.circuit[wireI].Gate
							assignment[wireI][instanceI] = gate.Evaluate(inputs[:len(inputIndexes)]...)
						}
					}
				}
				solvingData.memoryPool.Dump(inputs)
			}
		}

		start := 0
		for _, end := range chunks {
			solvingData.workers.Submit(end-start, solveTask(start), 1024).Wait()
			start = end
		}

		assignment.setOuts(info.Circuit, outs)

		return nil
	}
}