static int count_contiguous_clusters_unallocated(int nb_clusters,

                                                 uint64_t *l2_table,

                                                 QCow2ClusterType wanted_type)

{

    int i;



    assert(wanted_type == QCOW2_CLUSTER_ZERO ||

           wanted_type == QCOW2_CLUSTER_UNALLOCATED);

    for (i = 0; i < nb_clusters; i++) {

        uint64_t entry = be64_to_cpu(l2_table[i]);

        QCow2ClusterType type = qcow2_get_cluster_type(entry);



        if (type != wanted_type || entry & L2E_OFFSET_MASK) {

            break;

        }

    }



    return i;

}

static int count_contiguous_clusters_unallocated(int nb_clusters,

                                                 uint64_t *l2_table,

                                                 QCow2ClusterType wanted_type)

{

    int i;



    assert(wanted_type == QCOW2_CLUSTER_ZERO ||

           wanted_type == QCOW2_CLUSTER_UNALLOCATED);

    for (i = 0; i < nb_clusters; i++) {

        uint64_t entry = be64_to_cpu(l2_table[i]);

        QCow2ClusterType type = qcow2_get_cluster_type(entry);



        if (type != wanted_type || entry & L2E_OFFSET_MASK) {

            break;

        }

    }



    return i;

}

static int FUNC_0(int VAR_0,

                                                 uint64_t *VAR_1,

                                                 QCow2ClusterType VAR_2)

{

    int VAR_3;



    assert(VAR_2 == QCOW2_CLUSTER_ZERO ||

           VAR_2 == QCOW2_CLUSTER_UNALLOCATED);

    for (VAR_3 = 0; VAR_3 < VAR_0; VAR_3++) {

        uint64_t entry = be64_to_cpu(VAR_1[VAR_3]);

        QCow2ClusterType type = qcow2_get_cluster_type(entry);



        if (type != VAR_2 || entry & L2E_OFFSET_MASK) {

            break;

        }

    }



    return VAR_3;

}

static int FUNC_0(int VAR_0,
uint64_t *VAR_1,
QCow2ClusterType VAR_2)
{ int VAR_3; assert(VAR_2 == QCOW2_CLUSTER_ZERO ||
VAR_2 == QCOW2_CLUSTER_UNALLOCATED); for (VAR_3 = 0; VAR_3 < VAR_0; VAR_3++) { uint64_t entry = be64_to_cpu(VAR_1[VAR_3]); QCow2ClusterType type = qcow2_get_cluster_type(entry); if (type != VAR_2 || entry & L2E_OFFSET_MASK) { break; } } return VAR_3; }