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: huffman_sortByFreq.go
    path of file: ./repos/gotosocial/vendor/github.com/klauspost/compress/flate
    
    the code of the file until where you have to start completion: // Copyright 2009 The Go 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 flate

// Sort sorts data.
// It makes one call to data.Len to determine n, and O(n*log(n)) calls to
// data.Less and data.Swap. The sort is not guaranteed to be stable.
func sortByFreq(data []literalNode) {
	n := len(data)
	quickSortByFreq(data, 0, n, maxDepth(n))
}

func quickSortByFreq(
    
func quickSortByFreq(data []literalNode, a, b, maxDepth int) {
	for b-a > 12 { // Use ShellSort for slices <= 12 elements
		if maxDepth == 0 {
			heapSort(data, a, b)
			return
		}
		maxDepth--
		mlo, mhi := doPivotByFreq(data, a, b)
		// Avoiding recursion on the larger subproblem guarantees
		// a stack depth of at most lg(b-a).
		if mlo-a < b-mhi {
			quickSortByFreq(data, a, mlo, maxDepth)
			a = mhi // i.e., quickSortByFreq(data, mhi, b)
		} else {
			quickSortByFreq(data, mhi, b, maxDepth)
			b = mlo // i.e., quickSortByFreq(data, a, mlo)
		}
	}
	if b-a > 1 {
		// Do ShellSort pass with gap 6
		// It could be written in this simplified form cause b-a <= 12
		for i := a + 6; i < b; i++ {
			if data[i].freq == data[i-6].freq && data[i].literal < data[i-6].literal || data[i].freq < data[i-6].freq {
				data[i], data[i-6] = data[i-6], data[i]
			}
		}
		insertionSortByFreq(data, a, b)
	}
}