static void qemu_fill_buffer(QEMUFile *f)

{

    int len;



    if (f->is_writable)

        return;

    if (f->is_file) {

        fseek(f->outfile, f->buf_offset, SEEK_SET);

        len = fread(f->buf, 1, IO_BUF_SIZE, f->outfile);

        if (len < 0)

            len = 0;

    } else {

        len = bdrv_pread(f->bs, f->base_offset + f->buf_offset,

                         f->buf, IO_BUF_SIZE);

        if (len < 0)

            len = 0;

    }

    f->buf_index = 0;

    f->buf_size = len;

    f->buf_offset += len;

}

static void qemu_fill_buffer(QEMUFile *f)

{

    int len;



    if (f->is_writable)

        return;

    if (f->is_file) {

        fseek(f->outfile, f->buf_offset, SEEK_SET);

        len = fread(f->buf, 1, IO_BUF_SIZE, f->outfile);

        if (len < 0)

            len = 0;

    } else {

        len = bdrv_pread(f->bs, f->base_offset + f->buf_offset,

                         f->buf, IO_BUF_SIZE);

        if (len < 0)

            len = 0;

    }

    f->buf_index = 0;

    f->buf_size = len;

    f->buf_offset += len;

}

static void FUNC_0(QEMUFile *VAR_0)

{

    int VAR_1;



    if (VAR_0->is_writable)

        return;

    if (VAR_0->is_file) {

        fseek(VAR_0->outfile, VAR_0->buf_offset, SEEK_SET);

        VAR_1 = fread(VAR_0->buf, 1, IO_BUF_SIZE, VAR_0->outfile);

        if (VAR_1 < 0)

            VAR_1 = 0;

    } else {

        VAR_1 = bdrv_pread(VAR_0->bs, VAR_0->base_offset + VAR_0->buf_offset,

                         VAR_0->buf, IO_BUF_SIZE);

        if (VAR_1 < 0)

            VAR_1 = 0;

    }

    VAR_0->buf_index = 0;

    VAR_0->buf_size = VAR_1;

    VAR_0->buf_offset += VAR_1;

}

static void FUNC_0(QEMUFile *VAR_0)
{ int VAR_1; if (VAR_0->is_writable)
return; if (VAR_0->is_file) { fseek(VAR_0->outfile, VAR_0->buf_offset, SEEK_SET); VAR_1 = fread(VAR_0->buf, 1, IO_BUF_SIZE, VAR_0->outfile); if (VAR_1 < 0)
VAR_1 = 0; } else { VAR_1 = bdrv_pread(VAR_0->bs, VAR_0->base_offset + VAR_0->buf_offset,
VAR_0->buf, IO_BUF_SIZE); if (VAR_1 < 0)
VAR_1 = 0; } VAR_0->buf_index = 0; VAR_0->buf_size = VAR_1; VAR_0->buf_offset += VAR_1; }