static int xan_huffman_decode(unsigned char *dest, int dest_len,

                              const unsigned char *src, int src_len)

{

    unsigned char byte = *src++;

    unsigned char ival = byte + 0x16;

    const unsigned char * ptr = src + byte*2;

    int ptr_len = src_len - 1 - byte*2;

    unsigned char val = ival;

    unsigned char *dest_end = dest + dest_len;

    GetBitContext gb;



    if (ptr_len < 0)

        return AVERROR_INVALIDDATA;



    init_get_bits(&gb, ptr, ptr_len * 8);



    while ( val != 0x16 ) {

        val = src[val - 0x17 + get_bits1(&gb) * byte];



        if ( val < 0x16 ) {

            if (dest >= dest_end)

                return 0;

            *dest++ = val;

            val = ival;

        }

    }



    return 0;

}

static int xan_huffman_decode(unsigned char *dest, int dest_len,

                              const unsigned char *src, int src_len)

{

    unsigned char byte = *src++;

    unsigned char ival = byte + 0x16;

    const unsigned char * ptr = src + byte*2;

    int ptr_len = src_len - 1 - byte*2;

    unsigned char val = ival;

    unsigned char *dest_end = dest + dest_len;

    GetBitContext gb;



    if (ptr_len < 0)

        return AVERROR_INVALIDDATA;



    init_get_bits(&gb, ptr, ptr_len * 8);



    while ( val != 0x16 ) {

        val = src[val - 0x17 + get_bits1(&gb) * byte];



        if ( val < 0x16 ) {

            if (dest >= dest_end)

                return 0;

            *dest++ = val;

            val = ival;

        }

    }



    return 0;

}

        val = src[val - 0x17 + get_bits1(&gb) * byte];
static int FUNC_0(unsigned char *VAR_0, int VAR_1,

                              const unsigned char *VAR_2, int VAR_3)

{

    unsigned char VAR_4 = *VAR_2++;

    unsigned char VAR_5 = VAR_4 + 0x16;

    const unsigned char * VAR_6 = VAR_2 + VAR_4*2;

    int VAR_7 = VAR_3 - 1 - VAR_4*2;

    unsigned char VAR_8 = VAR_5;

    unsigned char *VAR_9 = VAR_0 + VAR_1;

    GetBitContext gb;



    if (VAR_7 < 0)

        return AVERROR_INVALIDDATA;



    init_get_bits(&gb, VAR_6, VAR_7 * 8);



    while ( VAR_8 != 0x16 ) {

        VAR_8 = VAR_2[VAR_8 - 0x17 + get_bits1(&gb) * VAR_4];



        if ( VAR_8 < 0x16 ) {

            if (VAR_0 >= VAR_9)

                return 0;

            *VAR_0++ = VAR_8;

            VAR_8 = VAR_5;

        }

    }



    return 0;

}

static int FUNC_0(unsigned char *VAR_0, int VAR_1,
const unsigned char *VAR_2, int VAR_3)
{ unsigned char VAR_4 = *VAR_2++; unsigned char VAR_5 = VAR_4 + 0x16; const unsigned char * VAR_6 = VAR_2 + VAR_4*2; int VAR_7 = VAR_3 - 1 - VAR_4*2; unsigned char VAR_8 = VAR_5; unsigned char *VAR_9 = VAR_0 + VAR_1; GetBitContext gb; if (VAR_7 < 0)
return AVERROR_INVALIDDATA; init_get_bits(&gb, VAR_6, VAR_7 * 8); while ( VAR_8 != 0x16 ) { VAR_8 = VAR_2[VAR_8 - 0x17 + get_bits1(&gb) * VAR_4]; if ( VAR_8 < 0x16 ) { if (VAR_0 >= VAR_9)
return 0; *VAR_0++ = VAR_8; VAR_8 = VAR_5; } } return 0; }