code: func reg2bin(beg, end int64, minShift, depth uint32) uint32 {
  	end--
  	s := minShift
  	t := uint32(((1 << (depth * nextBinShift)) - 1) / 7)
  	for level := depth; level > 0; level-- {
  		offset := beg >> s
  		if offset == end>>s {
  			return t + uint32(offset)
  		}
  		s += nextBinShift
  		t -= 1 << (level * nextBinShift)
  	}
  	return 0
  }
docs: // calculate bin given an alignment covering [beg,end) (zero-based, half-close-half-open)