static int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr)

{

    unsigned char *destptr_bak = destptr;

    unsigned char mask = 0;

    unsigned char maskbit = 0;

    unsigned int ofs, cnt;

  

    while (srclen > 0) {

        if (maskbit == 0) {

            mask = *(srcptr++);

            maskbit = 8;

            srclen--;

            continue;

        }

        if ((mask & (1 << (--maskbit))) == 0) {

            *(int*)destptr = *(int*)srcptr;

            srclen -= 4;

            destptr += 4;

            srcptr += 4;

        } else {

            ofs = *(srcptr++);

            cnt = *(srcptr++);

            ofs += cnt * 256;;

            cnt = ((cnt >> 3) & 0x1f) + 1;

            ofs &= 0x7ff;

            srclen -= 2;

            cnt *= 4;

            for (; cnt > 0; cnt--) {

                *(destptr) = *(destptr - ofs);

                destptr++;

            }

        }

    }



    return (destptr - destptr_bak);

}

static int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr)

{

    unsigned char *destptr_bak = destptr;

    unsigned char mask = 0;

    unsigned char maskbit = 0;

    unsigned int ofs, cnt;

  

    while (srclen > 0) {

        if (maskbit == 0) {

            mask = *(srcptr++);

            maskbit = 8;

            srclen--;

            continue;

        }

        if ((mask & (1 << (--maskbit))) == 0) {

            *(int*)destptr = *(int*)srcptr;

            srclen -= 4;

            destptr += 4;

            srcptr += 4;

        } else {

            ofs = *(srcptr++);

            cnt = *(srcptr++);

            ofs += cnt * 256;;

            cnt = ((cnt >> 3) & 0x1f) + 1;

            ofs &= 0x7ff;

            srclen -= 2;

            cnt *= 4;

            for (; cnt > 0; cnt--) {

                *(destptr) = *(destptr - ofs);

                destptr++;

            }

        }

    }



    return (destptr - destptr_bak);

}

static int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr)     while (srclen > 0) {
static int FUNC_0(unsigned char * VAR_0, int VAR_1, unsigned char * VAR_2)

{

    unsigned char *VAR_3 = VAR_2;

    unsigned char VAR_4 = 0;

    unsigned char VAR_5 = 0;

    unsigned int VAR_6, VAR_7;

  

    while (VAR_1 > 0) {

        if (VAR_5 == 0) {

            VAR_4 = *(VAR_0++);

            VAR_5 = 8;

            VAR_1--;

            continue;

        }

        if ((VAR_4 & (1 << (--VAR_5))) == 0) {

            *(int*)VAR_2 = *(int*)VAR_0;

            VAR_1 -= 4;

            VAR_2 += 4;

            VAR_0 += 4;

        } else {

            VAR_6 = *(VAR_0++);

            VAR_7 = *(VAR_0++);

            VAR_6 += VAR_7 * 256;;

            VAR_7 = ((VAR_7 >> 3) & 0x1f) + 1;

            VAR_6 &= 0x7ff;

            VAR_1 -= 2;

            VAR_7 *= 4;

            for (; VAR_7 > 0; VAR_7--) {

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

                VAR_2++;

            }

        }

    }



    return (VAR_2 - VAR_3);

}

static int FUNC_0(unsigned char * VAR_0, int VAR_1, unsigned char * VAR_2)
{ unsigned char *VAR_3 = VAR_2; unsigned char VAR_4 = 0; unsigned char VAR_5 = 0; unsigned int VAR_6, VAR_7; while (VAR_1 > 0) { if (VAR_5 == 0) { VAR_4 = *(VAR_0++); VAR_5 = 8; VAR_1--; continue; } if ((VAR_4 & (1 << (--VAR_5))) == 0) { *(int*)VAR_2 = *(int*)VAR_0; VAR_1 -= 4; VAR_2 += 4; VAR_0 += 4; } else { VAR_6 = *(VAR_0++); VAR_7 = *(VAR_0++); VAR_6 += VAR_7 * 256;; VAR_7 = ((VAR_7 >> 3) & 0x1f) + 1; VAR_6 &= 0x7ff; VAR_1 -= 2; VAR_7 *= 4; for (; VAR_7 > 0; VAR_7--) { *(VAR_2) = *(VAR_2 - VAR_6); VAR_2++; } } } return (VAR_2 - VAR_3); }