static void fill_buffer(ByteIOContext *s)

{

    int len;



    /* no need to do anything if EOF already reached */

    if (s->eof_reached)

        return;



    if(s->update_checksum){

        if(s->buf_end > s->checksum_ptr)

            s->checksum= s->update_checksum(s->checksum, s->checksum_ptr, s->buf_end - s->checksum_ptr);

        s->checksum_ptr= s->buffer;

    }



    len = s->read_packet(s->opaque, s->buffer, s->buffer_size);

    if (len <= 0) {

        /* do not modify buffer if EOF reached so that a seek back can

           be done without rereading data */

        s->eof_reached = 1;

        if(len<0)

            s->error= len;

    } else {

        s->pos += len;

        s->buf_ptr = s->buffer;

        s->buf_end = s->buffer + len;

    }

}

static void fill_buffer(ByteIOContext *s)

{

    int len;



    

    if (s->eof_reached)

        return;



    if(s->update_checksum){

        if(s->buf_end > s->checksum_ptr)

            s->checksum= s->update_checksum(s->checksum, s->checksum_ptr, s->buf_end - s->checksum_ptr);

        s->checksum_ptr= s->buffer;

    }



    len = s->read_packet(s->opaque, s->buffer, s->buffer_size);

    if (len <= 0) {

        



        s->eof_reached = 1;

        if(len<0)

            s->error= len;

    } else {

        s->pos += len;

        s->buf_ptr = s->buffer;

        s->buf_end = s->buffer + len;

    }

}

static void FUNC_0(ByteIOContext *VAR_0)

{

    int VAR_1;



    

    if (VAR_0->eof_reached)

        return;



    if(VAR_0->update_checksum){

        if(VAR_0->buf_end > VAR_0->checksum_ptr)

            VAR_0->checksum= VAR_0->update_checksum(VAR_0->checksum, VAR_0->checksum_ptr, VAR_0->buf_end - VAR_0->checksum_ptr);

        VAR_0->checksum_ptr= VAR_0->buffer;

    }



    VAR_1 = VAR_0->read_packet(VAR_0->opaque, VAR_0->buffer, VAR_0->buffer_size);

    if (VAR_1 <= 0) {

        



        VAR_0->eof_reached = 1;

        if(VAR_1<0)

            VAR_0->error= VAR_1;

    } else {

        VAR_0->pos += VAR_1;

        VAR_0->buf_ptr = VAR_0->buffer;

        VAR_0->buf_end = VAR_0->buffer + VAR_1;

    }

}

static void FUNC_0(ByteIOContext *VAR_0)
{ int VAR_1; if (VAR_0->eof_reached)
return; if(VAR_0->update_checksum){ if(VAR_0->buf_end > VAR_0->checksum_ptr)
VAR_0->checksum= VAR_0->update_checksum(VAR_0->checksum, VAR_0->checksum_ptr, VAR_0->buf_end - VAR_0->checksum_ptr); VAR_0->checksum_ptr= VAR_0->buffer; } VAR_1 = VAR_0->read_packet(VAR_0->opaque, VAR_0->buffer, VAR_0->buffer_size); if (VAR_1 <= 0) { VAR_0->eof_reached = 1; if(VAR_1<0)
VAR_0->error= VAR_1; } else { VAR_0->pos += VAR_1; VAR_0->buf_ptr = VAR_0->buffer; VAR_0->buf_end = VAR_0->buffer + VAR_1; } }