static int lzw_get_code(struct LZWState * s)

{

    int c;



    if(s->mode == FF_LZW_GIF) {

        while (s->bbits < s->cursize) {

            if (!s->bs) {

                s->bs = *s->pbuf++;

                if(!s->bs) {

                    s->eob_reached = 1;

                    break;

                }

            }

            s->bbuf |= (*s->pbuf++) << s->bbits;

            s->bbits += 8;

            s->bs--;

        }

        c = s->bbuf & s->curmask;

        s->bbuf >>= s->cursize;

    } else { // TIFF

        while (s->bbits < s->cursize) {

            if (s->pbuf >= s->ebuf) {

                s->eob_reached = 1;

            }

            s->bbuf = (s->bbuf << 8) | (*s->pbuf++);

            s->bbits += 8;

        }

        c = (s->bbuf >> (s->bbits - s->cursize)) & s->curmask;

    }

    s->bbits -= s->cursize;

    return c;

}

static int lzw_get_code(struct LZWState * s)

{

    int c;



    if(s->mode == FF_LZW_GIF) {

        while (s->bbits < s->cursize) {

            if (!s->bs) {

                s->bs = *s->pbuf++;

                if(!s->bs) {

                    s->eob_reached = 1;

                    break;

                }

            }

            s->bbuf |= (*s->pbuf++) << s->bbits;

            s->bbits += 8;

            s->bs--;

        }

        c = s->bbuf & s->curmask;

        s->bbuf >>= s->cursize;

    } else { 

        while (s->bbits < s->cursize) {

            if (s->pbuf >= s->ebuf) {

                s->eob_reached = 1;

            }

            s->bbuf = (s->bbuf << 8) | (*s->pbuf++);

            s->bbits += 8;

        }

        c = (s->bbuf >> (s->bbits - s->cursize)) & s->curmask;

    }

    s->bbits -= s->cursize;

    return c;

}

                if(!s->bs) {                     s->eob_reached = 1;                     break;             if (s->pbuf >= s->ebuf) {                 s->eob_reached = 1;
static int FUNC_0(struct LZWState * VAR_0)

{

    int VAR_1;



    if(VAR_0->mode == FF_LZW_GIF) {

        while (VAR_0->bbits < VAR_0->cursize) {

            if (!VAR_0->bs) {

                VAR_0->bs = *VAR_0->pbuf++;

                if(!VAR_0->bs) {

                    VAR_0->eob_reached = 1;

                    break;

                }

            }

            VAR_0->bbuf |= (*VAR_0->pbuf++) << VAR_0->bbits;

            VAR_0->bbits += 8;

            VAR_0->bs--;

        }

        VAR_1 = VAR_0->bbuf & VAR_0->curmask;

        VAR_0->bbuf >>= VAR_0->cursize;

    } else { 

        while (VAR_0->bbits < VAR_0->cursize) {

            if (VAR_0->pbuf >= VAR_0->ebuf) {

                VAR_0->eob_reached = 1;

            }

            VAR_0->bbuf = (VAR_0->bbuf << 8) | (*VAR_0->pbuf++);

            VAR_0->bbits += 8;

        }

        VAR_1 = (VAR_0->bbuf >> (VAR_0->bbits - VAR_0->cursize)) & VAR_0->curmask;

    }

    VAR_0->bbits -= VAR_0->cursize;

    return VAR_1;

}

static int FUNC_0(struct LZWState * VAR_0)
{ int VAR_1; if(VAR_0->mode == FF_LZW_GIF) { while (VAR_0->bbits < VAR_0->cursize) { if (!VAR_0->bs) { VAR_0->bs = *VAR_0->pbuf++; if(!VAR_0->bs) { VAR_0->eob_reached = 1; break; } } VAR_0->bbuf |= (*VAR_0->pbuf++) << VAR_0->bbits; VAR_0->bbits += 8; VAR_0->bs--; } VAR_1 = VAR_0->bbuf & VAR_0->curmask; VAR_0->bbuf >>= VAR_0->cursize; } else { while (VAR_0->bbits < VAR_0->cursize) { if (VAR_0->pbuf >= VAR_0->ebuf) { VAR_0->eob_reached = 1; } VAR_0->bbuf = (VAR_0->bbuf << 8) | (*VAR_0->pbuf++); VAR_0->bbits += 8; } VAR_1 = (VAR_0->bbuf >> (VAR_0->bbits - VAR_0->cursize)) & VAR_0->curmask; } VAR_0->bbits -= VAR_0->cursize; return VAR_1; }