static void mux_chr_read(void *opaque, const uint8_t *buf, int size)

{

    CharDriverState *chr = opaque;

    MuxDriver *d = chr->opaque;

    int m = chr->focus;

    int i;



    mux_chr_accept_input (opaque);



    for(i = 0; i < size; i++)

        if (mux_proc_byte(chr, d, buf[i])) {

            if (d->prod == d->cons &&

                d->chr_can_read[m] &&

                d->chr_can_read[m](d->ext_opaque[m]))

                d->chr_read[m](d->ext_opaque[m], &buf[i], 1);

            else

                d->buffer[d->prod++ & MUX_BUFFER_MASK] = buf[i];

        }

}

static void mux_chr_read(void *opaque, const uint8_t *buf, int size)

{

    CharDriverState *chr = opaque;

    MuxDriver *d = chr->opaque;

    int m = chr->focus;

    int i;



    mux_chr_accept_input (opaque);



    for(i = 0; i < size; i++)

        if (mux_proc_byte(chr, d, buf[i])) {

            if (d->prod == d->cons &&

                d->chr_can_read[m] &&

                d->chr_can_read[m](d->ext_opaque[m]))

                d->chr_read[m](d->ext_opaque[m], &buf[i], 1);

            else

                d->buffer[d->prod++ & MUX_BUFFER_MASK] = buf[i];

        }

}

            if (d->prod == d->cons &&                 d->buffer[d->prod++ & MUX_BUFFER_MASK] = buf[i];
static void FUNC_0(void *VAR_0, const uint8_t *VAR_1, int VAR_2)

{

    CharDriverState *chr = VAR_0;

    MuxDriver *d = chr->VAR_0;

    int VAR_3 = chr->focus;

    int VAR_4;



    mux_chr_accept_input (VAR_0);



    for(VAR_4 = 0; VAR_4 < VAR_2; VAR_4++)

        if (mux_proc_byte(chr, d, VAR_1[VAR_4])) {

            if (d->prod == d->cons &&

                d->chr_can_read[VAR_3] &&

                d->chr_can_read[VAR_3](d->ext_opaque[VAR_3]))

                d->chr_read[VAR_3](d->ext_opaque[VAR_3], &VAR_1[VAR_4], 1);

            else

                d->buffer[d->prod++ & MUX_BUFFER_MASK] = VAR_1[VAR_4];

        }

}

static void FUNC_0(void *VAR_0, const uint8_t *VAR_1, int VAR_2)
{ CharDriverState *chr = VAR_0; MuxDriver *d = chr->VAR_0; int VAR_3 = chr->focus; int VAR_4; mux_chr_accept_input (VAR_0); for(VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) if (mux_proc_byte(chr, d, VAR_1[VAR_4])) { if (d->prod == d->cons &&
d->chr_can_read[VAR_3] &&
d->chr_can_read[VAR_3](d->ext_opaque[VAR_3]))
d->chr_read[VAR_3](d->ext_opaque[VAR_3], &VAR_1[VAR_4], 1); else
d->buffer[d->prod++ & MUX_BUFFER_MASK] = VAR_1[VAR_4]; } }