Ported LZ77 decompression function from C Sharp.