static void qemu_fill_buffer(QEMUFile *f)

{

    int len;

    int pending;



    assert(!qemu_file_is_writable(f));



    pending = f->buf_size - f->buf_index;

    if (pending > 0) {

        memmove(f->buf, f->buf + f->buf_index, pending);

    }

    f->buf_index = 0;

    f->buf_size = pending;



    len = f->ops->get_buffer(f->opaque, f->buf + pending, f->pos,

                        IO_BUF_SIZE - pending);

    if (len > 0) {

        f->buf_size += len;

        f->pos += len;

    } else if (len == 0) {

        qemu_file_set_error(f, -EIO);

    } else if (len != -EAGAIN) {

        qemu_file_set_error(f, len);

    }

}

static void qemu_fill_buffer(QEMUFile *f)

{

    int len;

    int pending;



    assert(!qemu_file_is_writable(f));



    pending = f->buf_size - f->buf_index;

    if (pending > 0) {

        memmove(f->buf, f->buf + f->buf_index, pending);

    }

    f->buf_index = 0;

    f->buf_size = pending;



    len = f->ops->get_buffer(f->opaque, f->buf + pending, f->pos,

                        IO_BUF_SIZE - pending);

    if (len > 0) {

        f->buf_size += len;

        f->pos += len;

    } else if (len == 0) {

        qemu_file_set_error(f, -EIO);

    } else if (len != -EAGAIN) {

        qemu_file_set_error(f, len);

    }

}

static void qemu_fill_buffer(QEMUFile *f)
static void FUNC_0(QEMUFile *VAR_0)

{

    int VAR_1;

    int VAR_2;



    assert(!qemu_file_is_writable(VAR_0));



    VAR_2 = VAR_0->buf_size - VAR_0->buf_index;

    if (VAR_2 > 0) {

        memmove(VAR_0->buf, VAR_0->buf + VAR_0->buf_index, VAR_2);

    }

    VAR_0->buf_index = 0;

    VAR_0->buf_size = VAR_2;



    VAR_1 = VAR_0->ops->get_buffer(VAR_0->opaque, VAR_0->buf + VAR_2, VAR_0->pos,

                        IO_BUF_SIZE - VAR_2);

    if (VAR_1 > 0) {

        VAR_0->buf_size += VAR_1;

        VAR_0->pos += VAR_1;

    } else if (VAR_1 == 0) {

        qemu_file_set_error(VAR_0, -EIO);

    } else if (VAR_1 != -EAGAIN) {

        qemu_file_set_error(VAR_0, VAR_1);

    }

}

static void FUNC_0(QEMUFile *VAR_0)
{ int VAR_1; int VAR_2; assert(!qemu_file_is_writable(VAR_0)); VAR_2 = VAR_0->buf_size - VAR_0->buf_index; if (VAR_2 > 0) { memmove(VAR_0->buf, VAR_0->buf + VAR_0->buf_index, VAR_2); } VAR_0->buf_index = 0; VAR_0->buf_size = VAR_2; VAR_1 = VAR_0->ops->get_buffer(VAR_0->opaque, VAR_0->buf + VAR_2, VAR_0->pos,
IO_BUF_SIZE - VAR_2); if (VAR_1 > 0) { VAR_0->buf_size += VAR_1; VAR_0->pos += VAR_1; } else if (VAR_1 == 0) { qemu_file_set_error(VAR_0, -EIO); } else if (VAR_1 != -EAGAIN) { qemu_file_set_error(VAR_0, VAR_1); } }