static void xan_unpack(unsigned char *dest, const unsigned char *src, int dest_len)

{

    unsigned char opcode;

    int size;

    unsigned char *dest_end = dest + dest_len;



    while (dest < dest_end) {

        opcode = *src++;



        if (opcode < 0xe0) {

            int size2, back;

            if ( (opcode & 0x80) == 0 ) {



                size = opcode & 3;



                back  = ((opcode & 0x60) << 3) + *src++ + 1;

                size2 = ((opcode & 0x1c) >> 2) + 3;



            } else if ( (opcode & 0x40) == 0 ) {



                size = *src >> 6;



                back  = (bytestream_get_be16(&src) & 0x3fff) + 1;

                size2 = (opcode & 0x3f) + 4;



            } else {



                size = opcode & 3;



                back  = ((opcode & 0x10) << 12) + bytestream_get_be16(&src) + 1;

                size2 = ((opcode & 0x0c) <<  6) + *src++ + 5;

                if (size + size2 > dest_end - dest)

                    return;

            }

            memcpy(dest, src, size);  dest += size;  src += size;

            av_memcpy_backptr(dest, back, size2);

            dest += size2;

        } else {

            int finish = opcode >= 0xfc;

            size = finish ? opcode & 3 : ((opcode & 0x1f) << 2) + 4;



            memcpy(dest, src, size);  dest += size;  src += size;

            if (finish)

                return;

        }

    }

}

static void xan_unpack(unsigned char *dest, const unsigned char *src, int dest_len)

{

    unsigned char opcode;

    int size;

    unsigned char *dest_end = dest + dest_len;



    while (dest < dest_end) {

        opcode = *src++;



        if (opcode < 0xe0) {

            int size2, back;

            if ( (opcode & 0x80) == 0 ) {



                size = opcode & 3;



                back  = ((opcode & 0x60) << 3) + *src++ + 1;

                size2 = ((opcode & 0x1c) >> 2) + 3;



            } else if ( (opcode & 0x40) == 0 ) {



                size = *src >> 6;



                back  = (bytestream_get_be16(&src) & 0x3fff) + 1;

                size2 = (opcode & 0x3f) + 4;



            } else {



                size = opcode & 3;



                back  = ((opcode & 0x10) << 12) + bytestream_get_be16(&src) + 1;

                size2 = ((opcode & 0x0c) <<  6) + *src++ + 5;

                if (size + size2 > dest_end - dest)

                    return;

            }

            memcpy(dest, src, size);  dest += size;  src += size;

            av_memcpy_backptr(dest, back, size2);

            dest += size2;

        } else {

            int finish = opcode >= 0xfc;

            size = finish ? opcode & 3 : ((opcode & 0x1f) << 2) + 4;



            memcpy(dest, src, size);  dest += size;  src += size;

            if (finish)

                return;

        }

    }

}

static void xan_unpack(unsigned char *dest, const unsigned char *src, int dest_len)     while (dest < dest_end) {                 if (size + size2 > dest_end - dest)
static void FUNC_0(unsigned char *VAR_0, const unsigned char *VAR_1, int VAR_2)

{

    unsigned char VAR_3;

    int VAR_4;

    unsigned char *VAR_5 = VAR_0 + VAR_2;



    while (VAR_0 < VAR_5) {

        VAR_3 = *VAR_1++;



        if (VAR_3 < 0xe0) {

            int VAR_6, VAR_7;

            if ( (VAR_3 & 0x80) == 0 ) {



                VAR_4 = VAR_3 & 3;



                VAR_7  = ((VAR_3 & 0x60) << 3) + *VAR_1++ + 1;

                VAR_6 = ((VAR_3 & 0x1c) >> 2) + 3;



            } else if ( (VAR_3 & 0x40) == 0 ) {



                VAR_4 = *VAR_1 >> 6;



                VAR_7  = (bytestream_get_be16(&VAR_1) & 0x3fff) + 1;

                VAR_6 = (VAR_3 & 0x3f) + 4;



            } else {



                VAR_4 = VAR_3 & 3;



                VAR_7  = ((VAR_3 & 0x10) << 12) + bytestream_get_be16(&VAR_1) + 1;

                VAR_6 = ((VAR_3 & 0x0c) <<  6) + *VAR_1++ + 5;

                if (VAR_4 + VAR_6 > VAR_5 - VAR_0)

                    return;

            }

            memcpy(VAR_0, VAR_1, VAR_4);  VAR_0 += VAR_4;  VAR_1 += VAR_4;

            av_memcpy_backptr(VAR_0, VAR_7, VAR_6);

            VAR_0 += VAR_6;

        } else {

            int VAR_8 = VAR_3 >= 0xfc;

            VAR_4 = VAR_8 ? VAR_3 & 3 : ((VAR_3 & 0x1f) << 2) + 4;



            memcpy(VAR_0, VAR_1, VAR_4);  VAR_0 += VAR_4;  VAR_1 += VAR_4;

            if (VAR_8)

                return;

        }

    }

}

static void FUNC_0(unsigned char *VAR_0, const unsigned char *VAR_1, int VAR_2)
{ unsigned char VAR_3; int VAR_4; unsigned char *VAR_5 = VAR_0 + VAR_2; while (VAR_0 < VAR_5) { VAR_3 = *VAR_1++; if (VAR_3 < 0xe0) { int VAR_6, VAR_7; if ( (VAR_3 & 0x80) == 0 ) { VAR_4 = VAR_3 & 3; VAR_7  = ((VAR_3 & 0x60) << 3) + *VAR_1++ + 1; VAR_6 = ((VAR_3 & 0x1c) >> 2) + 3; } else if ( (VAR_3 & 0x40) == 0 ) { VAR_4 = *VAR_1 >> 6; VAR_7  = (bytestream_get_be16(&VAR_1) & 0x3fff) + 1; VAR_6 = (VAR_3 & 0x3f) + 4; } else { VAR_4 = VAR_3 & 3; VAR_7  = ((VAR_3 & 0x10) << 12) + bytestream_get_be16(&VAR_1) + 1; VAR_6 = ((VAR_3 & 0x0c) <<  6) + *VAR_1++ + 5; if (VAR_4 + VAR_6 > VAR_5 - VAR_0)
return; } memcpy(VAR_0, VAR_1, VAR_4);  VAR_0 += VAR_4;  VAR_1 += VAR_4; av_memcpy_backptr(VAR_0, VAR_7, VAR_6); VAR_0 += VAR_6; } else { int VAR_8 = VAR_3 >= 0xfc; VAR_4 = VAR_8 ? VAR_3 & 3 : ((VAR_3 & 0x1f) << 2) + 4; memcpy(VAR_0, VAR_1, VAR_4);  VAR_0 += VAR_4;  VAR_1 += VAR_4; if (VAR_8)
return; } } }