int qemu_peek_byte(QEMUFile *f, int offset)

{

    int index = f->buf_index + offset;



    assert(!qemu_file_is_writable(f));

    assert(offset < IO_BUF_SIZE);



    if (index >= f->buf_size) {

        qemu_fill_buffer(f);

        index = f->buf_index + offset;

        if (index >= f->buf_size) {

            return 0;

        }

    }

    return f->buf[index];

}

int qemu_peek_byte(QEMUFile *f, int offset)

{

    int index = f->buf_index + offset;



    assert(!qemu_file_is_writable(f));

    assert(offset < IO_BUF_SIZE);



    if (index >= f->buf_size) {

        qemu_fill_buffer(f);

        index = f->buf_index + offset;

        if (index >= f->buf_size) {

            return 0;

        }

    }

    return f->buf[index];

}

int FUNC_0(QEMUFile *VAR_0, int VAR_1)

{

    int VAR_2 = VAR_0->buf_index + VAR_1;



    assert(!qemu_file_is_writable(VAR_0));

    assert(VAR_1 < IO_BUF_SIZE);



    if (VAR_2 >= VAR_0->buf_size) {

        qemu_fill_buffer(VAR_0);

        VAR_2 = VAR_0->buf_index + VAR_1;

        if (VAR_2 >= VAR_0->buf_size) {

            return 0;

        }

    }

    return VAR_0->buf[VAR_2];

}

int FUNC_0(QEMUFile *VAR_0, int VAR_1)
{ int VAR_2 = VAR_0->buf_index + VAR_1; assert(!qemu_file_is_writable(VAR_0)); assert(VAR_1 < IO_BUF_SIZE); if (VAR_2 >= VAR_0->buf_size) { qemu_fill_buffer(VAR_0); VAR_2 = VAR_0->buf_index + VAR_1; if (VAR_2 >= VAR_0->buf_size) { return 0; } } return VAR_0->buf[VAR_2]; }