static int bdrv_wr_badreq_bytes(BlockDriverState *bs,

                                int64_t offset, int count)

{

    int64_t size = bs->total_sectors << SECTOR_BITS;

    if (count < 0 ||

        offset < 0)

        return 1;



    if (offset > size - count) {

        if (bs->autogrow)

            bs->total_sectors = (offset + count + SECTOR_SIZE - 1) >> SECTOR_BITS;

        else

            return 1;

    }

    return 0;

}

static int bdrv_wr_badreq_bytes(BlockDriverState *bs,

                                int64_t offset, int count)

{

    int64_t size = bs->total_sectors << SECTOR_BITS;

    if (count < 0 ||

        offset < 0)

        return 1;



    if (offset > size - count) {

        if (bs->autogrow)

            bs->total_sectors = (offset + count + SECTOR_SIZE - 1) >> SECTOR_BITS;

        else

            return 1;

    }

    return 0;

}

                                int64_t offset, int count)     int64_t size = bs->total_sectors << SECTOR_BITS;         return 1;         if (bs->autogrow)             return 1;     return 0; static int bdrv_wr_badreq_bytes(BlockDriverState *bs,                                 int64_t offset, int count)     int64_t size = bs->total_sectors << SECTOR_BITS;     if (count < 0 ||         offset < 0)         return 1;     if (offset > size - count) {         if (bs->autogrow)             bs->total_sectors = (offset + count + SECTOR_SIZE - 1) >> SECTOR_BITS;             return 1;     return 0;
static int FUNC_0(BlockDriverState *VAR_0,

                                int64_t VAR_1, int VAR_2)

{

    int64_t size = VAR_0->total_sectors << SECTOR_BITS;

    if (VAR_2 < 0 ||

        VAR_1 < 0)

        return 1;



    if (VAR_1 > size - VAR_2) {

        if (VAR_0->autogrow)

            VAR_0->total_sectors = (VAR_1 + VAR_2 + SECTOR_SIZE - 1) >> SECTOR_BITS;

        else

            return 1;

    }

    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0,
int64_t VAR_1, int VAR_2)
{ int64_t size = VAR_0->total_sectors << SECTOR_BITS; if (VAR_2 < 0 ||
VAR_1 < 0)
return 1; if (VAR_1 > size - VAR_2) { if (VAR_0->autogrow)
VAR_0->total_sectors = (VAR_1 + VAR_2 + SECTOR_SIZE - 1) >> SECTOR_BITS; else
return 1; } return 0; }