static int bochs_read(BlockDriverState *bs, int64_t sector_num,

                    uint8_t *buf, int nb_sectors)

{

    int ret;



    while (nb_sectors > 0) {

        int64_t block_offset = seek_to_sector(bs, sector_num);

        if (block_offset >= 0) {

            ret = bdrv_pread(bs->file, block_offset, buf, 512);

            if (ret != 512) {

                return -1;

            }

        } else

            memset(buf, 0, 512);

        nb_sectors--;

        sector_num++;

        buf += 512;

    }

    return 0;

}

static int bochs_read(BlockDriverState *bs, int64_t sector_num,

                    uint8_t *buf, int nb_sectors)

{

    int ret;



    while (nb_sectors > 0) {

        int64_t block_offset = seek_to_sector(bs, sector_num);

        if (block_offset >= 0) {

            ret = bdrv_pread(bs->file, block_offset, buf, 512);

            if (ret != 512) {

                return -1;

            }

        } else

            memset(buf, 0, 512);

        nb_sectors--;

        sector_num++;

        buf += 512;

    }

    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,

                    uint8_t *VAR_2, int VAR_3)

{

    int VAR_4;



    while (VAR_3 > 0) {

        int64_t block_offset = seek_to_sector(VAR_0, VAR_1);

        if (block_offset >= 0) {

            VAR_4 = bdrv_pread(VAR_0->file, block_offset, VAR_2, 512);

            if (VAR_4 != 512) {

                return -1;

            }

        } else

            memset(VAR_2, 0, 512);

        VAR_3--;

        VAR_1++;

        VAR_2 += 512;

    }

    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
uint8_t *VAR_2, int VAR_3)
{ int VAR_4; while (VAR_3 > 0) { int64_t block_offset = seek_to_sector(VAR_0, VAR_1); if (block_offset >= 0) { VAR_4 = bdrv_pread(VAR_0->file, block_offset, VAR_2, 512); if (VAR_4 != 512) { return -1; } } else memset(VAR_2, 0, 512); VAR_3--; VAR_1++; VAR_2 += 512; } return 0; }