static int qcow_is_allocated(BlockDriverState *bs, int64_t sector_num,

                             int nb_sectors, int *pnum)

{

    BDRVQcowState *s = bs->opaque;

    int index_in_cluster, n;

    uint64_t cluster_offset;



    cluster_offset = get_cluster_offset(bs, sector_num << 9, 0, 0, 0, 0);

    index_in_cluster = sector_num & (s->cluster_sectors - 1);

    n = s->cluster_sectors - index_in_cluster;

    if (n > nb_sectors)

        n = nb_sectors;

    *pnum = n;

    return (cluster_offset != 0);

}

static int qcow_is_allocated(BlockDriverState *bs, int64_t sector_num,

                             int nb_sectors, int *pnum)

{

    BDRVQcowState *s = bs->opaque;

    int index_in_cluster, n;

    uint64_t cluster_offset;



    cluster_offset = get_cluster_offset(bs, sector_num << 9, 0, 0, 0, 0);

    index_in_cluster = sector_num & (s->cluster_sectors - 1);

    n = s->cluster_sectors - index_in_cluster;

    if (n > nb_sectors)

        n = nb_sectors;

    *pnum = n;

    return (cluster_offset != 0);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,

                             int VAR_2, int *VAR_3)

{

    BDRVQcowState *s = VAR_0->opaque;

    int VAR_4, VAR_5;

    uint64_t cluster_offset;



    cluster_offset = get_cluster_offset(VAR_0, VAR_1 << 9, 0, 0, 0, 0);

    VAR_4 = VAR_1 & (s->cluster_sectors - 1);

    VAR_5 = s->cluster_sectors - VAR_4;

    if (VAR_5 > VAR_2)

        VAR_5 = VAR_2;

    *VAR_3 = VAR_5;

    return (cluster_offset != 0);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
int VAR_2, int *VAR_3)
{ BDRVQcowState *s = VAR_0->opaque; int VAR_4, VAR_5; uint64_t cluster_offset; cluster_offset = get_cluster_offset(VAR_0, VAR_1 << 9, 0, 0, 0, 0); VAR_4 = VAR_1 & (s->cluster_sectors - 1); VAR_5 = s->cluster_sectors - VAR_4; if (VAR_5 > VAR_2)
VAR_5 = VAR_2; *VAR_3 = VAR_5; return (cluster_offset != 0); }