func subtrieSection(data []byte, startIdx, refLen int, subtrieSize int64) int64 {
	// assume we have a trie of size `y` then we can assume that all of
	// the forks except for the last one on the right are of equal size
	// this is due to how the splitter wraps levels.
	// so for the branches on the left, we can assume that
	// y = (refs - 1) * x + l
	// where y is the size of the subtrie, refs are the number of references
	// x is constant (the brute forced value) and l is the size of the last subtrie
	var (
		refs       = int64(len(data) / refLen) // how many references in the intermediate chunk
		branching  = int64(4096 / refLen)      // branching factor is chunkSize divided by reference length
		branchSize = int64(4096)
	)
	for {
		whatsLeft := subtrieSize - (branchSize * (refs - 1))
		if whatsLeft <= branchSize {
			break
		}
		branchSize *= branching
	}

	// handle last branch edge case
	if startIdx == int(refs-1)*refLen {
		return subtrieSize - (refs-1)*branchSize
	}
	return branchSize
}
// brute-forces the subtrie size for each of the sections in this intermediate chunk
brute-forces the subtrie size for each of the sections in this intermediate chunk
// brute - forces the subtrie size for each of the sections in this intermediate chunk
func subtrieSection(data []byte, startIdx, refLen int, subtrieSize int64) int64 {
	var (
		refs       = int64(len(data) / refLen) 
		branching  = int64(4096 / refLen)      
		branchSize = int64(4096)
	)
	for {
		whatsLeft := subtrieSize - (branchSize * (refs - 1))
		if whatsLeft <= branchSize {
			break
		}
		branchSize *= branching
	}
	if startIdx == int(refs-1)*refLen {
		return subtrieSize - (refs-1)*branchSize
	}
	return branchSize
}
func subtrieSection ( data [ ] byte , startIdx , refLen int , subtrieSize int64 ) int64 { var ( refs = int64 ( len ( data ) / refLen ) branching = int64 ( 4096 / refLen ) branchSize = int64 ( 4096 ) ) for { whatsLeft := subtrieSize - ( branchSize * ( refs - 1 ) ) if whatsLeft <= branchSize { break } branchSize *= branching } if startIdx == int ( refs - 1 ) * refLen { return subtrieSize - ( refs - 1 ) * branchSize } return branchSize }
brute-forces the subtrie size for each of the sections in this intermediate chunk
brute - forces the subtrie size for each of the sections in this intermediate chunk
// assume we have a trie of size `y` then we can assume that all of // the forks except for the last one on the right are of equal size // this is due to how the splitter wraps levels. // so for the branches on the left, we can assume that // y = (refs - 1) * x + l // where y is the size of the subtrie, refs are the number of references // x is constant (the brute forced value) and l is the size of the last subtrie // how many references in the intermediate chunk // branching factor is chunkSize divided by reference length // handle last branch edge case