decompress_generic: Refactor variable length fields
decompress_generic: Refactor variable length fields

Make a helper function to read variable lengths for literals and
match length.

unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso