- r2 = fn_598b4(r10_data, 0x04);
- r7 = r2 + 1;
- r6 = 0;
- while (r6 <= r7) {
- r2 = (r6 + r11) & 0x3ff;
- r4 = arr_59b64[r2];
- write_byte(r4, data_out);
- arr_59b64[r5] = r4;
- r5 = (r5 + 1) & 0x3ff;
- r6++;
+ /* length of dictionary word used */
+ wordlen = get_next_bits(data_in, 0x04) + 1;
+ for (i = 0; i <= wordlen ; i++) {
+ /* lookup dictionary byte */
+ byte = buf[(wordoffset + i) & 0x3ff];
+ write_byte(byte, data_out);
+ /* Save byte in buffer, to be reused later */
+ buf[pos] = byte;
+ pos = (pos + 1) & 0x3ff;