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

import "encoding/binary"

/* Copyright 2015 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Function for fast encoding of an input fragment, independently from the input
   history. This function uses two-pass processing: in the first pass we save
   the found backward matches and literal bytes into a buffer, and in the
   second pass w
    
func emitInsertLen(insertlen uint32, commands *[]uint32) {
	if insertlen < 6 {
		(*commands)[0] = insertlen
	} else if insertlen < 130 {
		var tail uint32 = insertlen - 2
		var nbits uint32 = log2FloorNonZero(uint(tail)) - 1
		var prefix uint32 = tail >> nbits
		var inscode uint32 = (nbits << 1) + prefix + 2
		var extra uint32 = tail - (prefix << nbits)
		(*commands)[0] = inscode | extra<<8
	} else if insertlen < 2114 {
		var tail uint32 = insertlen - 66
		var nbits uint32 = log2FloorNonZero(uint(tail))
		var code uint32 = nbits + 10
		var extra uint32 = tail - (1 << nbits)
		(*commands)[0] = code | extra<<8
	} else if insertlen < 6210 {
		var extra uint32 = insertlen - 2114
		(*commands)[0] = 21 | extra<<8
	} else if insertlen < 22594 {
		var extra uint32 = insertlen - 6210
		(*commands)[0] = 22 | extra<<8
	} else {
		var extra uint32 = insertlen - 22594
		(*commands)[0] = 23 | extra<<8
	}

	*commands = (*commands)[1:]
}