static void inc_refcounts(BlockDriverState *bs,

                          BdrvCheckResult *res,

                          uint16_t *refcount_table,

                          int refcount_table_size,

                          int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int64_t start, last, cluster_offset;

    int k;



    if (size <= 0)

        return;



    start = start_of_cluster(s, offset);

    last = start_of_cluster(s, offset + size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k < 0) {

            fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",

                cluster_offset);

            res->corruptions++;

        } else if (k >= refcount_table_size) {

            fprintf(stderr, "Warning: cluster offset=0x%" PRIx64 " is after "

                "the end of the image file, can't properly check refcounts.\n",

                cluster_offset);

            res->check_errors++;

        } else {

            if (++refcount_table[k] == 0) {

                fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

                res->corruptions++;

            }

        }

    }

}

static void inc_refcounts(BlockDriverState *bs,

                          BdrvCheckResult *res,

                          uint16_t *refcount_table,

                          int refcount_table_size,

                          int64_t offset, int64_t size)

{

    BDRVQcowState *s = bs->opaque;

    int64_t start, last, cluster_offset;

    int k;



    if (size <= 0)

        return;



    start = start_of_cluster(s, offset);

    last = start_of_cluster(s, offset + size - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        k = cluster_offset >> s->cluster_bits;

        if (k < 0) {

            fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",

                cluster_offset);

            res->corruptions++;

        } else if (k >= refcount_table_size) {

            fprintf(stderr, "Warning: cluster offset=0x%" PRIx64 " is after "

                "the end of the image file, can't properly check refcounts.\n",

                cluster_offset);

            res->check_errors++;

        } else {

            if (++refcount_table[k] == 0) {

                fprintf(stderr, "ERROR: overflow cluster offset=0x%" PRIx64

                    "\n", cluster_offset);

                res->corruptions++;

            }

        }

    }

}

    int64_t start, last, cluster_offset;     int k;         if (k < 0) {             fprintf(stderr, "ERROR: invalid cluster offset=0x%" PRIx64 "\n",                 cluster_offset);             res->corruptions++;         } else if (k >= refcount_table_size) {
static void FUNC_0(BlockDriverState *VAR_0,

                          BdrvCheckResult *VAR_1,

                          uint16_t *VAR_2,

                          int VAR_3,

                          int64_t VAR_4, int64_t VAR_5)

{

    BDRVQcowState *s = VAR_0->opaque;

    int64_t start, last, cluster_offset;

    int VAR_6;



    if (VAR_5 <= 0)

        return;



    start = start_of_cluster(s, VAR_4);

    last = start_of_cluster(s, VAR_4 + VAR_5 - 1);

    for(cluster_offset = start; cluster_offset <= last;

        cluster_offset += s->cluster_size) {

        VAR_6 = cluster_offset >> s->cluster_bits;

        if (VAR_6 < 0) {

            fprintf(stderr, "ERROR: invalid cluster VAR_4=0x%" PRIx64 "\n",

                cluster_offset);

            VAR_1->corruptions++;

        } else if (VAR_6 >= VAR_3) {

            fprintf(stderr, "Warning: cluster VAR_4=0x%" PRIx64 " is after "

                "the end of the image file, can't properly check refcounts.\n",

                cluster_offset);

            VAR_1->check_errors++;

        } else {

            if (++VAR_2[VAR_6] == 0) {

                fprintf(stderr, "ERROR: overflow cluster VAR_4=0x%" PRIx64

                    "\n", cluster_offset);

                VAR_1->corruptions++;

            }

        }

    }

}

static void FUNC_0(BlockDriverState *VAR_0,
BdrvCheckResult *VAR_1,
uint16_t *VAR_2,
int VAR_3,
int64_t VAR_4, int64_t VAR_5)
{ BDRVQcowState *s = VAR_0->opaque; int64_t start, last, cluster_offset; int VAR_6; if (VAR_5 <= 0)
return; start = start_of_cluster(s, VAR_4); last = start_of_cluster(s, VAR_4 + VAR_5 - 1); for(cluster_offset = start; cluster_offset <= last; cluster_offset += s->cluster_size) { VAR_6 = cluster_offset >> s->cluster_bits; if (VAR_6 < 0) { fprintf(stderr, "ERROR: invalid cluster VAR_4=0x%" PRIx64 "\n",
cluster_offset); VAR_1->corruptions++; } else if (VAR_6 >= VAR_3) { fprintf(stderr, "Warning: cluster VAR_4=0x%" PRIx64 " is after "
"the end of the image file, can't properly check refcounts.\n",
cluster_offset); VAR_1->check_errors++; } else { if (++VAR_2[VAR_6] == 0) { fprintf(stderr, "ERROR: overflow cluster VAR_4=0x%" PRIx64
"\n", cluster_offset); VAR_1->corruptions++; } } } }