// Code generated by go generate gen_inflate.go. DO NOT EDIT.

package flate

import (
	
	
	
	
	
)

// Decode a single Huffman block from f.
// hl and hd are the Huffman states for the lit/length values
// and the distance values, respectively. If hd == nil, using the
// fixed distance encoding associated with fixed Huffman blocks.
func ( *decompressor) () {
	const (
		 = iota // Zero value must be stateInit
		
	)
	 := .r.(*bytes.Buffer)

	// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
	// but is smart enough to keep local variables in registers, so use nb and b,
	// inline call to moreBits and reassign b,nb back to f on return.
	, ,  := .nb, .b, &.dict

	switch .stepState {
	case :
		goto 
	case :
		goto 
	}

:
	// Read literal and/or (length, distance) according to RFC section 3.2.3.
	{
		var  int
		{
			// Inlined v, err := f.huffSym(f.hl)
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hl.maxRead)
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hl.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hl.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hl.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = int( >> huffmanValueShift)
					break
				}
			}
		}

		var  int
		switch {
		case  < 256:
			.writeByte(byte())
			if .availWrite() == 0 {
				.toRead = .readFlush()
				.step = huffmanBytesBuffer
				.stepState = 
				.b, .nb = , 
				return
			}
			goto 
		case  == 256:
			.b, .nb = , 
			.finishBlock()
			return
		// otherwise, reference to older data
		case  < 265:
			 =  - (257 - 3)
		case  < maxNumLit:
			 := decCodeToLen[( - 257)]
			 = int(.length) + 3
			 := uint(.extra)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits n>0:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 += int( & bitMask32[])
			 >>=  & regSizeMaskUint32
			 -= 
		default:
			if debugDecode {
				fmt.Println(, ">= maxNumLit")
			}
			.err = CorruptInputError(.roffset)
			.b, .nb = , 
			return
		}

		var  uint32
		if .hd == nil {
			for  < 5 {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<5:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 = uint32(bits.Reverse8(uint8( & 0x1F << 3)))
			 >>= 5
			 -= 5
		} else {
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hd.maxRead)
			// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
			// but is smart enough to keep local variables in registers, so use nb and b,
			// inline call to moreBits and reassign b,nb back to f on return.
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hd.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hd.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hd.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = uint32( >> huffmanValueShift)
					break
				}
			}
		}

		switch {
		case  < 4:
			++
		case  < maxNumDist:
			 := uint(-2) >> 1
			// have 1 bit in bottom of dist, need nb more.
			 := ( & 1) << ( & regSizeMaskUint32)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<nb:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 |=  & bitMask32[]
			 >>=  & regSizeMaskUint32
			 -= 
			 = 1<<((+1)&regSizeMaskUint32) + 1 + 
			// slower: dist = bitMask32[nb+1] + 2 + extra
		default:
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist too big:", , maxNumDist)
			}
			.err = CorruptInputError(.roffset)
			return
		}

		// No check on length; encoding can be prescient.
		if  > uint32(.histSize()) {
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist > dict.histSize():", , .histSize())
			}
			.err = CorruptInputError(.roffset)
			return
		}

		.copyLen, .copyDist = , int()
		goto 
	}

:
	// Perform a backwards copy according to RFC section 3.2.3.
	{
		 := .tryWriteCopy(.copyDist, .copyLen)
		if  == 0 {
			 = .writeCopy(.copyDist, .copyLen)
		}
		.copyLen -= 

		if .availWrite() == 0 || .copyLen > 0 {
			.toRead = .readFlush()
			.step = huffmanBytesBuffer // We need to continue this work
			.stepState = 
			.b, .nb = , 
			return
		}
		goto 
	}
	// Not reached
}

// Decode a single Huffman block from f.
// hl and hd are the Huffman states for the lit/length values
// and the distance values, respectively. If hd == nil, using the
// fixed distance encoding associated with fixed Huffman blocks.
func ( *decompressor) () {
	const (
		 = iota // Zero value must be stateInit
		
	)
	 := .r.(*bytes.Reader)

	// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
	// but is smart enough to keep local variables in registers, so use nb and b,
	// inline call to moreBits and reassign b,nb back to f on return.
	, ,  := .nb, .b, &.dict

	switch .stepState {
	case :
		goto 
	case :
		goto 
	}

:
	// Read literal and/or (length, distance) according to RFC section 3.2.3.
	{
		var  int
		{
			// Inlined v, err := f.huffSym(f.hl)
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hl.maxRead)
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hl.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hl.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hl.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = int( >> huffmanValueShift)
					break
				}
			}
		}

		var  int
		switch {
		case  < 256:
			.writeByte(byte())
			if .availWrite() == 0 {
				.toRead = .readFlush()
				.step = huffmanBytesReader
				.stepState = 
				.b, .nb = , 
				return
			}
			goto 
		case  == 256:
			.b, .nb = , 
			.finishBlock()
			return
		// otherwise, reference to older data
		case  < 265:
			 =  - (257 - 3)
		case  < maxNumLit:
			 := decCodeToLen[( - 257)]
			 = int(.length) + 3
			 := uint(.extra)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits n>0:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 += int( & bitMask32[])
			 >>=  & regSizeMaskUint32
			 -= 
		default:
			if debugDecode {
				fmt.Println(, ">= maxNumLit")
			}
			.err = CorruptInputError(.roffset)
			.b, .nb = , 
			return
		}

		var  uint32
		if .hd == nil {
			for  < 5 {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<5:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 = uint32(bits.Reverse8(uint8( & 0x1F << 3)))
			 >>= 5
			 -= 5
		} else {
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hd.maxRead)
			// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
			// but is smart enough to keep local variables in registers, so use nb and b,
			// inline call to moreBits and reassign b,nb back to f on return.
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hd.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hd.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hd.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = uint32( >> huffmanValueShift)
					break
				}
			}
		}

		switch {
		case  < 4:
			++
		case  < maxNumDist:
			 := uint(-2) >> 1
			// have 1 bit in bottom of dist, need nb more.
			 := ( & 1) << ( & regSizeMaskUint32)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<nb:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 |=  & bitMask32[]
			 >>=  & regSizeMaskUint32
			 -= 
			 = 1<<((+1)&regSizeMaskUint32) + 1 + 
			// slower: dist = bitMask32[nb+1] + 2 + extra
		default:
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist too big:", , maxNumDist)
			}
			.err = CorruptInputError(.roffset)
			return
		}

		// No check on length; encoding can be prescient.
		if  > uint32(.histSize()) {
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist > dict.histSize():", , .histSize())
			}
			.err = CorruptInputError(.roffset)
			return
		}

		.copyLen, .copyDist = , int()
		goto 
	}

:
	// Perform a backwards copy according to RFC section 3.2.3.
	{
		 := .tryWriteCopy(.copyDist, .copyLen)
		if  == 0 {
			 = .writeCopy(.copyDist, .copyLen)
		}
		.copyLen -= 

		if .availWrite() == 0 || .copyLen > 0 {
			.toRead = .readFlush()
			.step = huffmanBytesReader // We need to continue this work
			.stepState = 
			.b, .nb = , 
			return
		}
		goto 
	}
	// Not reached
}

// Decode a single Huffman block from f.
// hl and hd are the Huffman states for the lit/length values
// and the distance values, respectively. If hd == nil, using the
// fixed distance encoding associated with fixed Huffman blocks.
func ( *decompressor) () {
	const (
		 = iota // Zero value must be stateInit
		
	)
	 := .r.(*bufio.Reader)

	// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
	// but is smart enough to keep local variables in registers, so use nb and b,
	// inline call to moreBits and reassign b,nb back to f on return.
	, ,  := .nb, .b, &.dict

	switch .stepState {
	case :
		goto 
	case :
		goto 
	}

:
	// Read literal and/or (length, distance) according to RFC section 3.2.3.
	{
		var  int
		{
			// Inlined v, err := f.huffSym(f.hl)
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hl.maxRead)
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hl.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hl.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hl.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = int( >> huffmanValueShift)
					break
				}
			}
		}

		var  int
		switch {
		case  < 256:
			.writeByte(byte())
			if .availWrite() == 0 {
				.toRead = .readFlush()
				.step = huffmanBufioReader
				.stepState = 
				.b, .nb = , 
				return
			}
			goto 
		case  == 256:
			.b, .nb = , 
			.finishBlock()
			return
		// otherwise, reference to older data
		case  < 265:
			 =  - (257 - 3)
		case  < maxNumLit:
			 := decCodeToLen[( - 257)]
			 = int(.length) + 3
			 := uint(.extra)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits n>0:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 += int( & bitMask32[])
			 >>=  & regSizeMaskUint32
			 -= 
		default:
			if debugDecode {
				fmt.Println(, ">= maxNumLit")
			}
			.err = CorruptInputError(.roffset)
			.b, .nb = , 
			return
		}

		var  uint32
		if .hd == nil {
			for  < 5 {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<5:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 = uint32(bits.Reverse8(uint8( & 0x1F << 3)))
			 >>= 5
			 -= 5
		} else {
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hd.maxRead)
			// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
			// but is smart enough to keep local variables in registers, so use nb and b,
			// inline call to moreBits and reassign b,nb back to f on return.
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hd.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hd.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hd.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = uint32( >> huffmanValueShift)
					break
				}
			}
		}

		switch {
		case  < 4:
			++
		case  < maxNumDist:
			 := uint(-2) >> 1
			// have 1 bit in bottom of dist, need nb more.
			 := ( & 1) << ( & regSizeMaskUint32)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<nb:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 |=  & bitMask32[]
			 >>=  & regSizeMaskUint32
			 -= 
			 = 1<<((+1)&regSizeMaskUint32) + 1 + 
			// slower: dist = bitMask32[nb+1] + 2 + extra
		default:
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist too big:", , maxNumDist)
			}
			.err = CorruptInputError(.roffset)
			return
		}

		// No check on length; encoding can be prescient.
		if  > uint32(.histSize()) {
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist > dict.histSize():", , .histSize())
			}
			.err = CorruptInputError(.roffset)
			return
		}

		.copyLen, .copyDist = , int()
		goto 
	}

:
	// Perform a backwards copy according to RFC section 3.2.3.
	{
		 := .tryWriteCopy(.copyDist, .copyLen)
		if  == 0 {
			 = .writeCopy(.copyDist, .copyLen)
		}
		.copyLen -= 

		if .availWrite() == 0 || .copyLen > 0 {
			.toRead = .readFlush()
			.step = huffmanBufioReader // We need to continue this work
			.stepState = 
			.b, .nb = , 
			return
		}
		goto 
	}
	// Not reached
}

// Decode a single Huffman block from f.
// hl and hd are the Huffman states for the lit/length values
// and the distance values, respectively. If hd == nil, using the
// fixed distance encoding associated with fixed Huffman blocks.
func ( *decompressor) () {
	const (
		 = iota // Zero value must be stateInit
		
	)
	 := .r.(*strings.Reader)

	// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
	// but is smart enough to keep local variables in registers, so use nb and b,
	// inline call to moreBits and reassign b,nb back to f on return.
	, ,  := .nb, .b, &.dict

	switch .stepState {
	case :
		goto 
	case :
		goto 
	}

:
	// Read literal and/or (length, distance) according to RFC section 3.2.3.
	{
		var  int
		{
			// Inlined v, err := f.huffSym(f.hl)
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hl.maxRead)
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hl.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hl.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hl.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = int( >> huffmanValueShift)
					break
				}
			}
		}

		var  int
		switch {
		case  < 256:
			.writeByte(byte())
			if .availWrite() == 0 {
				.toRead = .readFlush()
				.step = huffmanStringsReader
				.stepState = 
				.b, .nb = , 
				return
			}
			goto 
		case  == 256:
			.b, .nb = , 
			.finishBlock()
			return
		// otherwise, reference to older data
		case  < 265:
			 =  - (257 - 3)
		case  < maxNumLit:
			 := decCodeToLen[( - 257)]
			 = int(.length) + 3
			 := uint(.extra)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits n>0:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 += int( & bitMask32[])
			 >>=  & regSizeMaskUint32
			 -= 
		default:
			if debugDecode {
				fmt.Println(, ">= maxNumLit")
			}
			.err = CorruptInputError(.roffset)
			.b, .nb = , 
			return
		}

		var  uint32
		if .hd == nil {
			for  < 5 {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<5:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 = uint32(bits.Reverse8(uint8( & 0x1F << 3)))
			 >>= 5
			 -= 5
		} else {
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hd.maxRead)
			// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
			// but is smart enough to keep local variables in registers, so use nb and b,
			// inline call to moreBits and reassign b,nb back to f on return.
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hd.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hd.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hd.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = uint32( >> huffmanValueShift)
					break
				}
			}
		}

		switch {
		case  < 4:
			++
		case  < maxNumDist:
			 := uint(-2) >> 1
			// have 1 bit in bottom of dist, need nb more.
			 := ( & 1) << ( & regSizeMaskUint32)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<nb:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 |=  & bitMask32[]
			 >>=  & regSizeMaskUint32
			 -= 
			 = 1<<((+1)&regSizeMaskUint32) + 1 + 
			// slower: dist = bitMask32[nb+1] + 2 + extra
		default:
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist too big:", , maxNumDist)
			}
			.err = CorruptInputError(.roffset)
			return
		}

		// No check on length; encoding can be prescient.
		if  > uint32(.histSize()) {
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist > dict.histSize():", , .histSize())
			}
			.err = CorruptInputError(.roffset)
			return
		}

		.copyLen, .copyDist = , int()
		goto 
	}

:
	// Perform a backwards copy according to RFC section 3.2.3.
	{
		 := .tryWriteCopy(.copyDist, .copyLen)
		if  == 0 {
			 = .writeCopy(.copyDist, .copyLen)
		}
		.copyLen -= 

		if .availWrite() == 0 || .copyLen > 0 {
			.toRead = .readFlush()
			.step = huffmanStringsReader // We need to continue this work
			.stepState = 
			.b, .nb = , 
			return
		}
		goto 
	}
	// Not reached
}

// Decode a single Huffman block from f.
// hl and hd are the Huffman states for the lit/length values
// and the distance values, respectively. If hd == nil, using the
// fixed distance encoding associated with fixed Huffman blocks.
func ( *decompressor) () {
	const (
		 = iota // Zero value must be stateInit
		
	)
	 := .r.(Reader)

	// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
	// but is smart enough to keep local variables in registers, so use nb and b,
	// inline call to moreBits and reassign b,nb back to f on return.
	, ,  := .nb, .b, &.dict

	switch .stepState {
	case :
		goto 
	case :
		goto 
	}

:
	// Read literal and/or (length, distance) according to RFC section 3.2.3.
	{
		var  int
		{
			// Inlined v, err := f.huffSym(f.hl)
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hl.maxRead)
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hl.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hl.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hl.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = int( >> huffmanValueShift)
					break
				}
			}
		}

		var  int
		switch {
		case  < 256:
			.writeByte(byte())
			if .availWrite() == 0 {
				.toRead = .readFlush()
				.step = huffmanGenericReader
				.stepState = 
				.b, .nb = , 
				return
			}
			goto 
		case  == 256:
			.b, .nb = , 
			.finishBlock()
			return
		// otherwise, reference to older data
		case  < 265:
			 =  - (257 - 3)
		case  < maxNumLit:
			 := decCodeToLen[( - 257)]
			 = int(.length) + 3
			 := uint(.extra)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits n>0:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 += int( & bitMask32[])
			 >>=  & regSizeMaskUint32
			 -= 
		default:
			if debugDecode {
				fmt.Println(, ">= maxNumLit")
			}
			.err = CorruptInputError(.roffset)
			.b, .nb = , 
			return
		}

		var  uint32
		if .hd == nil {
			for  < 5 {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<5:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 = uint32(bits.Reverse8(uint8( & 0x1F << 3)))
			 >>= 5
			 -= 5
		} else {
			// Since a huffmanDecoder can be empty or be composed of a degenerate tree
			// with single element, huffSym must error on these two edge cases. In both
			// cases, the chunks slice will be 0 for the invalid sequence, leading it
			// satisfy the n == 0 check below.
			 := uint(.hd.maxRead)
			// Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers,
			// but is smart enough to keep local variables in registers, so use nb and b,
			// inline call to moreBits and reassign b,nb back to f on return.
			for {
				for  <  {
					,  := .ReadByte()
					if  != nil {
						.b, .nb = , 
						.err = noEOF()
						return
					}
					.roffset++
					 |= uint32() << ( & regSizeMaskUint32)
					 += 8
				}
				 := .hd.chunks[&(huffmanNumChunks-1)]
				 = uint( & huffmanCountMask)
				if  > huffmanChunkBits {
					 = .hd.links[>>huffmanValueShift][(>>huffmanChunkBits)&.hd.linkMask]
					 = uint( & huffmanCountMask)
				}
				if  <=  {
					if  == 0 {
						.b, .nb = , 
						if debugDecode {
							fmt.Println("huffsym: n==0")
						}
						.err = CorruptInputError(.roffset)
						return
					}
					 =  >> ( & regSizeMaskUint32)
					 =  - 
					 = uint32( >> huffmanValueShift)
					break
				}
			}
		}

		switch {
		case  < 4:
			++
		case  < maxNumDist:
			 := uint(-2) >> 1
			// have 1 bit in bottom of dist, need nb more.
			 := ( & 1) << ( & regSizeMaskUint32)
			for  <  {
				,  := .ReadByte()
				if  != nil {
					.b, .nb = , 
					if debugDecode {
						fmt.Println("morebits f.nb<nb:", )
					}
					.err = 
					return
				}
				.roffset++
				 |= uint32() << ( & regSizeMaskUint32)
				 += 8
			}
			 |=  & bitMask32[]
			 >>=  & regSizeMaskUint32
			 -= 
			 = 1<<((+1)&regSizeMaskUint32) + 1 + 
			// slower: dist = bitMask32[nb+1] + 2 + extra
		default:
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist too big:", , maxNumDist)
			}
			.err = CorruptInputError(.roffset)
			return
		}

		// No check on length; encoding can be prescient.
		if  > uint32(.histSize()) {
			.b, .nb = , 
			if debugDecode {
				fmt.Println("dist > dict.histSize():", , .histSize())
			}
			.err = CorruptInputError(.roffset)
			return
		}

		.copyLen, .copyDist = , int()
		goto 
	}

:
	// Perform a backwards copy according to RFC section 3.2.3.
	{
		 := .tryWriteCopy(.copyDist, .copyLen)
		if  == 0 {
			 = .writeCopy(.copyDist, .copyLen)
		}
		.copyLen -= 

		if .availWrite() == 0 || .copyLen > 0 {
			.toRead = .readFlush()
			.step = huffmanGenericReader // We need to continue this work
			.stepState = 
			.b, .nb = , 
			return
		}
		goto 
	}
	// Not reached
}

func ( *decompressor) () {
	switch .r.(type) {
	case *bytes.Buffer:
		.huffmanBytesBuffer()
	case *bytes.Reader:
		.huffmanBytesReader()
	case *bufio.Reader:
		.huffmanBufioReader()
	case *strings.Reader:
		.huffmanStringsReader()
	case Reader:
		.huffmanGenericReader()
	default:
		.huffmanGenericReader()
	}
}