static void flush_buffer(ByteIOContext *s)

{

    if (s->buf_ptr > s->buffer) {

        if (s->write_packet)

            s->write_packet(s->opaque, s->buffer, s->buf_ptr - s->buffer);

        if(s->checksum_ptr){

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

            s->checksum_ptr= s->buffer;

        }

        s->pos += s->buf_ptr - s->buffer;

    }

    s->buf_ptr = s->buffer;

}

static void flush_buffer(ByteIOContext *s)

{

    if (s->buf_ptr > s->buffer) {

        if (s->write_packet)

            s->write_packet(s->opaque, s->buffer, s->buf_ptr - s->buffer);

        if(s->checksum_ptr){

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

            s->checksum_ptr= s->buffer;

        }

        s->pos += s->buf_ptr - s->buffer;

    }

    s->buf_ptr = s->buffer;

}

static void FUNC_0(ByteIOContext *VAR_0)

{

    if (VAR_0->buf_ptr > VAR_0->buffer) {

        if (VAR_0->write_packet)

            VAR_0->write_packet(VAR_0->opaque, VAR_0->buffer, VAR_0->buf_ptr - VAR_0->buffer);

        if(VAR_0->checksum_ptr){

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

            VAR_0->checksum_ptr= VAR_0->buffer;

        }

        VAR_0->pos += VAR_0->buf_ptr - VAR_0->buffer;

    }

    VAR_0->buf_ptr = VAR_0->buffer;

}

static void FUNC_0(ByteIOContext *VAR_0)
{ if (VAR_0->buf_ptr > VAR_0->buffer) { if (VAR_0->write_packet)
VAR_0->write_packet(VAR_0->opaque, VAR_0->buffer, VAR_0->buf_ptr - VAR_0->buffer); if(VAR_0->checksum_ptr){ VAR_0->checksum= VAR_0->update_checksum(VAR_0->checksum, VAR_0->checksum_ptr, VAR_0->buf_ptr - VAR_0->checksum_ptr); VAR_0->checksum_ptr= VAR_0->buffer; } VAR_0->pos += VAR_0->buf_ptr - VAR_0->buffer; } VAR_0->buf_ptr = VAR_0->buffer; }