void qemu_put_byte(QEMUFile *f, int v)

{

    if (!f->last_error && f->is_write == 0 && f->buf_index > 0) {

        fprintf(stderr,

                "Attempted to write to buffer while read buffer is not empty\n");

        abort();

    }



    f->buf[f->buf_index++] = v;

    f->is_write = 1;

    if (f->buf_index >= IO_BUF_SIZE) {

        int ret = qemu_fflush(f);

        qemu_file_set_if_error(f, ret);

    }

}

void qemu_put_byte(QEMUFile *f, int v)

{

    if (!f->last_error && f->is_write == 0 && f->buf_index > 0) {

        fprintf(stderr,

                "Attempted to write to buffer while read buffer is not empty\n");

        abort();

    }



    f->buf[f->buf_index++] = v;

    f->is_write = 1;

    if (f->buf_index >= IO_BUF_SIZE) {

        int ret = qemu_fflush(f);

        qemu_file_set_if_error(f, ret);

    }

}

void FUNC_0(QEMUFile *VAR_0, int VAR_1)

{

    if (!VAR_0->last_error && VAR_0->is_write == 0 && VAR_0->buf_index > 0) {

        fprintf(stderr,

                "Attempted to write to buffer while read buffer is not empty\n");

        abort();

    }



    VAR_0->buf[VAR_0->buf_index++] = VAR_1;

    VAR_0->is_write = 1;

    if (VAR_0->buf_index >= IO_BUF_SIZE) {

        int VAR_2 = qemu_fflush(VAR_0);

        qemu_file_set_if_error(VAR_0, VAR_2);

    }

}

void FUNC_0(QEMUFile *VAR_0, int VAR_1)
{ if (!VAR_0->last_error && VAR_0->is_write == 0 && VAR_0->buf_index > 0) { fprintf(stderr,
"Attempted to write to buffer while read buffer is not empty\n"); abort(); } VAR_0->buf[VAR_0->buf_index++] = VAR_1; VAR_0->is_write = 1; if (VAR_0->buf_index >= IO_BUF_SIZE) { int VAR_2 = qemu_fflush(VAR_0); qemu_file_set_if_error(VAR_0, VAR_2); } }