 +
 +	/* init for parents */
 +	nonNullRank = maxSymbolValue;
-+	while(huffNode[nonNullRank].count == 0) nonNullRank--;
-+	lowS = nonNullRank; nodeRoot = nodeNb + lowS - 1; lowN = nodeNb;
-+	huffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS-1].count;
-+	huffNode[lowS].parent = huffNode[lowS-1].parent = nodeNb;
-+	nodeNb++; lowS-=2;
-+	for (n=nodeNb; n<=nodeRoot; n++) huffNode[n].count = (U32)(1U<<30);
-+	huffNode0[0].count = (U32)(1U<<31);  /* fake entry, strong barrier */
++	while (huffNode[nonNullRank].count == 0)
++		nonNullRank--;
++	lowS = nonNullRank;
++	nodeRoot = nodeNb + lowS - 1;
++	lowN = nodeNb;
++	huffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS - 1].count;
++	huffNode[lowS].parent = huffNode[lowS - 1].parent = nodeNb;
++	nodeNb++;
++	lowS -= 2;
++	for (n = nodeNb; n <= nodeRoot; n++)
++		huffNode[n].count = (U32)(1U << 30);
++	huffNode0[0].count = (U32)(1U << 31); /* fake entry, strong barrier */
 +
 +	/* create parents */
 +	while (nodeNb <= nodeRoot) {

+	unsigned charnum = 0;
+	int previous0 = 0;
+
+	if (hbSize < 4) return ERROR(srcSize_wrong);
+	bitStream = MEM_readLE32(ip);
+	nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */
+	if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
+	bitStream >>= 4;
+	bitCount = 4;
+	*tableLogPtr = nbBits;
+	remaining = (1<<nbBits)+1;
+	threshold = 1<<nbBits;
+	nbBits++;
+
+	while ((remaining>1) & (charnum<=*maxSVPtr)) {
+		if (previous0) {
+			unsigned n0 = charnum;
+			while ((bitStream & 0xFFFF) == 0xFFFF) {
+				n0 += 24;
+				if (ip < iend-5) {
+					ip += 2;
+					bitStream = MEM_readLE32(ip) >> bitCount;
+				} else {
+					bitStream >>= 16;
+					bitCount   += 16;
+			}   }
+			while ((bitStream & 3) == 3) {
+				n0 += 3;
+				bitStream >>= 2;

+
+/*! BIT_readBitsFast() :
+*   unsafe version; only works only if nbBits >= 1 */
+ZSTD_STATIC size_t BIT_readBitsFast(BIT_DStream_t *bitD, U32 nbBits)
+{
+	size_t const value = BIT_lookBitsFast(bitD, nbBits);
+	BIT_skipBits(bitD, nbBits);
