static void cin_decode_lzss(const unsigned char *src, int src_size, unsigned char *dst, int dst_size)

{

    uint16_t cmd;

    int i, sz, offset, code;

    unsigned char *dst_end = dst + dst_size;

    const unsigned char *src_end = src + src_size;



    while (src < src_end && dst < dst_end) {

        code = *src++;

        for (i = 0; i < 8 && src < src_end && dst < dst_end; ++i) {

            if (code & (1 << i)) {

                *dst++ = *src++;

            } else {

                cmd = AV_RL16(src); src += 2;

                offset = cmd >> 4;

                sz = (cmd & 0xF) + 2;

                /* don't use memcpy/memmove here as the decoding routine (ab)uses */

                /* buffer overlappings to repeat bytes in the destination */

                sz = FFMIN(sz, dst_end - dst);

                while (sz--) {

                    *dst = *(dst - offset - 1);

                    ++dst;

                }

            }

        }

    }

}

static void cin_decode_lzss(const unsigned char *src, int src_size, unsigned char *dst, int dst_size)

{

    uint16_t cmd;

    int i, sz, offset, code;

    unsigned char *dst_end = dst + dst_size;

    const unsigned char *src_end = src + src_size;



    while (src < src_end && dst < dst_end) {

        code = *src++;

        for (i = 0; i < 8 && src < src_end && dst < dst_end; ++i) {

            if (code & (1 << i)) {

                *dst++ = *src++;

            } else {

                cmd = AV_RL16(src); src += 2;

                offset = cmd >> 4;

                sz = (cmd & 0xF) + 2;

                

                

                sz = FFMIN(sz, dst_end - dst);

                while (sz--) {

                    *dst = *(dst - offset - 1);

                    ++dst;

                }

            }

        }

    }

}

static void FUNC_0(const unsigned char *VAR_0, int VAR_1, unsigned char *VAR_2, int VAR_3)

{

    uint16_t cmd;

    int VAR_4, VAR_5, VAR_6, VAR_7;

    unsigned char *VAR_8 = VAR_2 + VAR_3;

    const unsigned char *VAR_9 = VAR_0 + VAR_1;



    while (VAR_0 < VAR_9 && VAR_2 < VAR_8) {

        VAR_7 = *VAR_0++;

        for (VAR_4 = 0; VAR_4 < 8 && VAR_0 < VAR_9 && VAR_2 < VAR_8; ++VAR_4) {

            if (VAR_7 & (1 << VAR_4)) {

                *VAR_2++ = *VAR_0++;

            } else {

                cmd = AV_RL16(VAR_0); VAR_0 += 2;

                VAR_6 = cmd >> 4;

                VAR_5 = (cmd & 0xF) + 2;

                

                

                VAR_5 = FFMIN(VAR_5, VAR_8 - VAR_2);

                while (VAR_5--) {

                    *VAR_2 = *(VAR_2 - VAR_6 - 1);

                    ++VAR_2;

                }

            }

        }

    }

}

static void FUNC_0(const unsigned char *VAR_0, int VAR_1, unsigned char *VAR_2, int VAR_3)
{ uint16_t cmd; int VAR_4, VAR_5, VAR_6, VAR_7; unsigned char *VAR_8 = VAR_2 + VAR_3; const unsigned char *VAR_9 = VAR_0 + VAR_1; while (VAR_0 < VAR_9 && VAR_2 < VAR_8) { VAR_7 = *VAR_0++; for (VAR_4 = 0; VAR_4 < 8 && VAR_0 < VAR_9 && VAR_2 < VAR_8; ++VAR_4) { if (VAR_7 & (1 << VAR_4)) { *VAR_2++ = *VAR_0++; } else { cmd = AV_RL16(VAR_0); VAR_0 += 2; VAR_6 = cmd >> 4; VAR_5 = (cmd & 0xF) + 2; VAR_5 = FFMIN(VAR_5, VAR_8 - VAR_2); while (VAR_5--) { *VAR_2 = *(VAR_2 - VAR_6 - 1); ++VAR_2; } } } } }