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: backward_references_hq.go
    path of file: ./repos/scan4all/vendor/github.com/andybalholm/brotli
    
    the code of the file until where you have to start completion: package brotli

import "math"

type zopfliNode struct {
	length              uint32
	distance            uint32
	dcode_insert_length uint32
	u                   struct {
		cost     float32
		next     uint32
		shortcut uint32
	}
}

const maxEffectiveDistanceAlphabetSize = 544

const kInfinity float32 = 1.7e38 /* ~= 2 ^ 127 */

var kDistanceCacheIndex = []uint32{0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1}

var kDistanceCacheOffset = []int{0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3}

func initZopfliNodes(array []zopfliNode, length uint) {
	var stub zopfliNode
	var i uint
	stub.length = 1
	stub.distance = 0
	st
    
func zopfliComputeShortestPath(num_bytes uint, position uint, ringbuffer []byte, ringbuffer_mask uint, params *encoderParams, dist_cache []int, hasher *h10, nodes []zopfliNode) uint {
	var max_backward_limit uint = maxBackwardLimit(params.lgwin)
	var max_zopfli_len uint = maxZopfliLen(params)
	var model zopfliCostModel
	var queue startPosQueue
	var matches [2 * (maxNumMatchesH10 + 64)]backwardMatch
	var store_end uint
	if num_bytes >= hasher.StoreLookahead() {
		store_end = position + num_bytes - hasher.StoreLookahead() + 1
	} else {
		store_end = position
	}
	var i uint
	var gap uint = 0
	var lz_matches_offset uint = 0
	nodes[0].length = 0
	nodes[0].u.cost = 0
	initZopfliCostModel(&model, &params.dist, num_bytes)
	zopfliCostModelSetFromLiteralCosts(&model, position, ringbuffer, ringbuffer_mask)
	initStartPosQueue(&queue)
	for i = 0; i+hasher.HashTypeLength()-1 < num_bytes; i++ {
		var pos uint = position + i
		var max_distance uint = brotli_min_size_t(pos, max_backward_limit)
		var skip uint
		var num_matches uint
		num_matches = findAllMatchesH10(hasher, &params.dictionary, ringbuffer, ringbuffer_mask, pos, num_bytes-i, max_distance, gap, params, matches[lz_matches_offset:])
		if num_matches > 0 && backwardMatchLength(&matches[num_matches-1]) > max_zopfli_len {
			matches[0] = matches[num_matches-1]
			num_matches = 1
		}

		skip = updateNodes(num_bytes, position, i, ringbuffer, ringbuffer_mask, params, max_backward_limit, dist_cache, num_matches, matches[:], &model, &queue, nodes)
		if skip < longCopyQuickStep {
			skip = 0
		}
		if num_matches == 1 && backwardMatchLength(&matches[0]) > max_zopfli_len {
			skip = brotli_max_size_t(backwardMatchLength(&matches[0]), skip)
		}

		if skip > 1 {
			/* Add the tail of the copy to the hasher. */
			hasher.StoreRange(ringbuffer, ringbuffer_mask, pos+1, brotli_min_size_t(pos+skip, store_end))

			skip--
			for skip != 0 {
				i++
				if i+hasher.HashTypeLength()-1 >= num_bytes {
					break
				}
				evaluateNode(position, i, max_backward_limit, gap, dist_cache, &model, &queue, nodes)
				skip--
			}
		}
	}

	cleanupZopfliCostModel(&model)
	return computeShortestPathFromNodes(num_bytes, nodes)
}