static int xan_unpack_luma(const uint8_t *src, const int src_size,

                           uint8_t *dst, const int dst_size)

{

   int tree_size, eof;

   const uint8_t *tree;

   int bits, mask;

   int tree_root, node;

   const uint8_t *dst_end = dst + dst_size;

   const uint8_t *src_end = src + src_size;



   tree_size = *src++;

   eof       = *src++;

   tree      = src - eof * 2 - 2;

   tree_root = eof + tree_size;

   src += tree_size * 2;



   node = tree_root;

   bits = *src++;

   mask = 0x80;

   for (;;) {

       int bit = !!(bits & mask);

       mask >>= 1;

       node = tree[node*2 + bit];

       if (node == eof)

           break;

       if (node < eof) {

           *dst++ = node;

           if (dst > dst_end)

               break;

           node = tree_root;

       }

       if (!mask) {

           bits = *src++;

           if (src > src_end)

               break;

           mask = 0x80;

       }

   }

   return dst != dst_end;

}

static int xan_unpack_luma(const uint8_t *src, const int src_size,

                           uint8_t *dst, const int dst_size)

{

   int tree_size, eof;

   const uint8_t *tree;

   int bits, mask;

   int tree_root, node;

   const uint8_t *dst_end = dst + dst_size;

   const uint8_t *src_end = src + src_size;



   tree_size = *src++;

   eof       = *src++;

   tree      = src - eof * 2 - 2;

   tree_root = eof + tree_size;

   src += tree_size * 2;



   node = tree_root;

   bits = *src++;

   mask = 0x80;

   for (;;) {

       int bit = !!(bits & mask);

       mask >>= 1;

       node = tree[node*2 + bit];

       if (node == eof)

           break;

       if (node < eof) {

           *dst++ = node;

           if (dst > dst_end)

               break;

           node = tree_root;

       }

       if (!mask) {

           bits = *src++;

           if (src > src_end)

               break;

           mask = 0x80;

       }

   }

   return dst != dst_end;

}

static int xan_unpack_luma(const uint8_t *src, const int src_size,    const uint8_t *tree;    const uint8_t *src_end = src + src_size;    tree_size = *src++;    eof       = *src++;    tree      = src - eof * 2 - 2;    src += tree_size * 2;    bits = *src++;        node = tree[node*2 + bit];            bits = *src++;            if (src > src_end)    return dst != dst_end;
static int FUNC_0(const uint8_t *VAR_0, const int VAR_1,

                           uint8_t *VAR_2, const int VAR_3)

{

   int VAR_4, VAR_5;

   const uint8_t *VAR_6;

   int VAR_7, VAR_8;

   int VAR_9, VAR_10;

   const uint8_t *VAR_11 = VAR_2 + VAR_3;

   const uint8_t *VAR_12 = VAR_0 + VAR_1;



   VAR_4 = *VAR_0++;

   VAR_5       = *VAR_0++;

   VAR_6      = VAR_0 - VAR_5 * 2 - 2;

   VAR_9 = VAR_5 + VAR_4;

   VAR_0 += VAR_4 * 2;



   VAR_10 = VAR_9;

   VAR_7 = *VAR_0++;

   VAR_8 = 0x80;

   for (;;) {

       int VAR_13 = !!(VAR_7 & VAR_8);

       VAR_8 >>= 1;

       VAR_10 = VAR_6[VAR_10*2 + VAR_13];

       if (VAR_10 == VAR_5)

           break;

       if (VAR_10 < VAR_5) {

           *VAR_2++ = VAR_10;

           if (VAR_2 > VAR_11)

               break;

           VAR_10 = VAR_9;

       }

       if (!VAR_8) {

           VAR_7 = *VAR_0++;

           if (VAR_0 > VAR_12)

               break;

           VAR_8 = 0x80;

       }

   }

   return VAR_2 != VAR_11;

}

static int FUNC_0(const uint8_t *VAR_0, const int VAR_1,
uint8_t *VAR_2, const int VAR_3)
{ int VAR_4, VAR_5; const uint8_t *VAR_6; int VAR_7, VAR_8; int VAR_9, VAR_10; const uint8_t *VAR_11 = VAR_2 + VAR_3; const uint8_t *VAR_12 = VAR_0 + VAR_1; VAR_4 = *VAR_0++; VAR_5       = *VAR_0++; VAR_6      = VAR_0 - VAR_5 * 2 - 2; VAR_9 = VAR_5 + VAR_4; VAR_0 += VAR_4 * 2; VAR_10 = VAR_9; VAR_7 = *VAR_0++; VAR_8 = 0x80; for (;;) { int VAR_13 = !!(VAR_7 & VAR_8); VAR_8 >>= 1; VAR_10 = VAR_6[VAR_10*2 + VAR_13]; if (VAR_10 == VAR_5)
break; if (VAR_10 < VAR_5) { *VAR_2++ = VAR_10; if (VAR_2 > VAR_11)
break; VAR_10 = VAR_9; } if (!VAR_8) { VAR_7 = *VAR_0++; if (VAR_0 > VAR_12)
break; VAR_8 = 0x80; } } return VAR_2 != VAR_11; }