_Z31check_communities_are_connectedPK8igraph_tPK19igraph_vector_int_t:
   25|  7.08k|void check_communities_are_connected(const igraph_t *graph, const igraph_vector_int_t *membership) {
   26|  7.08k|    const igraph_int_t vcount = igraph_vcount(graph);
   27|  7.08k|    igraph_vector_int_t memb;
   28|  7.08k|    igraph_vector_int_list_t communities;
   29|  7.08k|    igraph_int_t no;
   30|       |
   31|  7.08k|    igraph_vector_int_init_copy(&memb, membership);
   32|  7.08k|    igraph_reindex_membership(&memb, NULL, &no);
   33|       |
   34|  7.08k|    igraph_vector_int_list_init(&communities, no);
   35|   317k|    for (igraph_int_t v=0; v < vcount; v++) {
  ------------------
  |  Branch (35:28): [True: 309k, False: 7.08k]
  ------------------
   36|   309k|        igraph_vector_int_push_back(igraph_vector_int_list_get_ptr(&communities, VECTOR(memb)[v]), v);
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   37|   309k|    }
   38|       |
   39|   310k|    for (igraph_int_t c=0; c < no; c++) {
  ------------------
  |  Branch (39:28): [True: 302k, False: 7.08k]
  ------------------
   40|   302k|        igraph_t subgraph;
   41|   302k|        igraph_bool_t connected;
   42|       |
   43|   302k|        igraph_induced_subgraph(graph, &subgraph,
   44|   302k|                                igraph_vss_vector(igraph_vector_int_list_get_ptr(&communities, c)),
   45|   302k|                                IGRAPH_SUBGRAPH_AUTO);
   46|   302k|        igraph_is_connected(&subgraph, &connected, IGRAPH_WEAK);
   47|   302k|        IGRAPH_ASSERT(connected);
  ------------------
  |  |  924|   302k|    do { \
  |  |  925|   302k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  ------------------
  |  |  |  |  401|       |#  define IGRAPH_FILE_BASENAME __FILE__
  |  |  ------------------
  |  |  927|      0|        } \
  |  |  928|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
   48|   302k|        igraph_destroy(&subgraph);
   49|   302k|    }
   50|       |
   51|  7.08k|    igraph_vector_int_list_destroy(&communities);
   52|  7.08k|    igraph_vector_int_destroy(&memb);
   53|  7.08k|}
LLVMFuzzerTestOneInput:
   55|  3.58k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   56|  3.58k|    igraph_t graph;
   57|  3.58k|    igraph_vector_int_t edges;
   58|  3.58k|    igraph_vector_t weights;
   59|       |
   60|  3.58k|    igraph_set_warning_handler(igraph_warning_handler_ignore);
   61|       |
   62|  3.58k|    if (Size % 3 == 0 || Size % 3 == 2 || Size > (3 * 256) + 1 || Size < 1) {
  ------------------
  |  Branch (62:9): [True: 1, False: 3.58k]
  |  Branch (62:26): [True: 1, False: 3.58k]
  |  Branch (62:43): [True: 13, False: 3.56k]
  |  Branch (62:67): [True: 0, False: 3.56k]
  ------------------
   63|     15|        return 0;
   64|     15|    }
   65|       |
   66|  3.56k|    igraph_vector_int_init(&edges, ((Size-1) / 3) * 2);
   67|  3.56k|    igraph_vector_init(&weights, (Size-1) / 3);
   68|  99.6k|    for (size_t i=0; i < ((Size-1) / 3); ++i) {
  ------------------
  |  Branch (68:22): [True: 96.0k, False: 3.56k]
  ------------------
   69|  96.0k|        VECTOR(edges)[i * 2] = Data[i * 3 + 1];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   70|  96.0k|        VECTOR(edges)[i * 2 + 1] = Data[i * 3 + 2];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   71|       |        // We keep the weights strictly positive, as this is required by some algorithms.
   72|  96.0k|        VECTOR(weights)[i] = ((double) Data[i * 3 + 3] + 1.0) / 105.0;
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   73|  96.0k|    }
   74|       |
   75|       |    // Turn on attribute handling.
   76|  3.56k|    igraph_set_attribute_table(&igraph_cattribute_table);
   77|       |
   78|  3.56k|    igraph_rng_seed(igraph_rng_default(), 42);
   79|       |
   80|  3.56k|    if (igraph_create(&graph, &edges, Data[0], IGRAPH_DIRECTED) == IGRAPH_SUCCESS) {
  ------------------
  |  Branch (80:9): [True: 3.56k, False: 0]
  ------------------
   81|  3.56k|        igraph_matrix_int_t merges, im;
   82|  3.56k|        igraph_matrix_t mat;
   83|  3.56k|        igraph_vector_int_t membership, membership2, iv, iv2;
   84|  3.56k|        igraph_vector_t mv, v;
   85|  3.56k|        igraph_real_t m, r;
   86|  3.56k|        igraph_int_t i;
   87|  3.56k|        igraph_bool_t b;
   88|       |
   89|       |        /* Limit graph size for the sake of performance. */
   90|  3.56k|        if (igraph_vcount(&graph) <= 64) {
  ------------------
  |  Branch (90:13): [True: 3.54k, False: 27]
  ------------------
   91|  3.54k|            igraph_attribute_combination_t comb;
   92|       |
   93|  3.54k|            igraph_matrix_int_init(&merges, 0, 0);
   94|  3.54k|            igraph_matrix_int_init(&im, 0, 0);
   95|  3.54k|            igraph_matrix_init(&mat, 0, 0);
   96|  3.54k|            igraph_vector_int_init(&membership, 0);
   97|  3.54k|            igraph_vector_int_init(&membership2, 0);
   98|  3.54k|            igraph_vector_int_init(&iv, 0);
   99|  3.54k|            igraph_vector_int_init(&iv2, 0);
  100|  3.54k|            igraph_vector_init(&mv, 0);
  101|  3.54k|            igraph_vector_init(&v, 0);
  102|       |
  103|  3.54k|            SETEANV(&graph, "weight", &weights);
  ------------------
  |  |  846|  3.54k|#define SETEANV(graph,n,v) (igraph_cattribute_EAN_setv((graph),(n),(v)))
  ------------------
  104|       |
  105|       |            // Currently "strength" is used only used as a vertex attribute to exercise the
  106|       |            // attribute handling code durig vertex contraction, which is convenient to do
  107|       |            // using the output from community detection. It is not used as input to any
  108|       |            // community detection methods.
  109|  3.54k|            igraph_strength(&graph, &v, igraph_vss_all(), IGRAPH_OUT, IGRAPH_LOOPS, &weights);
  110|  3.54k|            SETVANV(&graph, "strength", &v);
  ------------------
  |  |  814|  3.54k|#define SETVANV(graph,n,v) (igraph_cattribute_VAN_setv((graph),(n),(v)))
  ------------------
  111|       |
  112|  3.54k|            igraph_attribute_combination(&comb,
  113|  3.54k|                                         "weight", IGRAPH_ATTRIBUTE_COMBINE_SUM,
  114|  3.54k|                                         "strength", IGRAPH_ATTRIBUTE_COMBINE_MAX,
  115|  3.54k|                                         IGRAPH_NO_MORE_ATTRIBUTES);
  ------------------
  |  |  214|  3.54k|#define IGRAPH_NO_MORE_ATTRIBUTES ((const char*)0)
  ------------------
  116|       |
  117|       |            // Ignore edge directions in label propagation for now, as on some weighted graphs the
  118|       |            // algorithm seems to never complete. See https://github.com/igraph/igraph/issues/2561
  119|  3.54k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_ALL, &weights, NULL, NULL, IGRAPH_LPA_FAST);
  120|  3.54k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_ALL, &weights, NULL, NULL, IGRAPH_LPA_RETENTION);
  121|  3.54k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_ALL, &weights, NULL, NULL, IGRAPH_LPA_DOMINANCE);
  122|       |
  123|  3.54k|            igraph_community_walktrap(&graph, &weights, 3, &merges, &mv, &membership);
  124|  3.54k|            igraph_community_edge_betweenness(&graph, &iv, &v, &merges, &iv2, &mv, &membership2, IGRAPH_DIRECTED, &weights, NULL);
  125|       |
  126|  3.54k|            igraph_community_leiden(&graph, &weights, NULL, NULL, 1.5, 0.01, false, 2, &membership, &i, &r);
  127|  3.54k|            check_communities_are_connected(&graph, &membership);
  128|       |
  129|       |            // Take the opportunity to run functions that can use the output of community detection,
  130|       |            // potentially with weights.
  131|       |
  132|  3.54k|            {
  133|  3.54k|                igraph_community_comparison_t method[] = {
  134|  3.54k|                    IGRAPH_COMMCMP_VI,
  135|  3.54k|                    IGRAPH_COMMCMP_NMI,
  136|  3.54k|                    IGRAPH_COMMCMP_SPLIT_JOIN,
  137|  3.54k|                    IGRAPH_COMMCMP_RAND,
  138|  3.54k|                    IGRAPH_COMMCMP_ADJUSTED_RAND
  139|  3.54k|                };
  140|  21.2k|                for (size_t i=0; i < sizeof(method) / sizeof(method[0]); i++) {
  ------------------
  |  Branch (140:34): [True: 17.7k, False: 3.54k]
  ------------------
  141|  17.7k|                    if ((method[i] == IGRAPH_COMMCMP_RAND ||
  ------------------
  |  Branch (141:26): [True: 3.54k, False: 14.1k]
  ------------------
  142|  14.1k|                         method[i] == IGRAPH_COMMCMP_ADJUSTED_RAND) &&
  ------------------
  |  Branch (142:26): [True: 3.54k, False: 10.6k]
  ------------------
  143|  7.08k|                        igraph_vcount(&graph) < 2) {
  ------------------
  |  Branch (143:25): [True: 38, False: 7.04k]
  ------------------
  144|     38|                        continue;
  145|     38|                    }
  146|  17.6k|                    igraph_compare_communities(&membership, &membership2, &r, method[i]);
  147|  17.6k|                }
  148|  3.54k|            }
  149|       |
  150|  3.54k|            {
  151|  3.54k|                igraph_t graph2;
  152|  3.54k|                igraph_copy(&graph2, &graph);
  153|  3.54k|                igraph_contract_vertices(&graph2, &membership, &comb);
  154|  3.54k|                igraph_destroy(&graph2);
  155|  3.54k|            }
  156|       |
  157|  3.54k|            igraph_modularity(&graph, &membership, &weights, 1.5, IGRAPH_UNDIRECTED, &m);
  158|  3.54k|            igraph_modularity_matrix(&graph, &weights, 0.75, &mat, IGRAPH_DIRECTED);
  159|       |
  160|       |            // NOTE: Currently Infomap dominates this fuzz target due to being
  161|       |            // slower and more complex than the other algorithms.
  162|       |            // TODO: Currently disabled because of extremely bad performance.
  163|       |            // igraph_community_infomap(&graph, &weights, NULL, 1, &membership, &r);
  164|       |
  165|  3.54k|            igraph_simplify(&graph, true, true, &comb);
  166|  3.54k|            EANV(&graph, "weight", &weights);
  ------------------
  |  |  669|  3.54k|#define EANV(graph,n,vec) (igraph_cattribute_EANV((graph),(n), \
  |  |  670|  3.54k|                           igraph_ess_all(IGRAPH_EDGEORDER_ID), (vec)))
  ------------------
  167|       |
  168|       |            // Compute 'length' vector for community_voronoi()
  169|  3.54k|            igraph_vector_update(&v, &weights);
  170|  60.9k|            for (igraph_int_t i=0; i < igraph_vector_size(&v); i++) {
  ------------------
  |  Branch (170:36): [True: 57.3k, False: 3.54k]
  ------------------
  171|  57.3k|                VECTOR(v)[i] = 1 / (1 + VECTOR(v)[i]);
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(v)[i] = 1 / (1 + VECTOR(v)[i]);
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  172|  57.3k|            }
  173|  3.54k|            igraph_community_voronoi(&graph, &membership, &iv, &m, &v, &weights, IGRAPH_OUT, 1.0);
  174|       |
  175|  3.54k|            igraph_to_undirected(&graph, IGRAPH_TO_UNDIRECTED_COLLAPSE, &comb);
  176|  3.54k|            EANV(&graph, "weight", &weights);
  ------------------
  |  |  669|  3.54k|#define EANV(graph,n,vec) (igraph_cattribute_EANV((graph),(n), \
  |  |  670|  3.54k|                           igraph_ess_all(IGRAPH_EDGEORDER_ID), (vec)))
  ------------------
  177|       |
  178|  3.54k|            igraph_community_fastgreedy(&graph, &weights, &merges, &mv, &membership);
  179|       |
  180|  3.54k|            igraph_community_leiden(&graph, &weights, NULL, NULL, 1.5, 0.01, false, 2, &membership, &i, &r);
  181|  3.54k|            check_communities_are_connected(&graph, &membership);
  182|       |
  183|  3.54k|            igraph_community_multilevel(&graph, &weights, 0.8, &membership, &im, &mv);
  184|       |
  185|       |            // community_spinglass() only works on connected graphs
  186|  3.54k|            igraph_is_connected(&graph, &b, IGRAPH_WEAK);
  187|  3.54k|            if (b) {
  ------------------
  |  Branch (187:17): [True: 533, False: 3.00k]
  ------------------
  188|    533|                igraph_community_spinglass(&graph, &weights, &r, NULL, &membership, NULL, 10, false, 1.0, 0.01, 0.99, IGRAPH_SPINCOMM_UPDATE_CONFIG, 1.0, IGRAPH_SPINCOMM_IMP_ORIG, 1.0);
  189|    533|            }
  190|       |
  191|  3.54k|            DELALL(&graph);
  ------------------
  |  |  927|  3.54k|#define DELALL(graph) (igraph_cattribute_remove_all((graph),1,1,1))
  ------------------
  192|       |
  193|  3.54k|            igraph_attribute_combination_destroy(&comb);
  194|       |
  195|  3.54k|            igraph_vector_destroy(&v);
  196|  3.54k|            igraph_vector_destroy(&mv);
  197|  3.54k|            igraph_vector_int_destroy(&iv2);
  198|  3.54k|            igraph_vector_int_destroy(&iv);
  199|  3.54k|            igraph_vector_int_destroy(&membership2);
  200|  3.54k|            igraph_vector_int_destroy(&membership);
  201|  3.54k|            igraph_matrix_destroy(&mat);
  202|  3.54k|            igraph_matrix_int_destroy(&im);
  203|  3.54k|            igraph_matrix_int_destroy(&merges);
  204|  3.54k|        }
  205|       |
  206|  3.56k|        igraph_destroy(&graph);
  207|  3.56k|    }
  208|       |
  209|  3.56k|    igraph_vector_int_destroy(&edges);
  210|  3.56k|    igraph_vector_destroy(&weights);
  211|       |
  212|  3.56k|    IGRAPH_ASSERT(IGRAPH_FINALLY_STACK_EMPTY);
  ------------------
  |  |  924|  3.56k|    do { \
  |  |  925|  3.56k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.56k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  ------------------
  |  |  |  |  401|       |#  define IGRAPH_FILE_BASENAME __FILE__
  |  |  ------------------
  |  |  927|      0|        } \
  |  |  928|  3.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.56k]
  |  |  ------------------
  ------------------
  213|       |
  214|  3.56k|    return 0;  // Non-zero return values are reserved for future use.
  215|  3.56k|}

igraph_community_to_membership:
  109|  7.08k|                                   igraph_vector_int_t *csize) {
  110|       |
  111|  7.08k|    const igraph_int_t no_of_nodes = nodes;
  112|  7.08k|    const igraph_int_t components = no_of_nodes - steps;
  113|  7.08k|    igraph_int_t found = 0;
  114|  7.08k|    igraph_vector_int_t tmp;
  115|  7.08k|    igraph_vector_bool_t already_merged;
  116|  7.08k|    igraph_vector_int_t own_membership;
  117|  7.08k|    igraph_bool_t using_own_membership = false;
  118|       |
  119|  7.08k|    if (steps > igraph_matrix_int_nrow(merges)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 7.08k]
  ------------------
  120|      0|        IGRAPH_ERRORF("Number of steps is greater than number of rows in merges matrix: found %"
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  121|      0|                      IGRAPH_PRId " steps, %" IGRAPH_PRId " rows.", IGRAPH_EINVAL, steps, igraph_matrix_int_nrow(merges));
  122|      0|    }
  123|       |
  124|  7.08k|    if (igraph_matrix_int_ncol(merges) != 2) {
  ------------------
  |  Branch (124:9): [True: 0, False: 7.08k]
  ------------------
  125|      0|        IGRAPH_ERRORF("The merges matrix should have two columns, but has %" IGRAPH_PRId ".",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  126|      0|                      IGRAPH_EINVAL, igraph_matrix_int_ncol(merges));
  127|      0|    }
  128|  7.08k|    if (steps < 0) {
  ------------------
  |  Branch (128:9): [True: 0, False: 7.08k]
  ------------------
  129|      0|        IGRAPH_ERRORF("Number of steps should be non-negative, found %" IGRAPH_PRId ".", IGRAPH_EINVAL, steps);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  130|      0|    }
  131|       |
  132|  7.08k|    if (csize != NULL && membership == NULL) {
  ------------------
  |  Branch (132:9): [True: 0, False: 7.08k]
  |  Branch (132:26): [True: 0, False: 0]
  ------------------
  133|       |        /* we need a membership vector to calculate 'csize' but the user did
  134|       |         * not provide one; let's allocate one ourselves */
  135|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&own_membership, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|        using_own_membership = true;
  137|      0|        membership = &own_membership;
  138|      0|    }
  139|       |
  140|  7.08k|    if (membership) {
  ------------------
  |  Branch (140:9): [True: 7.08k, False: 0]
  ------------------
  141|  7.08k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  142|  7.08k|        igraph_vector_int_null(membership);
  143|  7.08k|    }
  144|  7.08k|    if (csize) {
  ------------------
  |  Branch (144:9): [True: 0, False: 7.08k]
  ------------------
  145|      0|        IGRAPH_CHECK(igraph_vector_int_resize(csize, components));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  146|      0|        igraph_vector_int_null(csize);
  147|      0|    }
  148|       |
  149|  7.08k|    IGRAPH_VECTOR_BOOL_INIT_FINALLY(&already_merged, steps + no_of_nodes);
  ------------------
  |  |  109|  7.08k|    do { IGRAPH_CHECK(igraph_vector_bool_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.08k|        IGRAPH_FINALLY(igraph_vector_bool_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (110:65): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  150|  7.08k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&tmp, steps);
  ------------------
  |  |  119|  7.08k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  151|       |
  152|  78.3k|    for (igraph_int_t i = steps - 1; i >= 0; i--) {
  ------------------
  |  Branch (152:38): [True: 71.2k, False: 7.08k]
  ------------------
  153|  71.2k|        const igraph_int_t c1 = MATRIX(*merges, i, 0);
  ------------------
  |  |   83|  71.2k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  154|  71.2k|        const igraph_int_t c2 = MATRIX(*merges, i, 1);
  ------------------
  |  |   83|  71.2k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  155|       |
  156|  71.2k|        if (VECTOR(already_merged)[c1] == 0) {
  ------------------
  |  |   60|  71.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (156:13): [True: 71.2k, False: 0]
  ------------------
  157|  71.2k|            VECTOR(already_merged)[c1] = true;
  ------------------
  |  |   60|  71.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|  71.2k|        } else {
  159|      0|            IGRAPH_ERRORF("Merges matrix contains multiple merges of cluster %" IGRAPH_PRId ".", IGRAPH_EINVAL, c1);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  160|      0|        }
  161|  71.2k|        if (VECTOR(already_merged)[c2] == 0) {
  ------------------
  |  |   60|  71.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (161:13): [True: 71.2k, False: 0]
  ------------------
  162|  71.2k|            VECTOR(already_merged)[c2] = true;
  ------------------
  |  |   60|  71.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  163|  71.2k|        } else {
  164|      0|            IGRAPH_ERRORF("Merges matrix contains multiple merges of cluster %" IGRAPH_PRId ".", IGRAPH_EINVAL, c2);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  165|      0|        }
  166|       |
  167|       |        /* new component? */
  168|  71.2k|        if (VECTOR(tmp)[i] == 0) {
  ------------------
  |  |   60|  71.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (168:13): [True: 22.3k, False: 48.9k]
  ------------------
  169|  22.3k|            found++;
  170|  22.3k|            VECTOR(tmp)[i] = found;
  ------------------
  |  |   60|  22.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  171|  22.3k|        }
  172|       |
  173|  71.2k|        if (c1 < no_of_nodes) {
  ------------------
  |  Branch (173:13): [True: 52.9k, False: 18.3k]
  ------------------
  174|  52.9k|            const igraph_int_t cid = VECTOR(tmp)[i] - 1;
  ------------------
  |  |   60|  52.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  175|  52.9k|            if (membership) {
  ------------------
  |  Branch (175:17): [True: 52.9k, False: 0]
  ------------------
  176|  52.9k|                VECTOR(*membership)[c1] = cid + 1;
  ------------------
  |  |   60|  52.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  177|  52.9k|            }
  178|  52.9k|            if (csize) {
  ------------------
  |  Branch (178:17): [True: 0, False: 52.9k]
  ------------------
  179|      0|                VECTOR(*csize)[cid] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|      0|            }
  181|  52.9k|        } else {
  182|  18.3k|            VECTOR(tmp)[c1 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  18.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(tmp)[c1 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  18.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  183|  18.3k|        }
  184|       |
  185|  71.2k|        if (c2 < no_of_nodes) {
  ------------------
  |  Branch (185:13): [True: 40.6k, False: 30.6k]
  ------------------
  186|  40.6k|            const igraph_int_t cid = VECTOR(tmp)[i] - 1;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  187|  40.6k|            if (membership) {
  ------------------
  |  Branch (187:17): [True: 40.6k, False: 0]
  ------------------
  188|  40.6k|                VECTOR(*membership)[c2] = cid + 1;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|  40.6k|            }
  190|  40.6k|            if (csize) {
  ------------------
  |  Branch (190:17): [True: 0, False: 40.6k]
  ------------------
  191|      0|                VECTOR(*csize)[cid] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  192|      0|            }
  193|  40.6k|        } else {
  194|  30.6k|            VECTOR(tmp)[c2 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  30.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(tmp)[c2 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  30.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  195|  30.6k|        }
  196|       |
  197|  71.2k|    }
  198|       |
  199|  7.08k|    if (membership || csize) {
  ------------------
  |  Branch (199:9): [True: 7.08k, False: 0]
  |  Branch (199:23): [True: 0, False: 0]
  ------------------
  200|       |        /* It can never happen that csize != NULL and membership == NULL; we have
  201|       |         * handled that case above. Thus we skip if (membership) checks, which
  202|       |         * would confuse static analysers in this context. */
  203|   317k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (203:34): [True: 309k, False: 7.08k]
  ------------------
  204|   309k|            const igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  205|   309k|            if (c != 0) {
  ------------------
  |  Branch (205:17): [True: 93.5k, False: 216k]
  ------------------
  206|  93.5k|                VECTOR(*membership)[i] = c - 1;
  ------------------
  |  |   60|  93.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  207|   216k|            } else {
  208|   216k|                if (csize) {
  ------------------
  |  Branch (208:21): [True: 0, False: 216k]
  ------------------
  209|      0|                    VECTOR(*csize)[found] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  210|      0|                }
  211|   216k|                VECTOR(*membership)[i] = found;
  ------------------
  |  |   60|   216k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  212|   216k|                found++;
  213|   216k|            }
  214|   309k|        }
  215|  7.08k|    }
  216|       |
  217|  7.08k|    igraph_vector_int_destroy(&tmp);
  218|  7.08k|    igraph_vector_bool_destroy(&already_merged);
  219|  7.08k|    IGRAPH_FINALLY_CLEAN(2);
  220|       |
  221|  7.08k|    if (using_own_membership) {
  ------------------
  |  Branch (221:9): [True: 0, False: 7.08k]
  ------------------
  222|      0|        igraph_vector_int_destroy(&own_membership);
  223|      0|        IGRAPH_FINALLY_CLEAN(1);
  224|      0|    }
  225|       |
  226|  7.08k|    return IGRAPH_SUCCESS;
  227|  7.08k|}
igraph_i_reindex_membership_large:
  245|  41.9k|        igraph_int_t *nb_clusters) {
  246|       |
  247|  41.9k|    const igraph_int_t vcount = igraph_vector_int_size(membership);
  248|  41.9k|    igraph_vector_int_t permutation;
  249|       |
  250|       |    /* The vcount == 0 case requires special handling because the main
  251|       |     * algorithm of this function cannot handle it. */
  252|  41.9k|    if (vcount == 0) {
  ------------------
  |  Branch (252:9): [True: 0, False: 41.9k]
  ------------------
  253|      0|        if (new_to_old) {
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  ------------------
  254|      0|            igraph_vector_int_clear(new_to_old);
  255|      0|        }
  256|      0|        if (nb_clusters) {
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            *nb_clusters = 0;
  258|      0|        }
  259|      0|        return IGRAPH_SUCCESS;
  260|      0|    }
  261|       |
  262|  41.9k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&permutation, vcount);
  ------------------
  |  |  119|  41.9k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  41.9k|    do { \
  |  |  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  41.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  41.9k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  41.9k|    do { \
  |  |  |  |  604|  41.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  41.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  41.9k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  41.9k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 41.9k]
  |  |  |  |  ------------------
  |  |  |  |  608|  41.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  41.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  263|       |
  264|  41.9k|    IGRAPH_CHECK(igraph_vector_int_sort_ind(membership, &permutation, IGRAPH_ASCENDING));
  ------------------
  |  |  656|  41.9k|    do { \
  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  265|       |
  266|  41.9k|    if (new_to_old) {
  ------------------
  |  Branch (266:9): [True: 0, False: 41.9k]
  ------------------
  267|      0|        igraph_vector_int_clear(new_to_old);
  268|      0|    }
  269|       |
  270|  41.9k|    igraph_int_t j = VECTOR(permutation)[0];
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  271|  41.9k|    igraph_int_t c_old = VECTOR(*membership)[j];
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  272|  41.9k|    igraph_int_t c_old_prev = c_old;
  273|  41.9k|    igraph_int_t c_new = 0;
  274|  41.9k|    if (new_to_old) {
  ------------------
  |  Branch (274:9): [True: 0, False: 41.9k]
  ------------------
  275|      0|        IGRAPH_CHECK(igraph_vector_int_push_back(new_to_old, c_old));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  276|      0|    }
  277|  41.9k|    VECTOR(*membership)[j] = c_new;
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  278|       |
  279|  2.34M|    for (igraph_int_t i=1; i < vcount; i++) {
  ------------------
  |  Branch (279:28): [True: 2.30M, False: 41.9k]
  ------------------
  280|  2.30M|        j = VECTOR(permutation)[i];
  ------------------
  |  |   60|  2.30M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  281|  2.30M|        c_old = VECTOR(*membership)[j];
  ------------------
  |  |   60|  2.30M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  282|  2.30M|        if (c_old != c_old_prev) {
  ------------------
  |  Branch (282:13): [True: 1.69M, False: 613k]
  ------------------
  283|  1.69M|            if (new_to_old) {
  ------------------
  |  Branch (283:17): [True: 0, False: 1.69M]
  ------------------
  284|      0|                IGRAPH_CHECK(igraph_vector_int_push_back(new_to_old, c_old));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  285|      0|            }
  286|  1.69M|            c_new++;
  287|  1.69M|        }
  288|  2.30M|        c_old_prev = c_old;
  289|  2.30M|        VECTOR(*membership)[j] = c_new;
  ------------------
  |  |   60|  2.30M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  290|  2.30M|    }
  291|       |
  292|  41.9k|    if (nb_clusters) {
  ------------------
  |  Branch (292:9): [True: 41.9k, False: 0]
  ------------------
  293|  41.9k|        *nb_clusters = c_new+1;
  294|  41.9k|    }
  295|       |
  296|  41.9k|    igraph_vector_int_destroy(&permutation);
  297|  41.9k|    IGRAPH_FINALLY_CLEAN(1);
  298|       |
  299|  41.9k|    return IGRAPH_SUCCESS;
  300|  41.9k|}
igraph_reindex_membership:
  329|  92.7k|        igraph_int_t *nb_clusters) {
  330|       |
  331|  92.7k|    const igraph_int_t vcount = igraph_vector_int_size(membership);
  332|  92.7k|    igraph_vector_int_t new_cluster;
  333|  92.7k|    igraph_int_t i_nb_clusters;
  334|       |
  335|       |    /* First, we assume cluster indices in the range 0..vcount-1,
  336|       |     * and attempt to use a performant implementation. If indices
  337|       |     * outside of this range are found, we will fall back to a
  338|       |     * slower alternative implementation. */
  339|  92.7k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&new_cluster, vcount);
  ------------------
  |  |  119|  92.7k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  92.7k|    do { \
  |  |  |  |  657|  92.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  92.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  92.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 92.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  92.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 92.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  92.7k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  92.7k|    do { \
  |  |  |  |  604|  92.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  92.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  92.7k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  92.7k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 92.7k]
  |  |  |  |  ------------------
  |  |  |  |  608|  92.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  92.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 92.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 92.7k]
  |  |  ------------------
  ------------------
  340|       |
  341|  92.7k|    if (new_to_old) {
  ------------------
  |  Branch (341:9): [True: 0, False: 92.7k]
  ------------------
  342|      0|        igraph_vector_int_clear(new_to_old);
  343|      0|    }
  344|       |
  345|       |    /* Clean clusters. We will store the new cluster + 1 so that membership == 0
  346|       |     * indicates that no cluster was assigned yet. */
  347|  92.7k|    i_nb_clusters = 1;
  348|  4.04M|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (348:30): [True: 3.95M, False: 92.7k]
  ------------------
  349|  3.95M|        igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|  3.95M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  350|       |
  351|  3.95M|        if (c < 0 || c >= vcount) {
  ------------------
  |  Branch (351:13): [True: 0, False: 3.95M]
  |  Branch (351:22): [True: 0, False: 3.95M]
  ------------------
  352|       |            /* Found cluster indices out of the 0..vcount-1 range.
  353|       |             * Use alternative implementation that supports these. */
  354|      0|            igraph_vector_int_destroy(&new_cluster);
  355|      0|            IGRAPH_FINALLY_CLEAN(1);
  356|      0|            return igraph_i_reindex_membership_large(membership, new_to_old, nb_clusters);
  357|      0|        }
  358|       |
  359|  3.95M|        if (VECTOR(new_cluster)[c] == 0) {
  ------------------
  |  |   60|  3.95M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (359:13): [True: 3.70M, False: 249k]
  ------------------
  360|  3.70M|            VECTOR(new_cluster)[c] = i_nb_clusters;
  ------------------
  |  |   60|  3.70M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  361|  3.70M|            i_nb_clusters += 1;
  362|  3.70M|            if (new_to_old) {
  ------------------
  |  Branch (362:17): [True: 0, False: 3.70M]
  ------------------
  363|      0|                IGRAPH_CHECK(igraph_vector_int_push_back(new_to_old, c));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  364|      0|            }
  365|  3.70M|        }
  366|  3.95M|    }
  367|       |
  368|       |    /* Assign new membership */
  369|  4.04M|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (369:30): [True: 3.95M, False: 92.7k]
  ------------------
  370|  3.95M|        igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|  3.95M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  371|  3.95M|        VECTOR(*membership)[i] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|  3.95M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*membership)[i] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|  3.95M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  372|  3.95M|    }
  373|       |
  374|  92.7k|    if (nb_clusters) {
  ------------------
  |  Branch (374:9): [True: 41.7k, False: 50.9k]
  ------------------
  375|       |        /* We used the cluster + 1, so correct */
  376|  41.7k|        *nb_clusters = i_nb_clusters - 1;
  377|  41.7k|    }
  378|       |
  379|  92.7k|    igraph_vector_int_destroy(&new_cluster);
  380|  92.7k|    IGRAPH_FINALLY_CLEAN(1);
  381|       |
  382|  92.7k|    return IGRAPH_SUCCESS;
  383|  92.7k|}
igraph_compare_communities:
  522|  17.6k|                               igraph_community_comparison_t method) {
  523|  17.6k|    igraph_vector_int_t c1, c2;
  524|       |
  525|  17.6k|    if (igraph_vector_int_size(comm1) != igraph_vector_int_size(comm2)) {
  ------------------
  |  Branch (525:9): [True: 0, False: 17.6k]
  ------------------
  526|      0|        IGRAPH_ERROR("Community membership vectors have different lengths.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  527|      0|    }
  528|       |
  529|       |    /* Copy and reindex membership vectors to make sure they are continuous */
  530|  17.6k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&c1, comm1));
  ------------------
  |  |  656|  17.6k|    do { \
  |  |  657|  17.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  531|  17.6k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &c1);
  ------------------
  |  |  603|  17.6k|    do { \
  |  |  604|  17.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  17.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  17.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  17.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 17.6k]
  |  |  ------------------
  |  |  608|  17.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  532|       |
  533|  17.6k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&c2, comm2));
  ------------------
  |  |  656|  17.6k|    do { \
  |  |  657|  17.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  534|  17.6k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &c2);
  ------------------
  |  |  603|  17.6k|    do { \
  |  |  604|  17.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  17.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  17.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  17.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 17.6k]
  |  |  ------------------
  |  |  608|  17.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  535|       |
  536|  17.6k|    IGRAPH_CHECK(igraph_reindex_membership(&c1, NULL, NULL));
  ------------------
  |  |  656|  17.6k|    do { \
  |  |  657|  17.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  537|  17.6k|    IGRAPH_CHECK(igraph_reindex_membership(&c2, NULL, NULL));
  ------------------
  |  |  656|  17.6k|    do { \
  |  |  657|  17.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  538|       |
  539|  17.6k|    switch (method) {
  540|  3.54k|    case IGRAPH_COMMCMP_VI:
  ------------------
  |  Branch (540:5): [True: 3.54k, False: 14.1k]
  ------------------
  541|  3.54k|        IGRAPH_CHECK(igraph_i_compare_communities_vi(&c1, &c2, result));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  542|  3.54k|        break;
  543|       |
  544|  3.54k|    case IGRAPH_COMMCMP_NMI:
  ------------------
  |  Branch (544:5): [True: 3.54k, False: 14.1k]
  ------------------
  545|  3.54k|        IGRAPH_CHECK(igraph_i_compare_communities_nmi(&c1, &c2, result));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  546|  3.54k|        break;
  547|       |
  548|  3.54k|    case IGRAPH_COMMCMP_SPLIT_JOIN: {
  ------------------
  |  Branch (548:5): [True: 3.54k, False: 14.1k]
  ------------------
  549|  3.54k|        igraph_int_t d12, d21;
  550|  3.54k|        IGRAPH_CHECK(igraph_i_split_join_distance(&c1, &c2, &d12, &d21));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  551|  3.54k|        *result = d12 + d21;
  552|  3.54k|    }
  553|      0|    break;
  554|       |
  555|  3.52k|    case IGRAPH_COMMCMP_RAND:
  ------------------
  |  Branch (555:5): [True: 3.52k, False: 14.1k]
  ------------------
  556|  7.04k|    case IGRAPH_COMMCMP_ADJUSTED_RAND:
  ------------------
  |  Branch (556:5): [True: 3.52k, False: 14.1k]
  ------------------
  557|  7.04k|        IGRAPH_CHECK(igraph_i_compare_communities_rand(&c1, &c2, result,
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  558|  7.04k|                     method == IGRAPH_COMMCMP_ADJUSTED_RAND));
  559|  7.04k|        break;
  560|       |
  561|  7.04k|    default:
  ------------------
  |  Branch (561:5): [True: 0, False: 17.6k]
  ------------------
  562|      0|        IGRAPH_ERROR("Unknown community comparison method.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  563|  17.6k|    }
  564|       |
  565|       |    /* Clean up everything */
  566|  17.6k|    igraph_vector_int_destroy(&c1);
  567|  17.6k|    igraph_vector_int_destroy(&c2);
  568|  17.6k|    IGRAPH_FINALLY_CLEAN(2);
  569|       |
  570|  17.6k|    return IGRAPH_SUCCESS;
  571|  17.6k|}
community_misc.c:igraph_i_compare_communities_nmi:
  759|  3.54k|                                     igraph_real_t* result) {
  760|  3.54k|    double h1, h2, mut_inf;
  761|       |
  762|  3.54k|    IGRAPH_CHECK(igraph_i_entropy_and_mutual_information(v1, v2, &h1, &h2, &mut_inf));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  763|       |
  764|  3.54k|    if (h1 == 0 && h2 == 0) {
  ------------------
  |  Branch (764:9): [True: 49, False: 3.49k]
  |  Branch (764:20): [True: 33, False: 16]
  ------------------
  765|     33|        *result = 1;
  766|  3.50k|    } else {
  767|  3.50k|        *result = 2 * mut_inf / (h1 + h2);
  768|  3.50k|    }
  769|       |
  770|  3.54k|    return IGRAPH_SUCCESS;
  771|  3.54k|}
community_misc.c:igraph_i_entropy_and_mutual_information:
  659|  7.08k|        const igraph_vector_int_t* v2, double* h1, double* h2, double* mut_inf) {
  660|  7.08k|    igraph_int_t i, n;
  661|  7.08k|    igraph_int_t k1;
  662|  7.08k|    igraph_int_t k2;
  663|  7.08k|    igraph_real_t *p1, *p2;
  664|  7.08k|    igraph_sparsemat_t m;
  665|  7.08k|    igraph_sparsemat_t mu; /* uncompressed */
  666|  7.08k|    igraph_sparsemat_iterator_t mit;
  667|       |
  668|  7.08k|    n = igraph_vector_int_size(v1);
  669|  7.08k|    if (n == 0) {
  ------------------
  |  Branch (669:9): [True: 2, False: 7.07k]
  ------------------
  670|      2|        *h1 = 0;
  671|      2|        *h2 = 0;
  672|      2|        *mut_inf = 0;
  673|      2|        return IGRAPH_SUCCESS;
  674|      2|    }
  675|  7.07k|    k1 = igraph_vector_int_max(v1) + 1;
  676|  7.07k|    k2 = igraph_vector_int_max(v2) + 1;
  677|  7.07k|    p1 = IGRAPH_CALLOC(k1, igraph_real_t);
  ------------------
  |  |   33|  7.07k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  14.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.07k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.07k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.07k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  678|  7.07k|    if (p1 == 0) {
  ------------------
  |  Branch (678:9): [True: 0, False: 7.07k]
  ------------------
  679|      0|        IGRAPH_ERROR("Insufficient memory for computing community entropy.", IGRAPH_ENOMEM);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  680|      0|    }
  681|  7.07k|    IGRAPH_FINALLY(igraph_free, p1);
  ------------------
  |  |  603|  7.07k|    do { \
  |  |  604|  7.07k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.07k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.07k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.07k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.07k]
  |  |  ------------------
  |  |  608|  7.07k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  682|  7.07k|    p2 = IGRAPH_CALLOC(k2, igraph_real_t);
  ------------------
  |  |   33|  7.07k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  14.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.07k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.07k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.07k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  683|  7.07k|    if (p2 == 0) {
  ------------------
  |  Branch (683:9): [True: 0, False: 7.07k]
  ------------------
  684|      0|        IGRAPH_ERROR("Insufficient memory for computing community entropy.", IGRAPH_ENOMEM);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  685|      0|    }
  686|  7.07k|    IGRAPH_FINALLY(igraph_free, p2);
  ------------------
  |  |  603|  7.07k|    do { \
  |  |  604|  7.07k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.07k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.07k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.07k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.07k]
  |  |  ------------------
  |  |  608|  7.07k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  687|       |
  688|       |    /* Calculate the entropy of v1 */
  689|  7.07k|    *h1 = 0.0;
  690|   317k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (690:17): [True: 309k, False: 7.07k]
  ------------------
  691|   309k|        p1[VECTOR(*v1)[i]]++;
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  692|   309k|    }
  693|   314k|    for (i = 0; i < k1; i++) {
  ------------------
  |  Branch (693:17): [True: 306k, False: 7.07k]
  ------------------
  694|   306k|        p1[i] /= n;
  695|   306k|        *h1 -= p1[i] * log(p1[i]);
  696|   306k|    }
  697|       |
  698|       |    /* Calculate the entropy of v2 */
  699|  7.07k|    *h2 = 0.0;
  700|   317k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (700:17): [True: 309k, False: 7.07k]
  ------------------
  701|   309k|        p2[VECTOR(*v2)[i]]++;
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  702|   309k|    }
  703|   262k|    for (i = 0; i < k2; i++) {
  ------------------
  |  Branch (703:17): [True: 255k, False: 7.07k]
  ------------------
  704|   255k|        p2[i] /= n;
  705|   255k|        *h2 -= p2[i] * log(p2[i]);
  706|   255k|    }
  707|       |
  708|       |    /* We will only need the logs of p1 and p2 from now on */
  709|   314k|    for (i = 0; i < k1; i++) {
  ------------------
  |  Branch (709:17): [True: 306k, False: 7.07k]
  ------------------
  710|   306k|        p1[i] = log(p1[i]);
  711|   306k|    }
  712|   262k|    for (i = 0; i < k2; i++) {
  ------------------
  |  Branch (712:17): [True: 255k, False: 7.07k]
  ------------------
  713|   255k|        p2[i] = log(p2[i]);
  714|   255k|    }
  715|       |
  716|       |    /* Calculate the mutual information of v1 and v2 */
  717|  7.07k|    *mut_inf = 0.0;
  718|  7.07k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, k1, k2, n));
  ------------------
  |  |  656|  7.07k|    do { \
  |  |  657|  7.07k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.07k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.07k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  719|  7.07k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  7.07k|    do { \
  |  |  604|  7.07k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.07k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.07k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.07k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.07k]
  |  |  ------------------
  |  |  608|  7.07k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  720|   317k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (720:17): [True: 309k, False: 7.07k]
  ------------------
  721|   309k|        IGRAPH_CHECK(igraph_sparsemat_entry(
  ------------------
  |  |  656|   309k|    do { \
  |  |  657|   309k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   309k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   309k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 309k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   309k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 309k]
  |  |  ------------------
  ------------------
  722|   309k|            &mu, VECTOR(*v1)[i],
  723|   309k|            VECTOR(*v2)[i], 1
  724|   309k|        ));
  725|   309k|    }
  726|       |
  727|  7.07k|    IGRAPH_CHECK(igraph_sparsemat_compress(&mu, &m));
  ------------------
  |  |  656|  7.07k|    do { \
  |  |  657|  7.07k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.07k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.07k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  728|  7.07k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  7.07k|    do { \
  |  |  604|  7.07k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.07k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.07k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.07k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.07k]
  |  |  ------------------
  |  |  608|  7.07k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  729|  7.07k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  7.07k|    do { \
  |  |  657|  7.07k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.07k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.07k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  730|       |
  731|  7.07k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  7.07k|    do { \
  |  |  657|  7.07k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.07k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.07k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
  732|   314k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (732:12): [True: 307k, False: 7.07k]
  ------------------
  733|   307k|        double p = igraph_sparsemat_iterator_get(&mit)/ n;
  734|   307k|        *mut_inf += p * (log(p) - p1[igraph_sparsemat_iterator_row(&mit)] - p2[igraph_sparsemat_iterator_col(&mit)]);
  735|   307k|        igraph_sparsemat_iterator_next(&mit);
  736|   307k|    }
  737|  7.07k|    igraph_sparsemat_destroy(&m);
  738|  7.07k|    igraph_sparsemat_destroy(&mu);
  739|  7.07k|    IGRAPH_FREE(p1); IGRAPH_FREE(p2);
  ------------------
  |  |   36|  7.07k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
                  IGRAPH_FREE(p1); IGRAPH_FREE(p2);
  ------------------
  |  |   36|  7.07k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  740|       |
  741|  7.07k|    IGRAPH_FINALLY_CLEAN(4);
  742|       |
  743|  7.07k|    return IGRAPH_SUCCESS;
  744|  7.07k|}
community_misc.c:igraph_i_compare_communities_vi:
  789|  3.54k|                                    igraph_real_t* result) {
  790|  3.54k|    double h1, h2, mut_inf;
  791|       |
  792|  3.54k|    IGRAPH_CHECK(igraph_i_entropy_and_mutual_information(v1, v2, &h1, &h2, &mut_inf));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  793|  3.54k|    *result = h1 + h2 - 2 * mut_inf;
  794|       |
  795|  3.54k|    return IGRAPH_SUCCESS;
  796|  3.54k|}
community_misc.c:igraph_i_split_join_distance:
  848|  3.54k|                                 igraph_int_t* distance12, igraph_int_t* distance21) {
  849|  3.54k|    igraph_int_t n = igraph_vector_int_size(v1);
  850|  3.54k|    igraph_vector_t rowmax, colmax;
  851|  3.54k|    igraph_sparsemat_t m;
  852|  3.54k|    igraph_sparsemat_t mu; /* uncompressed */
  853|  3.54k|    igraph_sparsemat_iterator_t mit;
  854|       |
  855|  3.54k|    if (n == 0) {
  ------------------
  |  Branch (855:9): [True: 1, False: 3.53k]
  ------------------
  856|      1|        *distance12 = 0;
  857|      1|        *distance21 = 0;
  858|      1|        return IGRAPH_SUCCESS;
  859|      1|    }
  860|       |    /* Calculate the confusion matrix */
  861|  3.53k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, 1, 1, 0));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  862|  3.53k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  3.53k|    do { \
  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  ------------------
  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  863|  3.53k|    IGRAPH_CHECK(igraph_i_confusion_matrix(v1, v2, &mu));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  864|       |
  865|       |    /* Initialize vectors that will store the row/columnwise maxima */
  866|  3.53k|    IGRAPH_VECTOR_INIT_FINALLY(&rowmax, igraph_sparsemat_nrow(&mu));
  ------------------
  |  |  104|  3.53k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.53k|    do { \
  |  |  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.53k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.53k|    do { \
  |  |  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  867|  3.53k|    IGRAPH_VECTOR_INIT_FINALLY(&colmax, igraph_sparsemat_ncol(&mu));
  ------------------
  |  |  104|  3.53k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.53k|    do { \
  |  |  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.53k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.53k|    do { \
  |  |  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  868|       |
  869|       |    /* Find the row/columnwise maxima */
  870|  3.53k|    igraph_sparsemat_compress(&mu, &m);
  871|  3.53k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  3.53k|    do { \
  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  ------------------
  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  872|  3.53k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  873|  3.53k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  874|   157k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (874:12): [True: 153k, False: 3.53k]
  ------------------
  875|   153k|        igraph_real_t value = igraph_sparsemat_iterator_get(&mit);
  876|   153k|        igraph_int_t row = igraph_sparsemat_iterator_row(&mit);
  877|   153k|        igraph_int_t col = igraph_sparsemat_iterator_col(&mit);
  878|   153k|        if (value > VECTOR(rowmax)[row]) {
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (878:13): [True: 153k, False: 148]
  ------------------
  879|   153k|            VECTOR(rowmax)[row] = value;
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  880|   153k|        }
  881|   153k|        if (value > VECTOR(colmax)[col]) {
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (881:13): [True: 127k, False: 25.7k]
  ------------------
  882|   127k|            VECTOR(colmax)[col] = value;
  ------------------
  |  |   60|   127k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  883|   127k|        }
  884|   153k|        igraph_sparsemat_iterator_next(&mit);
  885|   153k|    }
  886|       |
  887|       |    /* Calculate the distances */
  888|  3.53k|    *distance12 = (igraph_int_t) (n - igraph_vector_sum(&rowmax));
  889|  3.53k|    *distance21 = (igraph_int_t) (n - igraph_vector_sum(&colmax));
  890|       |
  891|  3.53k|    igraph_vector_destroy(&rowmax);
  892|  3.53k|    igraph_vector_destroy(&colmax);
  893|  3.53k|    igraph_sparsemat_destroy(&m);
  894|  3.53k|    igraph_sparsemat_destroy(&mu);
  895|  3.53k|    IGRAPH_FINALLY_CLEAN(4);
  896|       |
  897|  3.53k|    return IGRAPH_SUCCESS;
  898|  3.53k|}
community_misc.c:igraph_i_confusion_matrix:
  810|  10.5k|                              igraph_sparsemat_t *m) {
  811|  10.5k|    igraph_int_t k1, k2, i, n;
  812|       |
  813|  10.5k|    n = igraph_vector_int_size(v1);
  814|  10.5k|    if (n == 0) {
  ------------------
  |  Branch (814:9): [True: 0, False: 10.5k]
  ------------------
  815|      0|        IGRAPH_CHECK(igraph_sparsemat_resize(m, 0, 0, 0));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  816|      0|        return IGRAPH_SUCCESS;
  817|      0|    }
  818|       |
  819|  10.5k|    k1 = igraph_vector_int_max(v1) + 1;
  820|  10.5k|    k2 = igraph_vector_int_max(v2) + 1;
  821|  10.5k|    IGRAPH_CHECK(igraph_sparsemat_resize(m, k1, k2, n));
  ------------------
  |  |  656|  10.5k|    do { \
  |  |  657|  10.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  822|   475k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (822:17): [True: 464k, False: 10.5k]
  ------------------
  823|   464k|        IGRAPH_CHECK(igraph_sparsemat_entry(
  ------------------
  |  |  656|   464k|    do { \
  |  |  657|   464k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   464k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   464k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 464k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   464k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 464k]
  |  |  ------------------
  ------------------
  824|   464k|            m, VECTOR(*v1)[i], VECTOR(*v2)[i], 1
  825|   464k|        ));
  826|   464k|    }
  827|       |
  828|  10.5k|    return IGRAPH_SUCCESS;
  829|  10.5k|}
community_misc.c:igraph_i_compare_communities_rand:
  924|  7.04k|        igraph_real_t *result, igraph_bool_t adjust) {
  925|  7.04k|    igraph_sparsemat_t m;
  926|  7.04k|    igraph_sparsemat_t mu; /* uncompressed */
  927|  7.04k|    igraph_sparsemat_iterator_t mit;
  928|  7.04k|    igraph_vector_t rowsums, colsums;
  929|  7.04k|    igraph_int_t i, nrow, ncol;
  930|  7.04k|    igraph_real_t rand, n;
  931|  7.04k|    igraph_real_t frac_pairs_in_1, frac_pairs_in_2;
  932|       |
  933|  7.04k|    if (igraph_vector_int_size(v1) <= 1) {
  ------------------
  |  Branch (933:9): [True: 0, False: 7.04k]
  ------------------
  934|      0|        IGRAPH_ERRORF("Rand indices are not defined for zero or one vertex. "
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  935|      0|        "Found membership vector of size %" IGRAPH_PRId ".", IGRAPH_EINVAL, igraph_vector_int_size(v1));
  936|      0|    }
  937|       |
  938|       |    /* Calculate the confusion matrix */
  939|  7.04k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, 1, 1, 0));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  940|  7.04k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  7.04k|    do { \
  |  |  604|  7.04k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.04k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.04k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.04k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.04k]
  |  |  ------------------
  |  |  608|  7.04k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  941|  7.04k|    IGRAPH_CHECK(igraph_i_confusion_matrix(v1, v2, &mu));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  942|       |
  943|       |    /* The unadjusted Rand index is defined as (a+d) / (a+b+c+d), where:
  944|       |     *
  945|       |     * - a is the number of pairs in the same cluster both in v1 and v2. This
  946|       |     *   equals the sum of n(i,j) choose 2 for all i and j.
  947|       |     *
  948|       |     * - b is the number of pairs in the same cluster in v1 and in different
  949|       |     *   clusters in v2. This is sum n(i,*) choose 2 for all i minus a.
  950|       |     *   n(i,*) is the number of elements in cluster i in v1.
  951|       |     *
  952|       |     * - c is the number of pairs in the same cluster in v2 and in different
  953|       |     *   clusters in v1. This is sum n(*,j) choose 2 for all j minus a.
  954|       |     *   n(*,j) is the number of elements in cluster j in v2.
  955|       |     *
  956|       |     * - d is (n choose 2) - a - b - c.
  957|       |     *
  958|       |     * Therefore, a+d = (n choose 2) - b - c
  959|       |     *                = (n choose 2) - sum (n(i,*) choose 2)
  960|       |     *                               - sum (n(*,j) choose 2)
  961|       |     *                               + 2 * sum (n(i,j) choose 2).
  962|       |     *
  963|       |     * Since a+b+c+d = (n choose 2) and this goes in the denominator, we can
  964|       |     * just as well start dividing each term in a+d by (n choose 2), which
  965|       |     * yields:
  966|       |     *
  967|       |     * 1 - sum( n(i,*)/n * (n(i,*)-1)/(n-1) )
  968|       |     *   - sum( n(*,i)/n * (n(*,i)-1)/(n-1) )
  969|       |     *   + sum( n(i,j)/n * (n(i,j)-1)/(n-1) ) * 2
  970|       |     */
  971|       |
  972|       |    /* Calculate row and column sums */
  973|  7.04k|    nrow = igraph_sparsemat_nrow(&mu);
  974|  7.04k|    ncol = igraph_sparsemat_ncol(&mu);
  975|  7.04k|    n = igraph_vector_int_size(v1);
  976|  7.04k|    IGRAPH_VECTOR_INIT_FINALLY(&rowsums, nrow);
  ------------------
  |  |  104|  7.04k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.04k|    do { \
  |  |  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.04k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.04k|    do { \
  |  |  |  |  604|  7.04k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.04k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.04k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.04k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.04k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  977|  7.04k|    IGRAPH_VECTOR_INIT_FINALLY(&colsums, ncol);
  ------------------
  |  |  104|  7.04k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.04k|    do { \
  |  |  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.04k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.04k|    do { \
  |  |  |  |  604|  7.04k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.04k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.04k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.04k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.04k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.04k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  978|  7.04k|    IGRAPH_CHECK(igraph_sparsemat_rowsums(&mu, &rowsums));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  979|  7.04k|    IGRAPH_CHECK(igraph_sparsemat_colsums(&mu, &colsums));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  980|       |
  981|       |    /* Start calculating the unadjusted Rand index */
  982|  7.04k|    rand = 0.0;
  983|  7.04k|    igraph_sparsemat_compress(&mu, &m);
  984|  7.04k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  7.04k|    do { \
  |  |  604|  7.04k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.04k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.04k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.04k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.04k]
  |  |  ------------------
  |  |  608|  7.04k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  985|  7.04k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  986|       |
  987|  7.04k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
  988|   314k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (988:12): [True: 307k, False: 7.04k]
  ------------------
  989|   307k|        igraph_real_t value = igraph_sparsemat_iterator_get(&mit);
  990|   307k|        rand += (value / n) * (value - 1) / (n - 1);
  991|   307k|        igraph_sparsemat_iterator_next(&mit);
  992|   307k|    }
  993|       |
  994|  7.04k|    frac_pairs_in_1 = frac_pairs_in_2 = 0.0;
  995|   313k|    for (i = 0; i < nrow; i++) {
  ------------------
  |  Branch (995:17): [True: 306k, False: 7.04k]
  ------------------
  996|   306k|        frac_pairs_in_1 += (VECTOR(rowsums)[i] / n) * (VECTOR(rowsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   306k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      frac_pairs_in_1 += (VECTOR(rowsums)[i] / n) * (VECTOR(rowsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   306k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  997|   306k|    }
  998|   262k|    for (i = 0; i < ncol; i++) {
  ------------------
  |  Branch (998:17): [True: 255k, False: 7.04k]
  ------------------
  999|   255k|        frac_pairs_in_2 += (VECTOR(colsums)[i] / n) * (VECTOR(colsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   255k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      frac_pairs_in_2 += (VECTOR(colsums)[i] / n) * (VECTOR(colsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   255k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1000|   255k|    }
 1001|       |
 1002|  7.04k|    rand = 1.0 + 2 * rand - frac_pairs_in_1 - frac_pairs_in_2;
 1003|       |
 1004|  7.04k|    if (adjust) {
  ------------------
  |  Branch (1004:9): [True: 3.52k, False: 3.52k]
  ------------------
 1005|  3.52k|        double expected = frac_pairs_in_1 * frac_pairs_in_2 +
 1006|  3.52k|                          (1 - frac_pairs_in_1) * (1 - frac_pairs_in_2);
 1007|  3.52k|        rand = (rand - expected) / (1 - expected);
 1008|  3.52k|    }
 1009|       |
 1010|  7.04k|    igraph_vector_destroy(&rowsums);
 1011|  7.04k|    igraph_vector_destroy(&colsums);
 1012|  7.04k|    igraph_sparsemat_destroy(&m);
 1013|  7.04k|    igraph_sparsemat_destroy(&mu);
 1014|  7.04k|    IGRAPH_FINALLY_CLEAN(4);
 1015|       |
 1016|  7.04k|    *result = rand;
 1017|       |
 1018|  7.04k|    return IGRAPH_SUCCESS;
 1019|  7.04k|}

igraph_community_eb_get_merges:
  225|  3.54k|                                   igraph_vector_int_t *membership) {
  226|       |
  227|  3.54k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  228|  3.54k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  229|  3.54k|    igraph_vector_int_t ptr;
  230|  3.54k|    igraph_int_t midx = 0;
  231|  3.54k|    igraph_int_t no_comps;
  232|  3.54k|    const igraph_int_t no_removed_edges = igraph_vector_int_size(edges);
  233|  3.54k|    igraph_int_t max_merges;
  234|       |
  235|  3.54k|    if (! igraph_vector_int_isininterval(edges, 0, no_of_edges-1)) {
  ------------------
  |  Branch (235:9): [True: 0, False: 3.54k]
  ------------------
  236|      0|        IGRAPH_ERROR(
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  237|      0|            "Cannot calculate merges of edge betweenness community detection.",
  238|      0|            IGRAPH_EINVEID
  239|      0|        );
  240|      0|    }
  241|  3.54k|    if (no_removed_edges < no_of_edges) {
  ------------------
  |  Branch (241:9): [True: 0, False: 3.54k]
  ------------------
  242|      0|            IGRAPH_ERRORF("Number of removed edges (%" IGRAPH_PRId ") should be equal to "
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  243|      0|                    "number of edges in graph (%" IGRAPH_PRId ").", IGRAPH_EINVAL,
  244|      0|                    no_removed_edges, no_of_edges);
  245|      0|    }
  246|       |
  247|       |    /* catch null graph early */
  248|  3.54k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (248:9): [True: 1, False: 3.53k]
  ------------------
  249|      1|        if (res) {
  ------------------
  |  Branch (249:13): [True: 1, False: 0]
  ------------------
  250|      1|            IGRAPH_CHECK(igraph_matrix_int_resize(res, 0, 2));
  ------------------
  |  |  656|      1|    do { \
  |  |  657|      1|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      1|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      1|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  251|      1|        }
  252|      1|        if (bridges) {
  ------------------
  |  Branch (252:13): [True: 1, False: 0]
  ------------------
  253|      1|            igraph_vector_int_clear(bridges);
  254|      1|        }
  255|      1|        if (modularity) {
  ------------------
  |  Branch (255:13): [True: 1, False: 0]
  ------------------
  256|      1|            IGRAPH_CHECK(igraph_vector_resize(modularity, 1));
  ------------------
  |  |  656|      1|    do { \
  |  |  657|      1|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      1|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      1|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  257|      1|            VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |   60|      1|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |  138|      1|#define IGRAPH_NAN ((double)NAN)
  ------------------
  258|      1|        }
  259|      1|        if (membership) {
  ------------------
  |  Branch (259:13): [True: 1, False: 0]
  ------------------
  260|      1|            igraph_vector_int_clear(membership);
  261|      1|        }
  262|      1|        return IGRAPH_SUCCESS;
  263|      1|    }
  264|       |
  265|  3.53k|    if (membership || modularity) {
  ------------------
  |  Branch (265:9): [True: 3.53k, False: 0]
  |  Branch (265:23): [True: 0, False: 0]
  ------------------
  266|  3.53k|        return igraph_i_community_eb_get_merges2(graph,
  267|  3.53k|                directed && igraph_is_directed(graph),
  ------------------
  |  Branch (267:17): [True: 3.53k, False: 0]
  |  Branch (267:29): [True: 3.53k, False: 0]
  ------------------
  268|  3.53k|                edges, weights,
  269|  3.53k|                res, bridges, modularity, membership);
  270|  3.53k|    }
  271|       |
  272|      0|    IGRAPH_CHECK(igraph_connected_components(graph, NULL, NULL, &no_comps, IGRAPH_WEAK));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  273|       |
  274|      0|    max_merges = no_of_nodes - no_comps;
  275|      0|    IGRAPH_VECTOR_INT_INIT_FINALLY(&ptr, no_of_nodes * 2 - 1);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  276|      0|    if (res) {
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|        IGRAPH_CHECK(igraph_matrix_int_resize(res, max_merges, 2));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  278|      0|    }
  279|      0|    if (bridges) {
  ------------------
  |  Branch (279:9): [True: 0, False: 0]
  ------------------
  280|      0|        IGRAPH_CHECK(igraph_vector_int_resize(bridges, max_merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  281|      0|    }
  282|       |
  283|      0|    for (igraph_int_t i = igraph_vector_int_size(edges) - 1; i >= 0; i--) {
  ------------------
  |  Branch (283:62): [True: 0, False: 0]
  ------------------
  284|      0|        igraph_int_t edge = VECTOR(*edges)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  285|      0|        igraph_int_t from, to, c1, c2, idx;
  286|      0|        IGRAPH_CHECK(igraph_edge(graph, edge, &from, &to));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  287|      0|        idx = from + 1;
  288|      0|        while (VECTOR(ptr)[idx - 1] != 0) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (288:16): [True: 0, False: 0]
  ------------------
  289|      0|            idx = VECTOR(ptr)[idx - 1];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  290|      0|        }
  291|      0|        c1 = idx - 1;
  292|      0|        idx = to + 1;
  293|      0|        while (VECTOR(ptr)[idx - 1] != 0) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (293:16): [True: 0, False: 0]
  ------------------
  294|      0|            idx = VECTOR(ptr)[idx - 1];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  295|      0|        }
  296|      0|        c2 = idx - 1;
  297|      0|        if (c1 != c2) {     /* this is a merge */
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|            if (res) {
  ------------------
  |  Branch (298:17): [True: 0, False: 0]
  ------------------
  299|      0|                MATRIX(*res, midx, 0) = c1;
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  300|      0|                MATRIX(*res, midx, 1) = c2;
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  301|      0|            }
  302|      0|            if (bridges) {
  ------------------
  |  Branch (302:17): [True: 0, False: 0]
  ------------------
  303|      0|                VECTOR(*bridges)[midx] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  304|      0|            }
  305|       |
  306|      0|            VECTOR(ptr)[c1] = no_of_nodes + midx + 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  307|      0|            VECTOR(ptr)[c2] = no_of_nodes + midx + 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  308|      0|            VECTOR(ptr)[from] = no_of_nodes + midx + 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  309|      0|            VECTOR(ptr)[to] = no_of_nodes + midx + 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  310|       |
  311|      0|            midx++;
  312|      0|        }
  313|      0|    }
  314|       |
  315|      0|    igraph_vector_int_destroy(&ptr);
  316|      0|    IGRAPH_FINALLY_CLEAN(1);
  317|       |
  318|      0|    return IGRAPH_SUCCESS;
  319|      0|}
igraph_community_edge_betweenness:
  456|  3.54k|                                      const igraph_vector_t *lengths) {
  457|       |
  458|  3.54k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  459|  3.54k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  460|  3.54k|    double *distance, *tmpscore;
  461|  3.54k|    double *nrgeo;
  462|       |
  463|  3.54k|    igraph_inclist_t elist_out, elist_in, parents;
  464|  3.54k|    igraph_inclist_t *elist_out_p, *elist_in_p;
  465|  3.54k|    igraph_vector_int_t *neip;
  466|  3.54k|    igraph_int_t neino;
  467|  3.54k|    igraph_vector_t eb;
  468|  3.54k|    igraph_int_t maxedge, pos;
  469|  3.54k|    igraph_int_t from, to;
  470|  3.54k|    igraph_bool_t result_owned = false;
  471|  3.54k|    igraph_stack_int_t stack;
  472|  3.54k|    igraph_real_t steps, steps_done;
  473|  3.54k|    igraph_bitset_t passive;
  474|       |
  475|       |    /* Needed only for the unweighted case */
  476|  3.54k|    igraph_dqueue_int_t q;
  477|       |
  478|       |    /* Needed only for the weighted case */
  479|  3.54k|    igraph_2wheap_t heap;
  480|       |
  481|  3.54k|    if (removed_edges == NULL) {
  ------------------
  |  Branch (481:9): [True: 0, False: 3.54k]
  ------------------
  482|      0|        removed_edges = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|      0|        IGRAPH_CHECK_OOM(removed_edges, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  484|      0|        IGRAPH_FINALLY(igraph_free, removed_edges);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  485|       |
  486|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(removed_edges, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  487|      0|        result_owned = true;
  488|      0|    }
  489|       |
  490|  3.54k|    directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (490:16): [True: 3.54k, False: 0]
  |  Branch (490:28): [True: 3.54k, False: 0]
  ------------------
  491|  3.54k|    if (directed) {
  ------------------
  |  Branch (491:9): [True: 3.54k, False: 0]
  ------------------
  492|  3.54k|        IGRAPH_CHECK(igraph_inclist_init(graph, &elist_out, IGRAPH_OUT, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  493|  3.54k|        IGRAPH_FINALLY(igraph_inclist_destroy, &elist_out);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  494|  3.54k|        IGRAPH_CHECK(igraph_inclist_init(graph, &elist_in, IGRAPH_IN, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  495|  3.54k|        IGRAPH_FINALLY(igraph_inclist_destroy, &elist_in);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  496|  3.54k|        elist_out_p = &elist_out;
  497|  3.54k|        elist_in_p = &elist_in;
  498|  3.54k|    } else {
  499|      0|        IGRAPH_CHECK(igraph_inclist_init(graph, &elist_out, IGRAPH_ALL, IGRAPH_LOOPS_TWICE));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  500|      0|        IGRAPH_FINALLY(igraph_inclist_destroy, &elist_out);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  501|      0|        elist_out_p = elist_in_p = &elist_out;
  502|      0|    }
  503|       |
  504|  3.54k|    distance = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  505|  3.54k|    IGRAPH_CHECK_OOM(distance, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  506|  3.54k|    IGRAPH_FINALLY(igraph_free, distance);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  507|       |
  508|  3.54k|    nrgeo = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|  3.54k|    IGRAPH_CHECK_OOM(nrgeo, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  510|  3.54k|    IGRAPH_FINALLY(igraph_free, nrgeo);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  511|       |
  512|  3.54k|    tmpscore = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  3.54k|    IGRAPH_CHECK_OOM(tmpscore, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  514|  3.54k|    IGRAPH_FINALLY(igraph_free, tmpscore);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  515|       |
  516|  3.54k|    if (weights) {
  ------------------
  |  Branch (516:9): [True: 3.54k, False: 0]
  ------------------
  517|  3.54k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (517:13): [True: 0, False: 3.54k]
  ------------------
  518|      0|            IGRAPH_ERROR("Weight vector length must agree with number of edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  519|      0|        }
  520|       |
  521|  3.54k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (521:13): [True: 3.48k, False: 51]
  ------------------
  522|       |            /* Must not call vector_min on empty vector */
  523|  3.48k|            igraph_real_t minweight = igraph_vector_min(weights);
  524|  3.48k|            if (minweight <= 0) {
  ------------------
  |  Branch (524:17): [True: 0, False: 3.48k]
  ------------------
  525|      0|                IGRAPH_ERROR("Weights must be strictly positive.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  526|      0|            }
  527|       |
  528|  3.48k|            if (isnan(minweight)) {
  ------------------
  |  Branch (528:17): [True: 0, False: 3.48k]
  ------------------
  529|      0|                IGRAPH_ERROR("Weights must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  530|      0|            }
  531|  3.48k|        }
  532|  3.54k|    }
  533|       |
  534|  3.54k|    if (lengths == NULL) {
  ------------------
  |  Branch (534:9): [True: 3.54k, False: 0]
  ------------------
  535|  3.54k|        IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, 100);
  ------------------
  |  |   61|  3.54k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.54k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  536|  3.54k|    } else {
  537|      0|        if (igraph_vector_size(lengths) != no_of_edges) {
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|            IGRAPH_ERROR("Edge length vector size must agree with number of edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  539|      0|        }
  540|       |
  541|      0|        if (no_of_edges > 0) {
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|       |            /* Must not call vector_min on empty vector */
  543|      0|            igraph_real_t minlength = igraph_vector_min(lengths);
  544|      0|            if (minlength <= 0) {
  ------------------
  |  Branch (544:17): [True: 0, False: 0]
  ------------------
  545|      0|                IGRAPH_ERROR("Edge lengths must be strictly positive.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  546|      0|            }
  547|       |
  548|      0|            if (isnan(minlength)) {
  ------------------
  |  Branch (548:17): [True: 0, False: 0]
  ------------------
  549|      0|                IGRAPH_ERROR("Edge lengths must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  550|      0|            }
  551|      0|        }
  552|       |
  553|      0|        IGRAPH_CHECK(igraph_2wheap_init(&heap, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  554|      0|        IGRAPH_FINALLY(igraph_2wheap_destroy, &heap);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  555|      0|        IGRAPH_CHECK(igraph_inclist_init_empty(&parents, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  556|      0|        IGRAPH_FINALLY(igraph_inclist_destroy, &parents);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  557|      0|    }
  558|       |
  559|  3.54k|    IGRAPH_STACK_INT_INIT_FINALLY(&stack, no_of_nodes);
  ------------------
  |  |   61|  3.54k|    do { IGRAPH_CHECK(igraph_stack_int_init(s, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.54k|        IGRAPH_FINALLY(igraph_stack_int_destroy, s); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:63): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  560|       |
  561|  3.54k|    IGRAPH_CHECK(igraph_vector_int_resize(removed_edges, no_of_edges));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  562|  3.54k|    if (edge_betweenness) {
  ------------------
  |  Branch (562:9): [True: 3.54k, False: 0]
  ------------------
  563|  3.54k|        IGRAPH_CHECK(igraph_vector_resize(edge_betweenness, no_of_edges));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  564|  3.54k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (564:13): [True: 3.48k, False: 51]
  ------------------
  565|  3.48k|            VECTOR(*edge_betweenness)[no_of_edges - 1] = 0;
  ------------------
  |  |   60|  3.48k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  566|  3.48k|        }
  567|  3.54k|    }
  568|       |
  569|  3.54k|    IGRAPH_VECTOR_INIT_FINALLY(&eb, no_of_edges);
  ------------------
  |  |  104|  3.54k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  570|  3.54k|    IGRAPH_BITSET_INIT_FINALLY(&passive, no_of_edges);
  ------------------
  |  |  259|  3.54k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  3.54k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  3.54k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  571|       |
  572|       |    /* Estimate the number of steps to be taken.
  573|       |     * It is assumed that one iteration is O(|E||V|), but |V| is constant
  574|       |     * anyway, so we will have approximately |E|^2 / 2 steps, and one
  575|       |     * iteration of the outer loop advances the step counter by the number
  576|       |     * of remaining edges at that iteration.
  577|       |     */
  578|  3.54k|    steps = no_of_edges / 2.0 * (no_of_edges + 1);
  579|  3.54k|    steps_done = 0;
  580|       |
  581|  99.5k|    for (igraph_int_t e = 0; e < no_of_edges; steps_done += no_of_edges - e, e++) {
  ------------------
  |  Branch (581:30): [True: 96.0k, False: 3.54k]
  ------------------
  582|  96.0k|        IGRAPH_PROGRESS("Edge betweenness community detection: ",
  ------------------
  |  |  169|  96.0k|    do { \
  |  |  170|  96.0k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  96.0k|    do { \
  |  |  |  |  657|  96.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  96.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  96.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 96.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  96.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 96.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  96.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 96.0k]
  |  |  ------------------
  ------------------
  583|  96.0k|                        100.0 * steps_done / steps, NULL);
  584|       |
  585|  96.0k|        igraph_vector_null(&eb);
  586|       |
  587|  96.0k|        if (lengths == NULL) {
  ------------------
  |  Branch (587:13): [True: 96.0k, False: 0]
  ------------------
  588|       |            /* Unweighted variant follows */
  589|       |
  590|       |            /* The following for loop is copied almost intact from
  591|       |             * igraph_edge_betweenness_cutoff */
  592|  5.06M|            for (igraph_int_t source = 0; source < no_of_nodes; source++) {
  ------------------
  |  Branch (592:43): [True: 4.96M, False: 96.0k]
  ------------------
  593|       |
  594|  4.96M|                IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  4.96M|    do { \
  |  |   47|  4.96M|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 4.96M]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  4.96M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 4.96M]
  |  |  ------------------
  ------------------
  595|       |
  596|  4.96M|                memset(distance, 0, (size_t) no_of_nodes * sizeof(double));
  597|  4.96M|                memset(nrgeo, 0, (size_t) no_of_nodes * sizeof(double));
  598|  4.96M|                memset(tmpscore, 0, (size_t) no_of_nodes * sizeof(double));
  599|  4.96M|                igraph_stack_int_clear(&stack); /* it should be empty anyway... */
  600|       |
  601|  4.96M|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, source));
  ------------------
  |  |  656|  4.96M|    do { \
  |  |  657|  4.96M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.96M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.96M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  4.96M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.96M]
  |  |  ------------------
  ------------------
  602|       |
  603|  4.96M|                nrgeo[source] = 1;
  604|  4.96M|                distance[source] = 0;
  605|       |
  606|  21.1M|                while (!igraph_dqueue_int_empty(&q)) {
  ------------------
  |  Branch (606:24): [True: 16.1M, False: 4.96M]
  ------------------
  607|  16.1M|                    igraph_int_t actnode = igraph_dqueue_int_pop(&q);
  608|       |
  609|  16.1M|                    neip = igraph_inclist_get(elist_out_p, actnode);
  ------------------
  |  |  102|  16.1M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  610|  16.1M|                    neino = igraph_vector_int_size(neip);
  611|  46.4M|                    for (igraph_int_t i = 0; i < neino; i++) {
  ------------------
  |  Branch (611:46): [True: 30.2M, False: 16.1M]
  ------------------
  612|  30.2M|                        igraph_int_t edge = VECTOR(*neip)[i];
  ------------------
  |  |   60|  30.2M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  613|  30.2M|                        igraph_int_t neighbor = IGRAPH_OTHER(graph, edge, actnode);
  ------------------
  |  |  146|  30.2M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  30.2M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  30.2M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  3.33M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.33M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  26.9M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  26.9M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 3.33M, False: 26.9M]
  |  |  ------------------
  ------------------
  614|  30.2M|                        if (nrgeo[neighbor] != 0) {
  ------------------
  |  Branch (614:29): [True: 19.1M, False: 11.1M]
  ------------------
  615|       |                            /* we've already seen this node, another shortest path? */
  616|  19.1M|                            if (distance[neighbor] == distance[actnode] + 1) {
  ------------------
  |  Branch (616:33): [True: 4.04M, False: 15.0M]
  ------------------
  617|  4.04M|                                nrgeo[neighbor] += nrgeo[actnode];
  618|  4.04M|                            }
  619|  19.1M|                        } else {
  620|       |                            /* we haven't seen this node yet */
  621|  11.1M|                            nrgeo[neighbor] += nrgeo[actnode];
  622|  11.1M|                            distance[neighbor] = distance[actnode] + 1;
  623|  11.1M|                            IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|  11.1M|    do { \
  |  |  657|  11.1M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  11.1M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  11.1M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  11.1M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 11.1M]
  |  |  ------------------
  ------------------
  624|  11.1M|                            IGRAPH_CHECK(igraph_stack_int_push(&stack, neighbor));
  ------------------
  |  |  656|  11.1M|    do { \
  |  |  657|  11.1M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  11.1M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  11.1M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  11.1M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 11.1M]
  |  |  ------------------
  ------------------
  625|  11.1M|                        }
  626|  30.2M|                    }
  627|  16.1M|                } /* while !igraph_dqueue_int_empty */
  628|       |
  629|       |                /* Ok, we've the distance of each node and also the number of
  630|       |                   shortest paths to them. Now we do an inverse search, starting
  631|       |                   with the farthest nodes. */
  632|  16.1M|                while (!igraph_stack_int_empty(&stack)) {
  ------------------
  |  Branch (632:24): [True: 11.1M, False: 4.96M]
  ------------------
  633|  11.1M|                    igraph_int_t actnode = igraph_stack_int_pop(&stack);
  634|  11.1M|                    if (distance[actnode] < 1) {
  ------------------
  |  Branch (634:25): [True: 0, False: 11.1M]
  ------------------
  635|      0|                        continue;    /* skip source node */
  636|      0|                    }
  637|       |
  638|       |                    /* set the temporary score of the friends */
  639|  11.1M|                    neip = igraph_inclist_get(elist_in_p, actnode);
  ------------------
  |  |  102|  11.1M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  640|  11.1M|                    neino = igraph_vector_int_size(neip);
  641|  48.7M|                    for (igraph_int_t i = 0; i < neino; i++) {
  ------------------
  |  Branch (641:46): [True: 37.5M, False: 11.1M]
  ------------------
  642|  37.5M|                        igraph_int_t edge = VECTOR(*neip)[i];
  ------------------
  |  |   60|  37.5M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  643|  37.5M|                        igraph_int_t neighbor = IGRAPH_OTHER(graph, edge, actnode);
  ------------------
  |  |  146|  37.5M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  37.5M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  37.5M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  37.5M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  37.5M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 37.5M, False: 0]
  |  |  ------------------
  ------------------
  644|  37.5M|                        if (distance[neighbor] == distance[actnode] - 1 &&
  ------------------
  |  Branch (644:29): [True: 18.8M, False: 18.6M]
  ------------------
  645|  18.8M|                            nrgeo[neighbor] != 0) {
  ------------------
  |  Branch (645:29): [True: 15.2M, False: 3.67M]
  ------------------
  646|  15.2M|                            tmpscore[neighbor] +=
  647|  15.2M|                                (tmpscore[actnode] + 1) * nrgeo[neighbor] / nrgeo[actnode];
  648|  15.2M|                            VECTOR(eb)[edge] +=
  ------------------
  |  |   60|  15.2M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  649|  15.2M|                                (tmpscore[actnode] + 1) * nrgeo[neighbor] / nrgeo[actnode];
  650|  15.2M|                        }
  651|  37.5M|                    }
  652|  11.1M|                }
  653|       |                /* Ok, we've the scores for this source */
  654|  4.96M|            } /* for source <= no_of_nodes */
  655|  96.0k|        } else {
  656|       |            /* Weighted variant follows */
  657|       |
  658|      0|            const igraph_real_t eps = IGRAPH_SHORTEST_PATH_EPSILON;
  ------------------
  |  |   35|      0|#define IGRAPH_SHORTEST_PATH_EPSILON 1e-10
  ------------------
  659|      0|            int cmp_result;
  660|       |
  661|       |            /* The following for loop is copied almost intact from
  662|       |             * igraph_i_edge_betweenness_cutoff_weighted */
  663|      0|            for (igraph_int_t source = 0; source < no_of_nodes; source++) {
  ------------------
  |  Branch (663:43): [True: 0, False: 0]
  ------------------
  664|       |                /* This will contain the edge betweenness in the current step */
  665|      0|                IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|      0|    do { \
  |  |   47|      0|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  666|       |
  667|      0|                memset(distance, 0, (size_t) no_of_nodes * sizeof(double));
  668|      0|                memset(nrgeo, 0, (size_t) no_of_nodes * sizeof(double));
  669|      0|                memset(tmpscore, 0, (size_t) no_of_nodes * sizeof(double));
  670|       |
  671|      0|                IGRAPH_CHECK(igraph_2wheap_push_with_index(&heap, source, 0));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  672|      0|                distance[source] = 1.0;
  673|      0|                nrgeo[source] = 1;
  674|       |
  675|      0|                while (!igraph_2wheap_empty(&heap)) {
  ------------------
  |  Branch (675:24): [True: 0, False: 0]
  ------------------
  676|      0|                    igraph_int_t minnei = igraph_2wheap_max_index(&heap);
  677|      0|                    igraph_real_t mindist = -igraph_2wheap_delete_max(&heap);
  678|       |
  679|      0|                    IGRAPH_CHECK(igraph_stack_int_push(&stack, minnei));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  680|       |
  681|      0|                    neip = igraph_inclist_get(elist_out_p, minnei);
  ------------------
  |  |  102|      0|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  682|      0|                    neino = igraph_vector_int_size(neip);
  683|       |
  684|      0|                    for (igraph_int_t i = 0; i < neino; i++) {
  ------------------
  |  Branch (684:46): [True: 0, False: 0]
  ------------------
  685|      0|                        igraph_int_t edge = VECTOR(*neip)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  686|      0|                        igraph_int_t to = IGRAPH_OTHER(graph, edge, minnei);
  ------------------
  |  |  146|      0|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  687|      0|                        igraph_real_t altdist = mindist + VECTOR(*lengths)[edge];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  688|      0|                        igraph_real_t curdist = distance[to];
  689|      0|                        igraph_vector_int_t *v;
  690|       |
  691|       |                        /* Note: curdist == 0 means infinity, and for this case
  692|       |                         * cmp_result should be -1. However, this case is handled
  693|       |                         * specially below, without referring to cmp_result. */
  694|      0|                        cmp_result = igraph_cmp_epsilon(altdist, curdist - 1, eps);
  695|       |
  696|      0|                        if (curdist == 0) {
  ------------------
  |  Branch (696:29): [True: 0, False: 0]
  ------------------
  697|       |                            /* This is the first finite distance to 'to' */
  698|      0|                            v = igraph_inclist_get(&parents, to);
  ------------------
  |  |  102|      0|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  699|      0|                            igraph_vector_int_resize(v, 1);
  700|      0|                            VECTOR(*v)[0] = edge;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  701|      0|                            nrgeo[to] = nrgeo[minnei];
  702|      0|                            distance[to] = altdist + 1.0;
  703|      0|                            IGRAPH_CHECK(igraph_2wheap_push_with_index(&heap, to, -altdist));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  704|      0|                        } else if (cmp_result < 0) {
  ------------------
  |  Branch (704:36): [True: 0, False: 0]
  ------------------
  705|       |                            /* This is a shorter path */
  706|      0|                            v = igraph_inclist_get(&parents, to);
  ------------------
  |  |  102|      0|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  707|      0|                            igraph_vector_int_resize(v, 1);
  708|      0|                            VECTOR(*v)[0] = edge;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  709|      0|                            nrgeo[to] = nrgeo[minnei];
  710|      0|                            distance[to] = altdist + 1.0;
  711|      0|                            igraph_2wheap_modify(&heap, to, -altdist);
  712|      0|                        } else if (cmp_result == 0) {
  ------------------
  |  Branch (712:36): [True: 0, False: 0]
  ------------------
  713|       |                            /* Another path with the same length */
  714|      0|                            v = igraph_inclist_get(&parents, to);
  ------------------
  |  |  102|      0|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  715|      0|                            IGRAPH_CHECK(igraph_vector_int_push_back(v, edge));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  716|      0|                            nrgeo[to] += nrgeo[minnei];
  717|      0|                        }
  718|      0|                    }
  719|      0|                } /* igraph_2wheap_empty(&Q) */
  720|       |
  721|      0|                while (!igraph_stack_int_empty(&stack)) {
  ------------------
  |  Branch (721:24): [True: 0, False: 0]
  ------------------
  722|      0|                    igraph_int_t w = igraph_stack_int_pop(&stack);
  723|      0|                    igraph_vector_int_t *parv = igraph_inclist_get(&parents, w);
  ------------------
  |  |  102|      0|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  724|      0|                    igraph_int_t parv_len = igraph_vector_int_size(parv);
  725|       |
  726|      0|                    for (igraph_int_t i = 0; i < parv_len; i++) {
  ------------------
  |  Branch (726:46): [True: 0, False: 0]
  ------------------
  727|      0|                        igraph_int_t fedge = VECTOR(*parv)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  728|      0|                        igraph_int_t neighbor = IGRAPH_OTHER(graph, fedge, w);
  ------------------
  |  |  146|      0|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  729|      0|                        tmpscore[neighbor] += (tmpscore[w] + 1) * nrgeo[neighbor] / nrgeo[w];
  730|      0|                        VECTOR(eb)[fedge] += (tmpscore[w] + 1) * nrgeo[neighbor] / nrgeo[w];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  731|      0|                    }
  732|       |
  733|      0|                    tmpscore[w] = 0;
  734|      0|                    distance[w] = 0;
  735|      0|                    nrgeo[w] = 0;
  736|      0|                    igraph_vector_int_clear(parv);
  737|      0|                }
  738|      0|            } /* source < no_of_nodes */
  739|      0|        }
  740|       |
  741|       |        /* Now look for the smallest edge betweenness */
  742|       |        /* and eliminate that edge from the network */
  743|  96.0k|        maxedge = igraph_i_which_max_active_ratio(&eb, weights, &passive);
  744|  96.0k|        VECTOR(*removed_edges)[e] = maxedge;
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  745|  96.0k|        if (edge_betweenness) {
  ------------------
  |  Branch (745:13): [True: 96.0k, False: 0]
  ------------------
  746|  96.0k|            VECTOR(*edge_betweenness)[e] = VECTOR(eb)[maxedge];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*edge_betweenness)[e] = VECTOR(eb)[maxedge];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  747|  96.0k|            if (!directed) {
  ------------------
  |  Branch (747:17): [True: 0, False: 96.0k]
  ------------------
  748|      0|                VECTOR(*edge_betweenness)[e] /= 2.0;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  749|      0|            }
  750|  96.0k|        }
  751|  96.0k|        IGRAPH_BIT_SET(passive, maxedge);
  ------------------
  |  |  103|  96.0k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  96.0k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  96.0k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  96.0k|        IGRAPH_CHECK(igraph_edge(graph, maxedge, &from, &to));
  ------------------
  |  |  656|  96.0k|    do { \
  |  |  657|  96.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  96.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  96.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 96.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  96.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 96.0k]
  |  |  ------------------
  ------------------
  753|       |
  754|  96.0k|        neip = igraph_inclist_get(elist_in_p, to);
  ------------------
  |  |  102|  96.0k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  755|  96.0k|        neino = igraph_vector_int_size(neip);
  756|  96.0k|        igraph_vector_int_search(neip, 0, maxedge, &pos);
  757|  96.0k|        VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  758|  96.0k|        igraph_vector_int_pop_back(neip);
  759|       |
  760|  96.0k|        neip = igraph_inclist_get(elist_out_p, from);
  ------------------
  |  |  102|  96.0k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  761|  96.0k|        neino = igraph_vector_int_size(neip);
  762|  96.0k|        igraph_vector_int_search(neip, 0, maxedge, &pos);
  763|  96.0k|        VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  764|  96.0k|        igraph_vector_int_pop_back(neip);
  765|  96.0k|    }
  766|       |
  767|  3.54k|    IGRAPH_PROGRESS("Edge betweenness community detection: ", 100.0, NULL);
  ------------------
  |  |  169|  3.54k|    do { \
  |  |  170|  3.54k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  768|       |
  769|  3.54k|    igraph_bitset_destroy(&passive);
  770|  3.54k|    igraph_vector_destroy(&eb);
  771|  3.54k|    igraph_stack_int_destroy(&stack);
  772|  3.54k|    IGRAPH_FINALLY_CLEAN(3);
  773|       |
  774|  3.54k|    if (lengths == NULL) {
  ------------------
  |  Branch (774:9): [True: 3.54k, False: 0]
  ------------------
  775|  3.54k|        igraph_dqueue_int_destroy(&q);
  776|  3.54k|        IGRAPH_FINALLY_CLEAN(1);
  777|  3.54k|    } else {
  778|      0|        igraph_2wheap_destroy(&heap);
  779|      0|        igraph_inclist_destroy(&parents);
  780|      0|        IGRAPH_FINALLY_CLEAN(2);
  781|      0|    }
  782|  3.54k|    igraph_free(tmpscore);
  783|  3.54k|    igraph_free(nrgeo);
  784|  3.54k|    igraph_free(distance);
  785|  3.54k|    IGRAPH_FINALLY_CLEAN(3);
  786|       |
  787|  3.54k|    if (directed) {
  ------------------
  |  Branch (787:9): [True: 3.54k, False: 0]
  ------------------
  788|  3.54k|        igraph_inclist_destroy(&elist_out);
  789|  3.54k|        igraph_inclist_destroy(&elist_in);
  790|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  791|  3.54k|    } else {
  792|      0|        igraph_inclist_destroy(&elist_out);
  793|      0|        IGRAPH_FINALLY_CLEAN(1);
  794|      0|    }
  795|       |
  796|  3.54k|    if (merges || bridges || modularity || membership) {
  ------------------
  |  Branch (796:9): [True: 3.54k, False: 0]
  |  Branch (796:19): [True: 0, False: 0]
  |  Branch (796:30): [True: 0, False: 0]
  |  Branch (796:44): [True: 0, False: 0]
  ------------------
  797|  3.54k|        IGRAPH_CHECK(igraph_community_eb_get_merges(graph, directed, removed_edges, weights, merges,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  798|  3.54k|                     bridges, modularity,
  799|  3.54k|                     membership));
  800|  3.54k|    }
  801|       |
  802|  3.54k|    if (result_owned) {
  ------------------
  |  Branch (802:9): [True: 0, False: 3.54k]
  ------------------
  803|      0|        igraph_vector_int_destroy(removed_edges);
  804|      0|        IGRAPH_FREE(removed_edges);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  805|      0|        IGRAPH_FINALLY_CLEAN(2);
  806|      0|    }
  807|       |
  808|  3.54k|    return IGRAPH_SUCCESS;
  809|  3.54k|}
edge_betweenness.c:igraph_i_community_eb_get_merges2:
   68|  3.53k|                                             igraph_vector_int_t *membership) {
   69|       |
   70|  3.53k|    igraph_vector_int_t mymembership;
   71|  3.53k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   72|  3.53k|    igraph_real_t maxmod = -1;
   73|  3.53k|    igraph_int_t midx = 0;
   74|  3.53k|    igraph_int_t no_comps;
   75|  3.53k|    const igraph_bool_t use_directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (75:40): [True: 3.53k, False: 0]
  |  Branch (75:52): [True: 3.53k, False: 0]
  ------------------
   76|  3.53k|    igraph_int_t max_merges;
   77|       |
   78|  3.53k|    if (membership) {
  ------------------
  |  Branch (78:9): [True: 3.53k, False: 0]
  ------------------
   79|  3.53k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   80|  3.53k|    }
   81|  3.53k|    if (modularity || res || bridges) {
  ------------------
  |  Branch (81:9): [True: 3.53k, False: 0]
  |  Branch (81:23): [True: 0, False: 0]
  |  Branch (81:30): [True: 0, False: 0]
  ------------------
   82|  3.53k|        IGRAPH_CHECK(igraph_connected_components(graph, NULL, NULL, &no_comps, IGRAPH_WEAK));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   83|  3.53k|        max_merges = no_of_nodes - no_comps;
   84|       |
   85|  3.53k|        if (modularity) {
  ------------------
  |  Branch (85:13): [True: 3.53k, False: 0]
  ------------------
   86|  3.53k|            IGRAPH_CHECK(igraph_vector_resize(modularity,
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   87|  3.53k|                                              max_merges + 1));
   88|  3.53k|        }
   89|  3.53k|        if (res) {
  ------------------
  |  Branch (89:13): [True: 3.53k, False: 0]
  ------------------
   90|  3.53k|            IGRAPH_CHECK(igraph_matrix_int_resize(res, max_merges,
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   91|  3.53k|                                              2));
   92|  3.53k|        }
   93|  3.53k|        if (bridges) {
  ------------------
  |  Branch (93:13): [True: 3.53k, False: 0]
  ------------------
   94|  3.53k|            IGRAPH_CHECK(igraph_vector_int_resize(bridges, max_merges));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   95|  3.53k|        }
   96|  3.53k|    }
   97|       |
   98|  3.53k|    IGRAPH_CHECK(igraph_vector_int_init_range(&mymembership, 0, no_of_nodes));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   99|  3.53k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &mymembership);
  ------------------
  |  |  603|  3.53k|    do { \
  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  ------------------
  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  100|       |
  101|  3.53k|    if (membership) {
  ------------------
  |  Branch (101:9): [True: 3.53k, False: 0]
  ------------------
  102|  3.53k|        IGRAPH_CHECK(igraph_vector_int_update(membership, &mymembership));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  103|  3.53k|    }
  104|       |
  105|  3.53k|    IGRAPH_CHECK(igraph_modularity(graph, &mymembership, weights,
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  106|  3.53k|                                   /* resolution */ 1,
  107|  3.53k|                                   use_directed, &maxmod));
  108|  3.53k|    if (modularity) {
  ------------------
  |  Branch (108:9): [True: 3.53k, False: 0]
  ------------------
  109|  3.53k|        VECTOR(*modularity)[0] = maxmod;
  ------------------
  |  |   60|  3.53k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  110|  3.53k|    }
  111|       |
  112|  99.5k|    for (igraph_int_t i = igraph_vector_int_size(edges) - 1; i >= 0; i--) {
  ------------------
  |  Branch (112:62): [True: 96.0k, False: 3.53k]
  ------------------
  113|  96.0k|        igraph_int_t edge = VECTOR(*edges)[i];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  114|  96.0k|        igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  115|  96.0k|        igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  116|  96.0k|        igraph_int_t c1 = VECTOR(mymembership)[from];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  117|  96.0k|        igraph_int_t c2 = VECTOR(mymembership)[to];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  118|  96.0k|        igraph_real_t actmod;
  119|       |
  120|  96.0k|        if (c1 != c2) {     /* this is a merge */
  ------------------
  |  Branch (120:13): [True: 41.9k, False: 54.0k]
  ------------------
  121|  41.9k|            if (res) {
  ------------------
  |  Branch (121:17): [True: 41.9k, False: 0]
  ------------------
  122|  41.9k|                MATRIX(*res, midx, 0) = c1;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  123|  41.9k|                MATRIX(*res, midx, 1) = c2;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  124|  41.9k|            }
  125|  41.9k|            if (bridges) {
  ------------------
  |  Branch (125:17): [True: 41.9k, False: 0]
  ------------------
  126|  41.9k|                VECTOR(*bridges)[midx] = i;
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  127|  41.9k|            }
  128|       |
  129|       |            /* The new cluster has ID no_of_nodes+midx+1 */
  130|  2.39M|            for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (130:38): [True: 2.34M, False: 41.9k]
  ------------------
  131|  2.34M|                if (VECTOR(mymembership)[j] == c1 ||
  ------------------
  |  |   60|  2.34M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (131:21): [True: 214k, False: 2.13M]
  ------------------
  132|  2.13M|                    VECTOR(mymembership)[j] == c2) {
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (132:21): [True: 215k, False: 1.91M]
  ------------------
  133|   430k|                    VECTOR(mymembership)[j] = no_of_nodes + midx;
  ------------------
  |  |   60|   430k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  134|   430k|                }
  135|  2.34M|            }
  136|       |
  137|  41.9k|            IGRAPH_CHECK(igraph_modularity(graph, &mymembership, weights,
  ------------------
  |  |  656|  41.9k|    do { \
  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  138|  41.9k|                                           /* resolution */ 1,
  139|  41.9k|                                           use_directed, &actmod));
  140|  41.9k|            if (modularity) {
  ------------------
  |  Branch (140:17): [True: 41.9k, False: 0]
  ------------------
  141|  41.9k|                VECTOR(*modularity)[midx + 1] = actmod;
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  142|  41.9k|                if (actmod > maxmod) {
  ------------------
  |  Branch (142:21): [True: 25.7k, False: 16.2k]
  ------------------
  143|  25.7k|                    maxmod = actmod;
  144|  25.7k|                    if (membership) {
  ------------------
  |  Branch (144:25): [True: 25.7k, False: 0]
  ------------------
  145|  25.7k|                        IGRAPH_CHECK(igraph_vector_int_update(membership, &mymembership));
  ------------------
  |  |  656|  25.7k|    do { \
  |  |  657|  25.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.7k]
  |  |  ------------------
  ------------------
  146|  25.7k|                    }
  147|  25.7k|                }
  148|  41.9k|            }
  149|       |
  150|  41.9k|            midx++;
  151|  41.9k|        }
  152|  96.0k|    }
  153|       |
  154|  3.53k|    if (membership) {
  ------------------
  |  Branch (154:9): [True: 3.53k, False: 0]
  ------------------
  155|  3.53k|        IGRAPH_CHECK(igraph_i_rewrite_membership_vector(membership));
  ------------------
  |  |  656|  3.53k|    do { \
  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  156|  3.53k|    }
  157|       |
  158|  3.53k|    igraph_vector_int_destroy(&mymembership);
  159|  3.53k|    IGRAPH_FINALLY_CLEAN(1);
  160|       |
  161|  3.53k|    return IGRAPH_SUCCESS;
  162|  3.53k|}
edge_betweenness.c:igraph_i_rewrite_membership_vector:
   39|  3.53k|static igraph_error_t igraph_i_rewrite_membership_vector(igraph_vector_int_t *membership) {
   40|  3.53k|    const igraph_int_t no = igraph_vector_int_max(membership) + 1;
   41|  3.53k|    igraph_vector_int_t idx;
   42|  3.53k|    igraph_int_t realno = 0;
   43|  3.53k|    const igraph_int_t len = igraph_vector_int_size(membership);
   44|       |
   45|  3.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&idx, no);
  ------------------
  |  |  119|  3.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.53k|    do { \
  |  |  |  |  657|  3.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.53k|    do { \
  |  |  |  |  604|  3.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
   46|   158k|    for (igraph_int_t i = 0; i < len; i++) {
  ------------------
  |  Branch (46:30): [True: 154k, False: 3.53k]
  ------------------
   47|   154k|        const igraph_int_t t = VECTOR(*membership)[i];
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   48|   154k|        if (VECTOR(idx)[t]) {
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (48:13): [True: 27.1k, False: 127k]
  ------------------
   49|  27.1k|            VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|  27.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|  27.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   50|   127k|        } else {
   51|   127k|            VECTOR(idx)[t] = ++realno;
  ------------------
  |  |   60|   127k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   52|   127k|            VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|   127k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|   127k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   53|   127k|        }
   54|   154k|    }
   55|  3.53k|    igraph_vector_int_destroy(&idx);
   56|  3.53k|    IGRAPH_FINALLY_CLEAN(1);
   57|       |
   58|  3.53k|    return IGRAPH_SUCCESS;
   59|  3.53k|}
edge_betweenness.c:igraph_i_which_max_active_ratio:
  330|  96.0k|        igraph_bitset_t *passive) {
  331|       |
  332|  96.0k|    const igraph_int_t size = igraph_vector_size(v);
  333|  96.0k|    igraph_int_t which = igraph_bitset_countr_one(passive); /* start with first active element */
  334|  96.0k|    igraph_real_t max = VECTOR(*v)[which] / (w ? VECTOR(*w)[which] : 1.0);
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                  igraph_real_t max = VECTOR(*v)[which] / (w ? VECTOR(*w)[which] : 1.0);
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (334:46): [True: 96.0k, False: 0]
  ------------------
  335|       |
  336|  6.67M|    for (igraph_int_t i = which+1; i < size; i++) {
  ------------------
  |  Branch (336:36): [True: 6.57M, False: 96.0k]
  ------------------
  337|  6.57M|        igraph_real_t elem = VECTOR(*v)[i] / (w ? VECTOR(*w)[i] : 1.0);
  ------------------
  |  |   60|  6.57M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      igraph_real_t elem = VECTOR(*v)[i] / (w ? VECTOR(*w)[i] : 1.0);
  ------------------
  |  |   60|  6.57M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (337:47): [True: 6.57M, False: 0]
  ------------------
  338|  6.57M|        if (! IGRAPH_BIT_TEST(*passive, i) && elem > max) {
  ------------------
  |  |  142|  13.1M|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  6.57M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  6.57M|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.57M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  6.57M|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.57M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (338:13): [True: 3.98M, False: 2.59M]
  |  Branch (338:47): [True: 164k, False: 3.81M]
  ------------------
  339|   164k|            max = elem;
  340|   164k|            which = i;
  341|   164k|        }
  342|  6.57M|    }
  343|       |
  344|  96.0k|    return which;
  345|  96.0k|}

igraph_community_fastgreedy:
  608|  3.54k|                                igraph_vector_int_t *membership) {
  609|  3.54k|    igraph_int_t no_of_edges, no_of_nodes, no_of_joins, total_joins;
  610|  3.54k|    igraph_int_t i, j, k, n, m, from, to, dummy, best_no_of_joins;
  611|  3.54k|    igraph_eit_t edgeit;
  612|  3.54k|    igraph_i_fastgreedy_commpair *pairs, *p1, *p2;
  613|  3.54k|    igraph_i_fastgreedy_community_list communities;
  614|  3.54k|    igraph_vector_t a;
  615|  3.54k|    igraph_vector_int_t degrees;
  616|  3.54k|    igraph_real_t q, *dq, bestq, weight_sum, loop_weight_sum;
  617|  3.54k|    igraph_bool_t has_multiple;
  618|  3.54k|    igraph_matrix_int_t merges_local;
  619|       |
  620|       |    /*igraph_int_t join_order[] = { 16,5, 5,6, 6,0, 4,0, 10,0, 26,29, 29,33, 23,33, 27,33, 25,24, 24,31, 12,3, 21,1, 30,8, 8,32, 9,2, 17,1, 11,0, 7,3, 3,2, 13,2, 1,2, 28,31, 31,33, 22,32, 18,32, 20,32, 32,33, 15,33, 14,33, 0,19, 19,2, -1,-1 };*/
  621|       |    /*igraph_int_t join_order[] = { 43,42, 42,41, 44,41, 41,36, 35,36, 37,36, 36,29, 38,29, 34,29, 39,29, 33,29, 40,29, 32,29, 14,29, 30,29, 31,29, 6,18, 18,4, 23,4, 21,4, 19,4, 27,4, 20,4, 22,4, 26,4, 25,4, 24,4, 17,4, 0,13, 13,2, 1,2, 11,2, 8,2, 5,2, 3,2, 10,2, 9,2, 7,2, 2,28, 28,15, 12,15, 29,16, 4,15, -1,-1 };*/
  622|       |
  623|  3.54k|    no_of_nodes = igraph_vcount(graph);
  624|  3.54k|    no_of_edges = igraph_ecount(graph);
  625|       |
  626|  3.54k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (626:9): [True: 0, False: 3.54k]
  ------------------
  627|      0|        IGRAPH_ERROR("Fast greedy community detection works on undirected graphs only.", IGRAPH_UNIMPLEMENTED);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  628|      0|    }
  629|       |
  630|  3.54k|    total_joins = no_of_nodes > 0 ? no_of_nodes - 1 : 0;
  ------------------
  |  Branch (630:19): [True: 3.53k, False: 1]
  ------------------
  631|       |
  632|  3.54k|    if (weights) {
  ------------------
  |  Branch (632:9): [True: 3.54k, False: 0]
  ------------------
  633|  3.54k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (633:13): [True: 0, False: 3.54k]
  ------------------
  634|      0|            IGRAPH_ERROR("Length of weight vector must agree with number of edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  635|      0|        }
  636|  3.54k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (636:13): [True: 3.43k, False: 107]
  ------------------
  637|  3.43k|            igraph_real_t minweight = igraph_vector_min(weights);
  638|  3.43k|            if (minweight < 0) {
  ------------------
  |  Branch (638:17): [True: 0, False: 3.43k]
  ------------------
  639|      0|                IGRAPH_ERROR("Weights must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  640|      0|            }
  641|  3.43k|            if (isnan(minweight)) {
  ------------------
  |  Branch (641:17): [True: 0, False: 3.43k]
  ------------------
  642|      0|                IGRAPH_ERROR("Weights must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  643|      0|            }
  644|  3.43k|        }
  645|  3.54k|        weight_sum = igraph_vector_sum(weights);
  646|  3.54k|    } else {
  647|      0|        weight_sum = no_of_edges;
  648|      0|    }
  649|       |
  650|  3.54k|    IGRAPH_CHECK(igraph_has_multiple(graph, &has_multiple));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  651|  3.54k|    if (has_multiple) {
  ------------------
  |  Branch (651:9): [True: 0, False: 3.54k]
  ------------------
  652|      0|        IGRAPH_ERROR("Fast greedy community detection works only on graphs without multi-edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  653|      0|    }
  654|       |
  655|  3.54k|    if (membership != NULL && merges == NULL) {
  ------------------
  |  Branch (655:9): [True: 3.54k, False: 0]
  |  Branch (655:31): [True: 0, False: 3.54k]
  ------------------
  656|       |        /* We need the merge matrix because the user wants the membership
  657|       |         * vector, so we allocate one on our own */
  658|      0|        IGRAPH_CHECK(igraph_matrix_int_init(&merges_local, total_joins, 2));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  659|      0|        IGRAPH_FINALLY(igraph_matrix_int_destroy, &merges_local);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  660|      0|        merges = &merges_local;
  661|      0|    }
  662|       |
  663|  3.54k|    if (merges != NULL) {
  ------------------
  |  Branch (663:9): [True: 3.54k, False: 0]
  ------------------
  664|  3.54k|        IGRAPH_CHECK(igraph_matrix_int_resize(merges, total_joins, 2));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  665|  3.54k|        igraph_matrix_int_null(merges);
  666|  3.54k|    }
  667|       |
  668|  3.54k|    if (modularity != NULL) {
  ------------------
  |  Branch (668:9): [True: 3.54k, False: 0]
  ------------------
  669|  3.54k|        IGRAPH_CHECK(igraph_vector_resize(modularity, total_joins + 1));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  670|  3.54k|    }
  671|       |
  672|       |    /* Create degree vector */
  673|  3.54k|    IGRAPH_VECTOR_INIT_FINALLY(&a, no_of_nodes);
  ------------------
  |  |  104|  3.54k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  674|  3.54k|    if (weights) {
  ------------------
  |  Branch (674:9): [True: 3.54k, False: 0]
  ------------------
  675|  3.54k|        debug("Calculating weighted degrees\n");
  676|  59.3k|        for (i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (676:21): [True: 55.8k, False: 3.54k]
  ------------------
  677|  55.8k|            VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |  115|  55.8k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  678|  55.8k|            VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |  128|  55.8k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  679|  55.8k|        }
  680|  3.54k|    } else {
  681|      0|        debug("Calculating degrees\n");
  682|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  683|      0|        IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  684|      0|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (684:21): [True: 0, False: 0]
  ------------------
  685|      0|            VECTOR(a)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(a)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  686|      0|        }
  687|      0|        igraph_vector_int_destroy(&degrees);
  688|      0|        IGRAPH_FINALLY_CLEAN(1);
  689|      0|    }
  690|       |
  691|       |    /* Create list of communities */
  692|  3.54k|    debug("Creating community list\n");
  693|  3.54k|    communities.n = no_of_nodes;
  694|  3.54k|    communities.no_of_communities = no_of_nodes;
  695|  3.54k|    communities.e = IGRAPH_CALLOC(no_of_nodes, igraph_i_fastgreedy_community);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  3.54k|    IGRAPH_CHECK_OOM(communities.e, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  697|  3.54k|    IGRAPH_FINALLY(igraph_free, communities.e);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  698|       |
  699|  3.54k|    communities.heap = IGRAPH_CALLOC(no_of_nodes, igraph_i_fastgreedy_community*);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  3.54k|    IGRAPH_CHECK_OOM(communities.heap, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  701|  3.54k|    IGRAPH_FINALLY(igraph_free, communities.heap);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  702|       |
  703|  3.54k|    communities.heapindex = IGRAPH_CALLOC(no_of_nodes, igraph_int_t);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  3.54k|    IGRAPH_CHECK_OOM(communities.heapindex, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  705|       |
  706|  3.54k|    IGRAPH_FINALLY_CLEAN(2);
  707|  3.54k|    IGRAPH_FINALLY(igraph_i_fastgreedy_community_list_destroy, &communities);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  708|       |
  709|   158k|    for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (709:17): [True: 154k, False: 3.54k]
  ------------------
  710|   154k|        IGRAPH_CHECK(igraph_vector_ptr_init(&communities.e[i].neis, 0));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  711|   154k|        communities.e[i].id = i;
  712|   154k|        communities.e[i].size = 1;
  713|   154k|    }
  714|       |
  715|       |    /* Create list of community pairs from edges */
  716|  3.54k|    debug("Allocating dq vector\n");
  717|  3.54k|    dq = IGRAPH_CALLOC(no_of_edges, igraph_real_t);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.43k, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|  3.54k|    IGRAPH_CHECK_OOM(dq, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  719|  3.54k|    IGRAPH_FINALLY(igraph_free, dq);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  720|       |
  721|  3.54k|    debug("Creating community pair list\n");
  722|  3.54k|    IGRAPH_CHECK(igraph_eit_create(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  723|  3.54k|    IGRAPH_FINALLY(igraph_eit_destroy, &edgeit);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  724|  3.54k|    pairs = IGRAPH_CALLOC(2 * no_of_edges, igraph_i_fastgreedy_commpair);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.43k, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|  3.54k|    IGRAPH_CHECK_OOM(pairs, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  726|  3.54k|    IGRAPH_FINALLY(igraph_free, pairs);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  727|       |
  728|  3.54k|    loop_weight_sum = 0;
  729|  59.3k|    for (i = 0, j = 0; !IGRAPH_EIT_END(edgeit); i += 2, j++, IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|  59.3k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                  for (i = 0, j = 0; !IGRAPH_EIT_END(edgeit); i += 2, j++, IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  359|  55.8k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (729:24): [True: 55.8k, False: 3.54k]
  ------------------
  730|  55.8k|        igraph_int_t eidx = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|  55.8k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 55.8k, False: 0]
  |  |  ------------------
  |  |  406|  55.8k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  731|       |
  732|       |        /* Create the pairs themselves */
  733|  55.8k|        from = IGRAPH_FROM(graph, eidx); to = IGRAPH_TO(graph, eidx);
  ------------------
  |  |  115|  55.8k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      from = IGRAPH_FROM(graph, eidx); to = IGRAPH_TO(graph, eidx);
  ------------------
  |  |  128|  55.8k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  734|  55.8k|        if (from == to) {
  ------------------
  |  Branch (734:13): [True: 0, False: 55.8k]
  ------------------
  735|      0|            loop_weight_sum += weights ? 2 * VECTOR(*weights)[eidx] : 2;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (735:32): [True: 0, False: 0]
  ------------------
  736|      0|            continue;
  737|      0|        }
  738|       |
  739|  55.8k|        if (from > to) {
  ------------------
  |  Branch (739:13): [True: 55.8k, False: 0]
  ------------------
  740|  55.8k|            dummy = from; from = to; to = dummy;
  741|  55.8k|        }
  742|  55.8k|        if (weights) {
  ------------------
  |  Branch (742:13): [True: 55.8k, False: 0]
  ------------------
  743|  55.8k|            dq[j] = 2 * (VECTOR(*weights)[eidx] / (weight_sum * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * weight_sum * weight_sum));
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          dq[j] = 2 * (VECTOR(*weights)[eidx] / (weight_sum * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * weight_sum * weight_sum));
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          dq[j] = 2 * (VECTOR(*weights)[eidx] / (weight_sum * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * weight_sum * weight_sum));
  ------------------
  |  |   60|  55.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  744|  55.8k|        } else {
  745|      0|            dq[j] = 2 * (1.0 / (no_of_edges * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * no_of_edges * no_of_edges));
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          dq[j] = 2 * (1.0 / (no_of_edges * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * no_of_edges * no_of_edges));
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  746|      0|        }
  747|  55.8k|        pairs[i].first = from;
  748|  55.8k|        pairs[i].second = to;
  749|  55.8k|        pairs[i].dq = &dq[j];
  750|  55.8k|        pairs[i].opposite = &pairs[i + 1];
  751|  55.8k|        pairs[i + 1].first = to;
  752|  55.8k|        pairs[i + 1].second = from;
  753|  55.8k|        pairs[i + 1].dq = pairs[i].dq;
  754|  55.8k|        pairs[i + 1].opposite = &pairs[i];
  755|       |        /* Link the pair to the communities */
  756|  55.8k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[from].neis, &pairs[i]));
  ------------------
  |  |  656|  55.8k|    do { \
  |  |  657|  55.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  55.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  55.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 55.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  55.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 55.8k]
  |  |  ------------------
  ------------------
  757|  55.8k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[to].neis, &pairs[i + 1]));
  ------------------
  |  |  656|  55.8k|    do { \
  |  |  657|  55.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  55.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  55.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 55.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  55.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 55.8k]
  |  |  ------------------
  ------------------
  758|       |        /* Update maximums */
  759|  55.8k|        if (communities.e[from].maxdq == NULL || *communities.e[from].maxdq->dq < *pairs[i].dq) {
  ------------------
  |  Branch (759:13): [True: 13.9k, False: 41.9k]
  |  Branch (759:50): [True: 11.1k, False: 30.8k]
  ------------------
  760|  25.0k|            communities.e[from].maxdq = &pairs[i];
  761|  25.0k|        }
  762|  55.8k|        if (communities.e[to].maxdq == NULL || *communities.e[to].maxdq->dq < *pairs[i + 1].dq) {
  ------------------
  |  Branch (762:13): [True: 35.0k, False: 20.8k]
  |  Branch (762:48): [True: 8.22k, False: 12.6k]
  ------------------
  763|  43.2k|            communities.e[to].maxdq = &pairs[i + 1];
  764|  43.2k|        }
  765|  55.8k|    }
  766|  3.54k|    igraph_eit_destroy(&edgeit);
  767|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  768|       |
  769|       |    /* Sorting community neighbor lists by community IDs */
  770|  3.54k|    debug("Sorting community neighbor lists\n");
  771|   158k|    for (i = 0, j = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (771:24): [True: 154k, False: 3.54k]
  ------------------
  772|   154k|        igraph_i_fastgreedy_community_sort_neighbors_of(&communities, i, NULL);
  773|       |        /* Isolated vertices and vertices with loop edges only won't be stored in
  774|       |         * the heap (to avoid maxdq == NULL) */
  775|   154k|        if (communities.e[i].maxdq != NULL) {
  ------------------
  |  Branch (775:13): [True: 48.9k, False: 106k]
  ------------------
  776|  48.9k|            communities.heap[j] = &communities.e[i];
  777|  48.9k|            communities.heapindex[i] = j;
  778|  48.9k|            j++;
  779|   106k|        } else {
  780|   106k|            communities.heapindex[i] = -1;
  781|   106k|        }
  782|   154k|    }
  783|  3.54k|    communities.no_of_communities = j;
  784|       |
  785|       |    /* Calculate proper vector a (see paper) and initial modularity */
  786|  3.54k|    q = 2.0 * (weights ? weight_sum : no_of_edges);
  ------------------
  |  Branch (786:16): [True: 3.54k, False: 0]
  ------------------
  787|  3.54k|    if (q == 0) {
  ------------------
  |  Branch (787:9): [True: 107, False: 3.43k]
  ------------------
  788|       |        /* All the weights are zero */
  789|  3.43k|    } else {
  790|  3.43k|        igraph_vector_scale(&a, 1.0 / q);
  791|  3.43k|        q = loop_weight_sum / q;
  792|   155k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (792:21): [True: 151k, False: 3.43k]
  ------------------
  793|   151k|            q -= VECTOR(a)[i] * VECTOR(a)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          q -= VECTOR(a)[i] * VECTOR(a)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  794|   151k|        }
  795|  3.43k|    }
  796|       |
  797|       |    /* Initialize "best modularity" value and best merge counter */
  798|  3.54k|    bestq = q;
  799|  3.54k|    best_no_of_joins = 0;
  800|       |
  801|       |    /* Initializing community heap */
  802|  3.54k|    debug("Initializing community heap\n");
  803|  3.54k|    igraph_i_fastgreedy_community_list_build_heap(&communities);
  804|       |
  805|  3.54k|    debug("Initial modularity: %.4f\n", q);
  806|       |
  807|       |    /* Let's rock ;) */
  808|  3.54k|    no_of_joins = 0;
  809|  45.4k|    while (no_of_joins < total_joins) {
  ------------------
  |  Branch (809:12): [True: 44.9k, False: 534]
  ------------------
  810|  44.9k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  44.9k|    do { \
  |  |   47|  44.9k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 44.9k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  44.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 44.9k]
  |  |  ------------------
  ------------------
  811|  44.9k|        IGRAPH_PROGRESS("Fast greedy community detection", no_of_joins * 100.0 / total_joins, 0);
  ------------------
  |  |  169|  44.9k|    do { \
  |  |  170|  44.9k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  44.9k|    do { \
  |  |  |  |  657|  44.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  44.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  44.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 44.9k]
  |  |  ------------------
  ------------------
  812|       |
  813|       |        /* Store the modularity */
  814|  44.9k|        if (modularity) {
  ------------------
  |  Branch (814:13): [True: 44.9k, False: 0]
  ------------------
  815|  44.9k|            VECTOR(*modularity)[no_of_joins] = q;
  ------------------
  |  |   60|  44.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  816|  44.9k|        }
  817|       |
  818|       |        /* Update best modularity if needed */
  819|  44.9k|        if (q >= bestq) {
  ------------------
  |  Branch (819:13): [True: 41.0k, False: 3.87k]
  ------------------
  820|  41.0k|            bestq = q;
  821|  41.0k|            best_no_of_joins = no_of_joins;
  822|  41.0k|        }
  823|       |
  824|       |        /* Some debug info if needed */
  825|       |        /* igraph_i_fastgreedy_community_list_check_heap(&communities); */
  826|       |#ifdef IGRAPH_FASTCOMM_DEBUG
  827|       |        debug("===========================================\n");
  828|       |        for (i = 0; i < communities.n; i++) {
  829|       |            if (communities.e[i].maxdq == 0) {
  830|       |                debug("Community #%ld: PASSIVE\n", i);
  831|       |                continue;
  832|       |            }
  833|       |            debug("Community #%ld\n ", i);
  834|       |            for (j = 0; j < igraph_vector_ptr_size(&communities.e[i].neis); j++) {
  835|       |                p1 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[i].neis)[j];
  836|       |                debug(" (%ld,%ld,%.4f)", p1->first, p1->second, *p1->dq);
  837|       |            }
  838|       |            p1 = communities.e[i].maxdq;
  839|       |            debug("\n  Maxdq: (%ld,%ld,%.4f)\n", p1->first, p1->second, *p1->dq);
  840|       |        }
  841|       |        debug("Global maxdq is: (%ld,%ld,%.4f)\n", communities.heap[0]->maxdq->first,
  842|       |              communities.heap[0]->maxdq->second, *communities.heap[0]->maxdq->dq);
  843|       |        for (i = 0; i < communities.no_of_communities; i++) {
  844|       |            debug("(%ld,%ld,%.4f) ", communities.heap[i]->maxdq->first, communities.heap[i]->maxdq->second, *communities.heap[0]->maxdq->dq);
  845|       |        }
  846|       |        debug("\n");
  847|       |#endif
  848|  44.9k|        if (communities.heap[0] == NULL) {
  ------------------
  |  Branch (848:13): [True: 88, False: 44.8k]
  ------------------
  849|     88|            break;    /* no more communities */
  850|     88|        }
  851|  44.8k|        if (communities.heap[0]->maxdq == NULL) {
  ------------------
  |  Branch (851:13): [True: 2.91k, False: 41.9k]
  ------------------
  852|  2.91k|            break;    /* there are only isolated comms */
  853|  2.91k|        }
  854|  41.9k|        to = communities.heap[0]->maxdq->second;
  855|  41.9k|        from = communities.heap[0]->maxdq->first;
  856|       |
  857|  41.9k|        debug("Q[%ld] = %.7f\tdQ = %.7f\t |H| = %ld\n",
  858|  41.9k|              no_of_joins, q, *communities.heap[0]->maxdq->dq, no_of_nodes - no_of_joins - 1);
  859|       |
  860|       |        /* IGRAPH_FASTCOMM_DEBUG */
  861|       |        /* from=join_order[no_of_joins*2]; to=join_order[no_of_joins*2+1];
  862|       |        if (to == -1) break;
  863|       |        for (i=0; i<igraph_vector_ptr_size(&communities.e[to].neis); i++) {
  864|       |          p1=(igraph_i_fastgreedy_commpair*)VECTOR(communities.e[to].neis)[i];
  865|       |          if (p1->second == from) communities.maxdq = p1;
  866|       |        } */
  867|       |
  868|  41.9k|        n = igraph_vector_ptr_size(&communities.e[to].neis);
  869|  41.9k|        m = igraph_vector_ptr_size(&communities.e[from].neis);
  870|       |        /*if (n>m) {
  871|       |          dummy=n; n=m; m=dummy;
  872|       |          dummy=to; to=from; from=dummy;
  873|       |        }*/
  874|  41.9k|        debug("  joining: %ld <- %ld\n", to, from);
  875|  41.9k|        q += *communities.heap[0]->maxdq->dq;
  876|       |
  877|       |        /* Merge the second community into the first */
  878|  41.9k|        i = j = 0;
  879|   241k|        while (i < n && j < m) {
  ------------------
  |  Branch (879:16): [True: 220k, False: 20.7k]
  |  Branch (879:25): [True: 199k, False: 21.1k]
  ------------------
  880|   199k|            p1 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[to].neis)[i];
  ------------------
  |  |   60|   199k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  881|   199k|            p2 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[from].neis)[j];
  ------------------
  |  |   60|   199k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  882|   199k|            debug("Pairs: %" IGRAPH_PRId "-%" IGRAPH_PRId " and %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second,
  883|   199k|                  p2->first, p2->second);
  884|   199k|            if (p1->second < p2->second) {
  ------------------
  |  Branch (884:17): [True: 100k, False: 99.3k]
  ------------------
  885|       |                /* Considering p1 from now on */
  886|   100k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second);
  887|   100k|                if (p1->second == from) {
  ------------------
  |  Branch (887:21): [True: 28.4k, False: 71.9k]
  ------------------
  888|  28.4k|                    debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", to, from);
  889|  71.9k|                } else {
  890|       |                    /* chain, case 1 */
  891|  71.9k|                    debug("    CHAIN(1): %ld-%ld %ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  892|  71.9k|                          to, p1->second, from, *p1->dq, -2 * VECTOR(a)[from]*VECTOR(a)[p1->second], p1->first, p1->second, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  893|  71.9k|                    igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  71.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  71.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  894|  71.9k|                }
  895|   100k|                i++;
  896|   100k|            } else if (p1->second == p2->second) {
  ------------------
  |  Branch (896:24): [True: 13.8k, False: 85.4k]
  ------------------
  897|       |                /* p1->first, p1->second and p2->first form a triangle */
  898|  13.8k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId " and %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second,
  899|  13.8k|                      p2->first, p2->second);
  900|       |                /* Update dq value */
  901|  13.8k|                debug("    TRIANGLE: %ld-%ld-%ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  902|  13.8k|                      to, p1->second, from, *p1->dq, *p2->dq, p1->first, p1->second, *p1->dq + *p2->dq);
  903|  13.8k|                igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq + *p2->dq);
  904|  13.8k|                igraph_i_fastgreedy_community_remove_nei(&communities, p1->second, from);
  905|  13.8k|                i++;
  906|  13.8k|                j++;
  907|  85.4k|            } else {
  908|  85.4k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p2->first, p2->second);
  909|  85.4k|                if (p2->second == to) {
  ------------------
  |  Branch (909:21): [True: 27.5k, False: 57.8k]
  ------------------
  910|  27.5k|                    debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p2->second, p2->first);
  911|  57.8k|                } else {
  912|       |                    /* chain, case 2 */
  913|  57.8k|                    debug("    CHAIN(2): %ld %ld-%ld, newdq(%ld,%ld)=%.7f\n",
  914|  57.8k|                          to, p2->second, from, to, p2->second, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  915|  57.8k|                    p2->opposite->second = to;
  916|       |                    /* p2->opposite->second changed, so it means that
  917|       |                     * communities.e[p2->second].neis (which contains p2->opposite) is
  918|       |                     * not sorted anymore. We have to find the index of p2->opposite in
  919|       |                     * this vector and move it to the correct place. Moving should be an
  920|       |                     * O(n) operation; re-sorting would be O(n*logn) or even worse,
  921|       |                     * depending on the pivoting strategy used by qsort() since the
  922|       |                     * vector is nearly sorted */
  923|  57.8k|                    igraph_i_fastgreedy_community_sort_neighbors_of(
  924|  57.8k|                        &communities, p2->second, p2->opposite);
  925|       |                    /* link from.neis[j] to the current place in to.neis if
  926|       |                     * from.neis[j] != to */
  927|  57.8k|                    p2->first = to;
  928|  57.8k|                    IGRAPH_CHECK(igraph_vector_ptr_insert(&communities.e[to].neis, i, p2));
  ------------------
  |  |  656|  57.8k|    do { \
  |  |  657|  57.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  57.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  57.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 57.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  57.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 57.8k]
  |  |  ------------------
  ------------------
  929|  57.8k|                    n++; i++;
  930|  57.8k|                    if (*p2->dq > *communities.e[to].maxdq->dq) {
  ------------------
  |  Branch (930:25): [True: 100, False: 57.7k]
  ------------------
  931|    100|                        communities.e[to].maxdq = p2;
  932|    100|                        k = igraph_i_fastgreedy_community_list_find_in_heap(&communities, to);
  ------------------
  |  |  222|    100|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  933|    100|                        igraph_i_fastgreedy_community_list_sift_up(&communities, k);
  934|    100|                    }
  935|  57.8k|                    igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  57.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  57.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  936|  57.8k|                }
  937|  85.4k|                j++;
  938|  85.4k|            }
  939|   199k|        }
  940|       |
  941|  41.9k|        p1 = NULL;
  942|   110k|        while (i < n) {
  ------------------
  |  Branch (942:16): [True: 68.9k, False: 41.9k]
  ------------------
  943|  68.9k|            p1 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[to].neis)[i];
  ------------------
  |  |   60|  68.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  944|  68.9k|            if (p1->second == from) {
  ------------------
  |  Branch (944:17): [True: 13.4k, False: 55.4k]
  ------------------
  945|  13.4k|                debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, from);
  946|  55.4k|            } else {
  947|       |                /* chain, case 1 */
  948|  55.4k|                debug("    CHAIN(1): %ld-%ld %ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  949|  55.4k|                      to, p1->second, from, *p1->dq, -2 * VECTOR(a)[from]*VECTOR(a)[p1->second], p1->first, p1->second, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  950|  55.4k|                igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  55.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  55.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  951|  55.4k|            }
  952|  68.9k|            i++;
  953|  68.9k|        }
  954|   103k|        while (j < m) {
  ------------------
  |  Branch (954:16): [True: 61.7k, False: 41.9k]
  ------------------
  955|  61.7k|            p2 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[from].neis)[j];
  ------------------
  |  |   60|  61.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  956|  61.7k|            if (to == p2->second) {
  ------------------
  |  Branch (956:17): [True: 14.3k, False: 47.3k]
  ------------------
  957|  14.3k|                j++;
  958|  14.3k|                continue;
  959|  14.3k|            }
  960|       |            /* chain, case 2 */
  961|  47.3k|            debug("    CHAIN(2): %ld %ld-%ld, newdq(%ld,%ld)=%.7f\n",
  962|  47.3k|                  to, p2->second, from, p1 ? p1->first : -1, p2->second, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  963|  47.3k|            p2->opposite->second = to;
  964|       |            /* need to re-sort community nei list `p2->second` */
  965|  47.3k|            igraph_i_fastgreedy_community_sort_neighbors_of(&communities, p2->second, p2->opposite);
  966|       |            /* link from.neis[j] to the current place in to.neis if
  967|       |             * from.neis[j] != to */
  968|  47.3k|            p2->first = to;
  969|  47.3k|            IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[to].neis, p2));
  ------------------
  |  |  656|  47.3k|    do { \
  |  |  657|  47.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  47.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  47.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  47.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 47.3k]
  |  |  ------------------
  ------------------
  970|  47.3k|            if (*p2->dq > *communities.e[to].maxdq->dq) {
  ------------------
  |  Branch (970:17): [True: 31, False: 47.3k]
  ------------------
  971|     31|                communities.e[to].maxdq = p2;
  972|     31|                k = igraph_i_fastgreedy_community_list_find_in_heap(&communities, to);
  ------------------
  |  |  222|     31|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  973|     31|                igraph_i_fastgreedy_community_list_sift_up(&communities, k);
  974|     31|            }
  975|  47.3k|            igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  47.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  47.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  976|  47.3k|            j++;
  977|  47.3k|        }
  978|       |
  979|       |        /* Now, remove community `from` from the neighbors of community `to` */
  980|  41.9k|        if (communities.no_of_communities > 2) {
  ------------------
  |  Branch (980:13): [True: 38.5k, False: 3.43k]
  ------------------
  981|  38.5k|            debug("    REMOVING: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", to, from);
  982|  38.5k|            igraph_i_fastgreedy_community_remove_nei(&communities, to, from);
  983|  38.5k|            i = igraph_i_fastgreedy_community_list_find_in_heap(&communities, from);
  ------------------
  |  |  222|  38.5k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  984|  38.5k|            igraph_i_fastgreedy_community_list_remove(&communities, i);
  985|  38.5k|        }
  986|  41.9k|        communities.e[from].maxdq = NULL;
  987|       |
  988|       |        /* Update community sizes */
  989|  41.9k|        communities.e[to].size += communities.e[from].size;
  990|  41.9k|        communities.e[from].size = 0;
  991|       |
  992|       |        /* record what has been merged */
  993|       |        /* igraph_vector_ptr_clear is not enough here as it won't free
  994|       |         * the memory consumed by communities.e[from].neis. Thanks
  995|       |         * to Tom Gregorovic for pointing that out. */
  996|  41.9k|        igraph_vector_ptr_destroy(&communities.e[from].neis);
  997|  41.9k|        if (merges) {
  ------------------
  |  Branch (997:13): [True: 41.9k, False: 0]
  ------------------
  998|  41.9k|            MATRIX(*merges, no_of_joins, 0) = communities.e[to].id;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  999|  41.9k|            MATRIX(*merges, no_of_joins, 1) = communities.e[from].id;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
 1000|  41.9k|            communities.e[to].id = no_of_nodes + no_of_joins;
 1001|  41.9k|        }
 1002|       |
 1003|       |        /* Update vector a */
 1004|  41.9k|        VECTOR(a)[to] += VECTOR(a)[from];
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(a)[to] += VECTOR(a)[from];
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1005|  41.9k|        VECTOR(a)[from] = 0.0;
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1006|       |
 1007|  41.9k|        no_of_joins++;
 1008|  41.9k|    }
 1009|       |    /* TODO: continue merging when some isolated communities remained. Always
 1010|       |     * joining the communities with the least number of nodes results in the
 1011|       |     * smallest decrease in modularity every step. Now we're simply deleting
 1012|       |     * the excess rows from the merge matrix */
 1013|  3.54k|    if (merges != NULL) {
  ------------------
  |  Branch (1013:9): [True: 3.54k, False: 0]
  ------------------
 1014|  3.54k|        if (no_of_joins < total_joins) {
  ------------------
  |  Branch (1014:13): [True: 3.00k, False: 534]
  ------------------
 1015|  3.00k|            igraph_int_t *ivec;
 1016|  3.00k|            igraph_int_t merges_nrow = igraph_matrix_int_nrow(merges);
 1017|       |
 1018|  3.00k|            ivec = IGRAPH_CALLOC(merges_nrow, igraph_int_t);
  ------------------
  |  |   33|  3.00k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.01k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.00k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.00k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1019|  3.00k|            IGRAPH_CHECK_OOM(ivec, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.00k|    do { \
  |  |  710|  3.00k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.00k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.00k]
  |  |  ------------------
  ------------------
 1020|  3.00k|            IGRAPH_FINALLY(igraph_free, ivec);
  ------------------
  |  |  603|  3.00k|    do { \
  |  |  604|  3.00k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.00k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.00k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.00k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.00k]
  |  |  ------------------
  |  |  608|  3.00k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.00k]
  |  |  ------------------
  ------------------
 1021|       |
 1022|  40.3k|            for (i = 0; i < no_of_joins; i++) {
  ------------------
  |  Branch (1022:25): [True: 37.3k, False: 3.00k]
  ------------------
 1023|  37.3k|                ivec[i] = i + 1;
 1024|  37.3k|            }
 1025|       |
 1026|  3.00k|            igraph_matrix_int_permdelete_rows(merges, ivec, total_joins - no_of_joins);
 1027|       |
 1028|  3.00k|            IGRAPH_FREE(ivec);
  ------------------
  |  |   36|  3.00k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1029|  3.00k|            IGRAPH_FINALLY_CLEAN(1);
 1030|  3.00k|        }
 1031|  3.54k|    }
 1032|  3.54k|    IGRAPH_PROGRESS("Fast greedy community detection", 100.0, 0);
  ------------------
  |  |  169|  3.54k|    do { \
  |  |  170|  3.54k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1033|       |
 1034|  3.54k|    if (modularity) {
  ------------------
  |  Branch (1034:9): [True: 3.54k, False: 0]
  ------------------
 1035|  3.54k|        VECTOR(*modularity)[no_of_joins] = q;
  ------------------
  |  |   60|  3.54k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1036|  3.54k|        IGRAPH_CHECK(igraph_vector_resize(modularity, no_of_joins + 1));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1037|  3.54k|    }
 1038|       |
 1039|       |    /* Internally, the algorithm does not create NaN values.
 1040|       |     * If the graph has no edges, the final modularity will be zero.
 1041|       |     * We change this to NaN for consistency. */
 1042|  3.54k|    if (modularity && no_of_edges == 0) {
  ------------------
  |  Branch (1042:9): [True: 3.54k, False: 0]
  |  Branch (1042:23): [True: 107, False: 3.43k]
  ------------------
 1043|    107|        IGRAPH_ASSERT(no_of_joins == 0);
  ------------------
  |  |  924|    107|    do { \
  |  |  925|    107|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
 1044|    107|        VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |   60|    107|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |  138|    107|#define IGRAPH_NAN ((double)NAN)
  ------------------
 1045|    107|    }
 1046|       |
 1047|  3.54k|    debug("Freeing memory\n");
 1048|  3.54k|    IGRAPH_FREE(pairs);
  ------------------
  |  |   36|  3.54k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1049|  3.54k|    IGRAPH_FREE(dq);
  ------------------
  |  |   36|  3.54k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1050|  3.54k|    igraph_i_fastgreedy_community_list_destroy(&communities);
 1051|  3.54k|    igraph_vector_destroy(&a);
 1052|  3.54k|    IGRAPH_FINALLY_CLEAN(4);
 1053|       |
 1054|  3.54k|    if (membership) {
  ------------------
  |  Branch (1054:9): [True: 3.54k, False: 0]
  ------------------
 1055|  3.54k|        IGRAPH_CHECK(igraph_community_to_membership(merges,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1056|  3.54k|                     no_of_nodes,
 1057|  3.54k|                     /*steps=*/ best_no_of_joins,
 1058|  3.54k|                     membership,
 1059|  3.54k|                     /*csize=*/ NULL));
 1060|  3.54k|    }
 1061|       |
 1062|  3.54k|    if (merges == &merges_local) {
  ------------------
  |  Branch (1062:9): [True: 0, False: 3.54k]
  ------------------
 1063|      0|        igraph_matrix_int_destroy(&merges_local);
 1064|      0|        IGRAPH_FINALLY_CLEAN(1);
 1065|      0|    }
 1066|       |
 1067|  3.54k|    return IGRAPH_SUCCESS;
 1068|  3.54k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_destroy:
  131|  3.54k|        igraph_i_fastgreedy_community_list *list) {
  132|  3.54k|    igraph_int_t i;
  133|   158k|    for (i = 0; i < list->n; i++) {
  ------------------
  |  Branch (133:17): [True: 154k, False: 3.54k]
  ------------------
  134|   154k|        igraph_vector_ptr_destroy(&list->e[i].neis);
  135|   154k|    }
  136|  3.54k|    IGRAPH_FREE(list->e);
  ------------------
  |  |   36|  3.54k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  137|  3.54k|    if (list->heapindex != NULL) {
  ------------------
  |  Branch (137:9): [True: 3.54k, False: 0]
  ------------------
  138|  3.54k|        IGRAPH_FREE(list->heapindex);
  ------------------
  |  |   36|  3.54k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  139|  3.54k|    }
  140|  3.54k|    if (list->heap != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.54k, False: 0]
  ------------------
  141|       |        IGRAPH_FREE(list->heap);
  ------------------
  |  |   36|  3.54k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  142|  3.54k|    }
  143|  3.54k|}
fast_modularity.c:igraph_i_fastgreedy_community_sort_neighbors_of:
  378|   260k|        igraph_i_fastgreedy_commpair *changed_pair) {
  379|   260k|    igraph_vector_ptr_t *vec;
  380|   260k|    igraph_int_t i, n;
  381|   260k|    igraph_bool_t can_skip_sort = false;
  382|   260k|    igraph_i_fastgreedy_commpair *other_pair;
  383|       |
  384|   260k|    vec = &list->e[index].neis;
  385|   260k|    if (changed_pair != NULL) {
  ------------------
  |  Branch (385:9): [True: 105k, False: 154k]
  ------------------
  386|       |        /* Optimized sorting */
  387|       |
  388|       |        /* First we look for changed_pair in vec */
  389|   105k|        n = igraph_vector_ptr_size(vec);
  390|   191k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (390:21): [True: 191k, False: 0]
  ------------------
  391|   191k|            if (VECTOR(*vec)[i] == changed_pair) {
  ------------------
  |  |   60|   191k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (391:17): [True: 105k, False: 85.7k]
  ------------------
  392|   105k|                break;
  393|   105k|            }
  394|   191k|        }
  395|       |
  396|       |        /* Did we find it? We should have -- otherwise it's a bug */
  397|   105k|        IGRAPH_ASSERT(i < n);
  ------------------
  |  |  924|   105k|    do { \
  |  |  925|   105k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   105k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  398|       |
  399|       |        /* Okay, the pair that changed is at index i. We need to figure out where
  400|       |         * its new place should be. We can simply try moving the item all the way
  401|       |         * to the left as long as the comparison function tells so (since the
  402|       |         * rest of the vector is sorted), and then move all the way to the right
  403|       |         * as long as the comparison function tells so, and we will be okay. */
  404|       |
  405|       |        /* Shifting to the left */
  406|   129k|        while (i > 0) {
  ------------------
  |  Branch (406:16): [True: 48.1k, False: 81.7k]
  ------------------
  407|  48.1k|            other_pair = VECTOR(*vec)[i - 1];
  ------------------
  |  |   60|  48.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  408|  48.1k|            if (other_pair->second > changed_pair->second) {
  ------------------
  |  Branch (408:17): [True: 24.7k, False: 23.4k]
  ------------------
  409|  24.7k|                VECTOR(*vec)[i] = other_pair;
  ------------------
  |  |   60|  24.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  410|  24.7k|                i--;
  411|  24.7k|            } else {
  412|  23.4k|                break;
  413|  23.4k|            }
  414|  48.1k|        }
  415|   105k|        VECTOR(*vec)[i] = changed_pair;
  ------------------
  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  416|       |
  417|       |        /* Shifting to the right */
  418|   136k|        while (i < n - 1) {
  ------------------
  |  Branch (418:16): [True: 61.5k, False: 74.5k]
  ------------------
  419|  61.5k|            other_pair = VECTOR(*vec)[i + 1];
  ------------------
  |  |   60|  61.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  420|  61.5k|            if (other_pair->second < changed_pair->second) {
  ------------------
  |  Branch (420:17): [True: 30.9k, False: 30.6k]
  ------------------
  421|  30.9k|                VECTOR(*vec)[i] = other_pair;
  ------------------
  |  |   60|  30.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  422|  30.9k|                i++;
  423|  30.9k|            } else {
  424|  30.6k|                break;
  425|  30.6k|            }
  426|  61.5k|        }
  427|   105k|        VECTOR(*vec)[i] = changed_pair;
  ------------------
  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  428|       |
  429|       |        /* Mark that we don't need a full sort */
  430|   105k|        can_skip_sort = true;
  431|   105k|    }
  432|       |
  433|   260k|    if (!can_skip_sort) {
  ------------------
  |  Branch (433:9): [True: 154k, False: 105k]
  ------------------
  434|       |        /* Fallback to full sorting */
  435|   154k|        igraph_vector_ptr_sort(vec, igraph_i_fastgreedy_commpair_cmp);
  436|   154k|    }
  437|   260k|}
fast_modularity.c:igraph_i_fastgreedy_commpair_cmp:
  364|   121k|static int igraph_i_fastgreedy_commpair_cmp(const void *p1, const void *p2) {
  365|   121k|    igraph_i_fastgreedy_commpair *cp1, *cp2;
  366|   121k|    igraph_int_t diff;
  367|   121k|    cp1 = *(igraph_i_fastgreedy_commpair**)p1;
  368|   121k|    cp2 = *(igraph_i_fastgreedy_commpair**)p2;
  369|   121k|    diff = cp1->second - cp2->second;
  370|   121k|    return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
  ------------------
  |  Branch (370:12): [True: 77.0k, False: 44.8k]
  |  Branch (370:30): [True: 44.8k, False: 0]
  ------------------
  371|   121k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_build_heap:
  213|  3.54k|        igraph_i_fastgreedy_community_list *list) {
  214|  3.54k|    igraph_int_t i;
  215|  27.2k|    for (i = list->no_of_communities / 2 - 1; i >= 0; i--) {
  ------------------
  |  Branch (215:47): [True: 23.6k, False: 3.54k]
  ------------------
  216|  23.6k|        igraph_i_fastgreedy_community_list_sift_down(list, i);
  217|  23.6k|    }
  218|  3.54k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_sift_down:
  147|   299k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  148|   299k|    igraph_int_t root, child, c1, c2;
  149|   299k|    igraph_i_fastgreedy_community *dummy;
  150|   299k|    igraph_int_t dummy2;
  151|   299k|    igraph_i_fastgreedy_community** heap = list->heap;
  152|   299k|    igraph_int_t *heapindex = list->heapindex;
  153|       |
  154|   299k|    root = idx;
  155|   461k|    while (root * 2 + 1 < list->no_of_communities) {
  ------------------
  |  Branch (155:12): [True: 300k, False: 161k]
  ------------------
  156|   300k|        child = root * 2 + 1;
  157|   300k|        if (child + 1 < list->no_of_communities &&
  ------------------
  |  Branch (157:13): [True: 279k, False: 21.5k]
  ------------------
  158|   279k|            *heap[child]->maxdq->dq < *heap[child + 1]->maxdq->dq) {
  ------------------
  |  Branch (158:13): [True: 104k, False: 174k]
  ------------------
  159|   104k|            child++;
  160|   104k|        }
  161|   300k|        if (*heap[root]->maxdq->dq < *heap[child]->maxdq->dq) {
  ------------------
  |  Branch (161:13): [True: 162k, False: 138k]
  ------------------
  162|   162k|            c1 = heap[root]->maxdq->first;
  163|   162k|            c2 = heap[child]->maxdq->first;
  164|       |
  165|   162k|            dummy = heap[root];
  166|   162k|            heap[root] = heap[child];
  167|   162k|            heap[child] = dummy;
  168|       |
  169|   162k|            dummy2 = heapindex[c1];
  170|   162k|            heapindex[c1] = heapindex[c2];
  171|   162k|            heapindex[c2] = dummy2;
  172|       |
  173|   162k|            root = child;
  174|   162k|        } else {
  175|   138k|            break;
  176|   138k|        }
  177|   300k|    }
  178|   299k|}
fast_modularity.c:igraph_i_fastgreedy_community_update_dq:
  445|   246k|        igraph_i_fastgreedy_commpair *p, igraph_real_t newdq) {
  446|       |
  447|   246k|    igraph_int_t i, j, to, from;
  448|   246k|    igraph_real_t olddq;
  449|   246k|    igraph_i_fastgreedy_community *comm_to, *comm_from;
  450|   246k|    to = p->first; from = p->second;
  451|   246k|    comm_to = &list->e[to];
  452|   246k|    comm_from = &list->e[from];
  453|   246k|    if (comm_to->maxdq == p && newdq >= *p->dq) {
  ------------------
  |  Branch (453:9): [True: 8.72k, False: 237k]
  |  Branch (453:32): [True: 106, False: 8.61k]
  ------------------
  454|       |        /* If we are adjusting the current maximum and it is increased, we don't
  455|       |         * have to re-scan for the new maximum */
  456|    106|        *p->dq = newdq;
  457|       |        /* The maximum was increased, so perform a sift-up in the heap */
  458|    106|        i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|    106|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  459|    106|        igraph_i_fastgreedy_community_list_sift_up(list, i);
  460|       |        /* Let's check the opposite side. If the pair was not the maximal in
  461|       |         * the opposite side (the other community list)... */
  462|    106|        if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (462:13): [True: 35, False: 71]
  ------------------
  463|     35|            if (*comm_from->maxdq->dq < newdq) {
  ------------------
  |  Branch (463:17): [True: 27, False: 8]
  ------------------
  464|       |                /* ...and it will become the maximal, we need to adjust and sift up */
  465|     27|                comm_from->maxdq = p->opposite;
  466|     27|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|     27|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  467|     27|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  468|     27|            } else {
  469|       |                /* The pair was not the maximal in the opposite side and it will
  470|       |                 * NOT become the maximal, there's nothing to do there */
  471|      8|            }
  472|     71|        } else {
  473|       |            /* The pair was maximal in the opposite side, so we need to sift it up
  474|       |             * with the new value */
  475|     71|            j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|     71|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  476|     71|            igraph_i_fastgreedy_community_list_sift_up(list, j);
  477|     71|        }
  478|    106|        return true;
  479|   246k|    } else if (comm_to->maxdq != p && (newdq <= *comm_to->maxdq->dq)) {
  ------------------
  |  Branch (479:16): [True: 237k, False: 8.61k]
  |  Branch (479:39): [True: 236k, False: 860]
  ------------------
  480|       |        /* If we are modifying an item which is not the current maximum, and the
  481|       |         * new value is less than the current maximum, we don't
  482|       |         * have to re-scan for the new maximum */
  483|   236k|        olddq = *p->dq;
  484|   236k|        *p->dq = newdq;
  485|       |        /* However, if the item was the maximum on the opposite side, we'd better
  486|       |         * re-scan it */
  487|   236k|        if (comm_from->maxdq == p->opposite) {
  ------------------
  |  Branch (487:13): [True: 159k, False: 77.7k]
  ------------------
  488|   159k|            if (olddq > newdq) {
  ------------------
  |  Branch (488:17): [True: 158k, False: 387]
  ------------------
  489|       |                /* Decreased the maximum on the other side, we have to re-scan for the
  490|       |                 * new maximum */
  491|   158k|                igraph_i_fastgreedy_community_rescan_max(comm_from);
  492|   158k|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|   158k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  493|   158k|                igraph_i_fastgreedy_community_list_sift_down(list, j);
  494|   158k|            } else {
  495|       |                /* Increased the maximum on the other side, we don't have to re-scan
  496|       |                 * but we might have to sift up */
  497|    387|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    387|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  498|    387|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  499|    387|            }
  500|   159k|        }
  501|   236k|        return false;
  502|   236k|    } else {
  503|       |        /* We got here in two cases:
  504|       |         (1) the pair we are modifying right now is the maximum in the given
  505|       |             community and we are decreasing it
  506|       |         (2) the pair we are modifying right now is NOT the maximum in the
  507|       |             given community, but we increase it so much that it will become
  508|       |             the new maximum
  509|       |         */
  510|  9.47k|        *p->dq = newdq;
  511|  9.47k|        if (comm_to->maxdq != p) {
  ------------------
  |  Branch (511:13): [True: 860, False: 8.61k]
  ------------------
  512|       |            /* case (2) */
  513|    860|            comm_to->maxdq = p;
  514|       |            /* The maximum was increased, so perform a sift-up in the heap */
  515|    860|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|    860|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  516|    860|            igraph_i_fastgreedy_community_list_sift_up(list, i);
  517|       |            /* Opposite side. Chances are that the new value became the maximum
  518|       |             * in the opposite side, but check it first */
  519|    860|            if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (519:17): [True: 553, False: 307]
  ------------------
  520|    553|                if (*comm_from->maxdq->dq < newdq) {
  ------------------
  |  Branch (520:21): [True: 536, False: 17]
  ------------------
  521|       |                    /* Yes, it will become the new maximum */
  522|    536|                    comm_from->maxdq = p->opposite;
  523|    536|                    j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    536|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  524|    536|                    igraph_i_fastgreedy_community_list_sift_up(list, j);
  525|    536|                } else {
  526|       |                    /* No, nothing to do there */
  527|     17|                }
  528|    553|            } else {
  529|       |                /* Already increased the maximum on the opposite side, so sift it up */
  530|    307|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    307|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  531|    307|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  532|    307|            }
  533|  8.61k|        } else {
  534|       |            /* case (1) */
  535|       |            /* This is the worst, we have to re-scan the whole community to find
  536|       |             * the new maximum and update the global maximum as well if necessary */
  537|  8.61k|            igraph_i_fastgreedy_community_rescan_max(comm_to);
  538|       |            /* The maximum was decreased, so perform a sift-down in the heap */
  539|  8.61k|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|  8.61k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  540|  8.61k|            igraph_i_fastgreedy_community_list_sift_down(list, i);
  541|  8.61k|            if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (541:17): [True: 141, False: 8.47k]
  ------------------
  542|       |                /* The one that we decreased on the opposite side is not the
  543|       |                 * maximal one. Nothing to do. */
  544|  8.47k|            } else {
  545|       |                /* We decreased the maximal on the opposite side as well. Re-scan
  546|       |                 * and sift down */
  547|  8.47k|                igraph_i_fastgreedy_community_rescan_max(comm_from);
  548|  8.47k|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|  8.47k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  549|  8.47k|                igraph_i_fastgreedy_community_list_sift_down(list, j);
  550|  8.47k|            }
  551|  8.61k|        }
  552|  9.47k|    }
  553|  9.47k|    return true;
  554|   246k|}
fast_modularity.c:igraph_i_fastgreedy_community_rescan_max:
   99|   216k|static igraph_bool_t igraph_i_fastgreedy_community_rescan_max(igraph_i_fastgreedy_community *comm) {
  100|   216k|    igraph_int_t i, n;
  101|   216k|    igraph_i_fastgreedy_commpair *p, *best;
  102|   216k|    igraph_real_t bestdq, currdq;
  103|       |
  104|   216k|    n = igraph_vector_ptr_size(&comm->neis);
  105|   216k|    if (n == 0) {
  ------------------
  |  Branch (105:9): [True: 3.53k, False: 212k]
  ------------------
  106|  3.53k|        comm->maxdq = NULL;
  107|  3.53k|        return true;
  108|  3.53k|    }
  109|       |
  110|   212k|    best = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[0];
  ------------------
  |  |   60|   212k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  111|   212k|    bestdq = *best->dq;
  112|   561k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (112:17): [True: 348k, False: 212k]
  ------------------
  113|   348k|        p = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[i];
  ------------------
  |  |   60|   348k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  114|   348k|        currdq = *p->dq;
  115|   348k|        if (currdq > bestdq) {
  ------------------
  |  Branch (115:13): [True: 66.2k, False: 282k]
  ------------------
  116|  66.2k|            best = p;
  117|  66.2k|            bestdq = currdq;
  118|  66.2k|        }
  119|   348k|    }
  120|       |
  121|   212k|    if (best != comm->maxdq) {
  ------------------
  |  Branch (121:9): [True: 50.6k, False: 162k]
  ------------------
  122|  50.6k|        comm->maxdq = best;
  123|  50.6k|        return true;
  124|   162k|    } else {
  125|       |        return false;
  126|   162k|    }
  127|   212k|}
fast_modularity.c:igraph_i_fastgreedy_community_remove_nei:
  321|  52.4k|        igraph_i_fastgreedy_community_list *list, igraph_int_t c, igraph_int_t k) {
  322|  52.4k|    igraph_int_t i, n;
  323|  52.4k|    igraph_bool_t rescan = false;
  324|  52.4k|    igraph_i_fastgreedy_commpair *p;
  325|  52.4k|    igraph_i_fastgreedy_community *comm;
  326|  52.4k|    igraph_real_t olddq;
  327|       |
  328|  52.4k|    comm = &list->e[c];
  329|  52.4k|    n = igraph_vector_ptr_size(&comm->neis);
  330|   219k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (330:17): [True: 219k, False: 0]
  ------------------
  331|   219k|        p = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[i];
  ------------------
  |  |   60|   219k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  332|   219k|        if (p->second == k) {
  ------------------
  |  Branch (332:13): [True: 52.4k, False: 167k]
  ------------------
  333|       |            /* Check current maxdq */
  334|  52.4k|            if (comm->maxdq == p) {
  ------------------
  |  Branch (334:17): [True: 40.4k, False: 11.9k]
  ------------------
  335|  40.4k|                rescan = true;
  336|  40.4k|            }
  337|  52.4k|            break;
  338|  52.4k|        }
  339|   219k|    }
  340|  52.4k|    if (i < n) {
  ------------------
  |  Branch (340:9): [True: 52.4k, False: 0]
  ------------------
  341|  52.4k|        olddq = *comm->maxdq->dq;
  342|  52.4k|        igraph_vector_ptr_remove(&comm->neis, i);
  343|  52.4k|        if (rescan) {
  ------------------
  |  Branch (343:13): [True: 40.4k, False: 11.9k]
  ------------------
  344|  40.4k|            igraph_i_fastgreedy_community_rescan_max(comm);
  345|  40.4k|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, c);
  ------------------
  |  |  222|  40.4k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  346|  40.4k|            if (comm->maxdq) {
  ------------------
  |  Branch (346:17): [True: 36.8k, False: 3.53k]
  ------------------
  347|  36.8k|                if (*comm->maxdq->dq > olddq) {
  ------------------
  |  Branch (347:21): [True: 351, False: 36.5k]
  ------------------
  348|    351|                    igraph_i_fastgreedy_community_list_sift_up(list, i);
  349|  36.5k|                } else {
  350|  36.5k|                    igraph_i_fastgreedy_community_list_sift_down(list, i);
  351|  36.5k|                }
  352|  36.8k|            } else {
  353|       |                /* no more neighbors for this community. we should remove this
  354|       |                 * community from the heap and restore the heap property */
  355|  3.53k|                debug("REMOVING (NO MORE NEIS): %" IGRAPH_PRId "\n", i);
  356|  3.53k|                igraph_i_fastgreedy_community_list_remove2(list, i, c);
  357|  3.53k|            }
  358|  40.4k|        }
  359|  52.4k|    }
  360|  52.4k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_remove2:
  292|  3.53k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx, igraph_int_t comm) {
  293|  3.53k|    igraph_int_t i;
  294|       |
  295|  3.53k|    if (idx == list->no_of_communities - 1) {
  ------------------
  |  Branch (295:9): [True: 66, False: 3.46k]
  ------------------
  296|       |        /* We removed the rightmost element on the bottom level, no problem,
  297|       |         * there's nothing to be done */
  298|     66|        list->heapindex[comm] = -1;
  299|     66|        list->no_of_communities--;
  300|     66|        return;
  301|     66|    }
  302|       |
  303|       |    /* First adjust the index */
  304|  3.46k|    i = list->heap[list->no_of_communities - 1]->maxdq->first;
  305|  3.46k|    list->heapindex[i] = idx;
  306|  3.46k|    list->heapindex[comm] = -1;
  307|       |
  308|       |    /* Now remove the element */
  309|  3.46k|    list->heap[idx] = list->heap[list->no_of_communities - 1];
  310|  3.46k|    list->no_of_communities--;
  311|       |
  312|       |    /* Recover heap property */
  313|  28.6k|    for (i = list->no_of_communities / 2 - 1; i >= 0; i--) {
  ------------------
  |  Branch (313:47): [True: 25.1k, False: 3.46k]
  ------------------
  314|  25.1k|        igraph_i_fastgreedy_community_list_sift_down(list, i);
  315|  25.1k|    }
  316|  3.46k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_sift_up:
  182|  3.10k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  183|  3.10k|    igraph_int_t root, parent, c1, c2;
  184|  3.10k|    igraph_i_fastgreedy_community *dummy;
  185|  3.10k|    igraph_int_t dummy2;
  186|  3.10k|    igraph_i_fastgreedy_community** heap = list->heap;
  187|  3.10k|    igraph_int_t *heapindex = list->heapindex;
  188|       |
  189|  3.10k|    root = idx;
  190|  6.02k|    while (root > 0) {
  ------------------
  |  Branch (190:12): [True: 4.80k, False: 1.21k]
  ------------------
  191|  4.80k|        parent = (root - 1) / 2;
  192|  4.80k|        if (*heap[parent]->maxdq->dq < *heap[root]->maxdq->dq) {
  ------------------
  |  Branch (192:13): [True: 2.91k, False: 1.89k]
  ------------------
  193|  2.91k|            c1 = heap[root]->maxdq->first;
  194|  2.91k|            c2 = heap[parent]->maxdq->first;
  195|       |
  196|  2.91k|            dummy = heap[parent];
  197|  2.91k|            heap[parent] = heap[root];
  198|  2.91k|            heap[root] = dummy;
  199|       |
  200|  2.91k|            dummy2 = heapindex[c1];
  201|  2.91k|            heapindex[c1] = heapindex[c2];
  202|  2.91k|            heapindex[c2] = dummy2;
  203|       |
  204|  2.91k|            root = parent;
  205|  2.91k|        } else {
  206|  1.89k|            break;
  207|  1.89k|        }
  208|  4.80k|    }
  209|  3.10k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_remove:
  266|  38.5k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  267|  38.5k|    igraph_real_t old;
  268|  38.5k|    igraph_int_t commidx;
  269|       |
  270|       |    /* First adjust the index */
  271|  38.5k|    commidx = list->heap[list->no_of_communities - 1]->maxdq->first;
  272|  38.5k|    list->heapindex[commidx] = idx;
  273|  38.5k|    commidx = list->heap[idx]->maxdq->first;
  274|  38.5k|    list->heapindex[commidx] = -1;
  275|       |
  276|       |    /* Now remove the element */
  277|  38.5k|    old = *list->heap[idx]->maxdq->dq;
  278|  38.5k|    list->heap[idx] = list->heap[list->no_of_communities - 1];
  279|  38.5k|    list->no_of_communities--;
  280|       |
  281|       |    /* Recover heap property */
  282|  38.5k|    if (old > *list->heap[idx]->maxdq->dq) {
  ------------------
  |  Branch (282:9): [True: 38.1k, False: 329]
  ------------------
  283|  38.1k|        igraph_i_fastgreedy_community_list_sift_down(list, idx);
  284|  38.1k|    } else {
  285|    329|        igraph_i_fastgreedy_community_list_sift_up(list, idx);
  286|    329|    }
  287|  38.5k|}

igraph_community_label_propagation:
  554|  10.6k|        igraph_lpa_variant_t lpa_variant) {
  555|       |
  556|  10.6k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  557|  10.6k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  558|  10.6k|    igraph_int_t no_of_not_fixed_nodes = no_of_nodes;
  559|  10.6k|    igraph_int_t i, j, k;
  560|  10.6k|    igraph_bool_t unlabelled_left;
  561|       |
  562|       |    /* We make a copy of 'fixed' as a pointer into 'fixed_copy' after casting
  563|       |     * away the constness, and promise ourselves that we will make a proper
  564|       |     * copy of 'fixed' into 'fixed_copy' as soon as we start mutating it */
  565|  10.6k|    igraph_vector_bool_t *fixed_copy = (igraph_vector_bool_t *) fixed;
  566|       |
  567|       |    /* Unlabelled nodes are represented with -1. */
  568|  10.6k|#define IS_UNLABELLED(x) (VECTOR(*membership)[x] < 0)
  569|       |
  570|       |    /* Do some initial checks */
  571|  10.6k|    if (fixed && igraph_vector_bool_size(fixed) != no_of_nodes) {
  ------------------
  |  Branch (571:9): [True: 0, False: 10.6k]
  |  Branch (571:18): [True: 0, False: 0]
  ------------------
  572|      0|        IGRAPH_ERROR("Fixed labeling vector length must agree with number of nodes.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  573|      0|    }
  574|  10.6k|    if (weights) {
  ------------------
  |  Branch (574:9): [True: 10.6k, False: 0]
  ------------------
  575|  10.6k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (575:13): [True: 0, False: 10.6k]
  ------------------
  576|      0|            IGRAPH_ERROR("Length of weight vector must agree with number of edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  577|      0|        }
  578|  10.6k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (578:13): [True: 10.4k, False: 153]
  ------------------
  579|  10.4k|            igraph_real_t minweight = igraph_vector_min(weights);
  580|  10.4k|            if (minweight < 0) {
  ------------------
  |  Branch (580:17): [True: 0, False: 10.4k]
  ------------------
  581|      0|                IGRAPH_ERROR("Weights must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  582|      0|            }
  583|  10.4k|            if (isnan(minweight)) {
  ------------------
  |  Branch (583:17): [True: 0, False: 10.4k]
  ------------------
  584|      0|                IGRAPH_ERROR("Weights must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  585|      0|            }
  586|  10.4k|        }
  587|  10.6k|    }
  588|  10.6k|    if (fixed && !initial) {
  ------------------
  |  Branch (588:9): [True: 0, False: 10.6k]
  |  Branch (588:18): [True: 0, False: 0]
  ------------------
  589|      0|        IGRAPH_WARNING("Ignoring fixed vertices as no initial labeling given.");
  ------------------
  |  |  797|      0|    do { \
  |  |  798|      0|        igraph_warning(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  799|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (799:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  590|      0|    }
  591|       |
  592|  10.6k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  593|       |
  594|  10.6k|    if (initial) {
  ------------------
  |  Branch (594:9): [True: 0, False: 10.6k]
  ------------------
  595|      0|        if (igraph_vector_int_size(initial) != no_of_nodes) {
  ------------------
  |  Branch (595:13): [True: 0, False: 0]
  ------------------
  596|      0|            IGRAPH_ERROR("Initial labeling vector length must agree with number of nodes.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  597|      0|        }
  598|       |        /* Check if the labels used are valid, initialize membership vector */
  599|      0|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (599:21): [True: 0, False: 0]
  ------------------
  600|      0|            if (VECTOR(*initial)[i] < 0) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (600:17): [True: 0, False: 0]
  ------------------
  601|      0|                VECTOR(*membership)[i] = -1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  602|      0|            } else {
  603|      0|                VECTOR(*membership)[i] = VECTOR(*initial)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*membership)[i] = VECTOR(*initial)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  604|      0|            }
  605|      0|        }
  606|      0|        if (fixed) {
  ------------------
  |  Branch (606:13): [True: 0, False: 0]
  ------------------
  607|      0|            for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (607:25): [True: 0, False: 0]
  ------------------
  608|      0|                if (VECTOR(*fixed)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (608:21): [True: 0, False: 0]
  ------------------
  609|      0|                    if (IS_UNLABELLED(i)) {
  ------------------
  |  |  568|      0|#define IS_UNLABELLED(x) (VECTOR(*membership)[x] < 0)
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  |  Branch (568:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  610|      0|                        IGRAPH_WARNING("Fixed nodes cannot be unlabeled, ignoring them.");
  ------------------
  |  |  797|      0|    do { \
  |  |  798|      0|        igraph_warning(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  799|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (799:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  611|       |
  612|       |                        /* We cannot modify 'fixed' because it is const, so we make a copy and
  613|       |                         * modify 'fixed_copy' instead */
  614|      0|                        if (fixed_copy == fixed) {
  ------------------
  |  Branch (614:29): [True: 0, False: 0]
  ------------------
  615|      0|                            fixed_copy = IGRAPH_CALLOC(1, igraph_vector_bool_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  616|      0|                            IGRAPH_CHECK_OOM(fixed_copy, "Insufficient memory for label propagation.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  617|      0|                            IGRAPH_FINALLY(igraph_free, fixed_copy);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  618|      0|                            IGRAPH_CHECK(igraph_vector_bool_init_copy(fixed_copy, fixed));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  619|      0|                            IGRAPH_FINALLY(igraph_vector_bool_destroy, fixed_copy);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  620|      0|                        }
  621|       |
  622|      0|                        VECTOR(*fixed_copy)[i] = false;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  623|      0|                    } else {
  624|      0|                        no_of_not_fixed_nodes--;
  625|      0|                    }
  626|      0|                }
  627|      0|            }
  628|      0|        }
  629|       |
  630|      0|        i = igraph_vector_int_max(membership);
  631|      0|        if (i > no_of_nodes) {
  ------------------
  |  Branch (631:13): [True: 0, False: 0]
  ------------------
  632|      0|            IGRAPH_ERROR("Elements of the initial labeling vector must be between 0 and |V|-1.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  633|      0|        }
  634|  10.6k|    } else {
  635|   475k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (635:21): [True: 464k, False: 10.6k]
  ------------------
  636|   464k|            VECTOR(*membership)[i] = i;
  ------------------
  |  |   60|   464k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  637|   464k|        }
  638|  10.6k|    }
  639|       |
  640|       |    /* From this point onwards we use 'fixed_copy' instead of 'fixed' */
  641|  10.6k|    switch (lpa_variant) {
  642|  3.54k|    case IGRAPH_LPA_FAST:
  ------------------
  |  Branch (642:5): [True: 3.54k, False: 7.08k]
  ------------------
  643|  3.54k|        IGRAPH_CHECK(community_fast_label_propagation(graph, membership, mode, weights, fixed_copy));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  644|  3.54k|        break;
  645|       |
  646|  3.54k|    case IGRAPH_LPA_RETENTION:
  ------------------
  |  Branch (646:5): [True: 3.54k, False: 7.08k]
  ------------------
  647|  3.54k|        IGRAPH_CHECK(community_label_propagation(graph, membership, mode, weights, fixed_copy, /* retention */ true ));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  648|  3.54k|        break;
  649|       |
  650|  3.54k|    case IGRAPH_LPA_DOMINANCE:
  ------------------
  |  Branch (650:5): [True: 3.54k, False: 7.08k]
  ------------------
  651|  3.54k|        IGRAPH_CHECK(community_label_propagation(graph, membership, mode, weights, fixed_copy, /* retention */ false));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  652|  3.54k|        break;
  653|       |
  654|  3.54k|    default:
  ------------------
  |  Branch (654:5): [True: 0, False: 10.6k]
  ------------------
  655|      0|        IGRAPH_ERROR("Invalid igraph_lpa_variant_t.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  656|  10.6k|    }
  657|       |
  658|       |    /* Permute labels in increasing order */
  659|  10.6k|    igraph_vector_int_t relabel_label;
  660|  10.6k|    IGRAPH_CHECK(igraph_vector_int_init(&relabel_label, no_of_nodes));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  661|  10.6k|    igraph_vector_int_fill(&relabel_label, -1);
  662|  10.6k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &relabel_label);
  ------------------
  |  |  603|  10.6k|    do { \
  |  |  604|  10.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.6k]
  |  |  ------------------
  |  |  608|  10.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  663|       |
  664|  10.6k|    j = 0;
  665|  10.6k|    unlabelled_left = false;
  666|   475k|    for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (666:17): [True: 464k, False: 10.6k]
  ------------------
  667|   464k|        k = VECTOR(*membership)[i];
  ------------------
  |  |   60|   464k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  668|   464k|        if (k >= 0) {
  ------------------
  |  Branch (668:13): [True: 464k, False: 0]
  ------------------
  669|   464k|            if (VECTOR(relabel_label)[k] == -1) {
  ------------------
  |  |   60|   464k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (669:17): [True: 351k, False: 113k]
  ------------------
  670|       |                /* We have seen this label for the first time */
  671|   351k|                VECTOR(relabel_label)[k] = j;
  ------------------
  |  |   60|   351k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  672|   351k|                k = j;
  673|   351k|                j++;
  674|   351k|            } else {
  675|   113k|                k = VECTOR(relabel_label)[k];
  ------------------
  |  |   60|   113k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  676|   113k|            }
  677|   464k|        } else {
  678|       |            /* This is an unlabeled vertex */
  679|      0|            unlabelled_left = true;
  680|      0|        }
  681|   464k|        VECTOR(*membership)[i] = k;
  ------------------
  |  |   60|   464k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  682|   464k|    }
  683|       |
  684|       |    /* If any nodes are left unlabelled, we assign the remaining labels to them,
  685|       |     * as well as to all unlabelled nodes reachable from them.
  686|       |     *
  687|       |     * Note that only those nodes could remain unlabelled which were unreachable
  688|       |     * from any labelled ones. Thus, in the undirected case, fully unlabelled
  689|       |     * connected components remain unlabelled. Here we label each such component
  690|       |     * with the same label.
  691|       |     */
  692|  10.6k|    if (unlabelled_left) {
  ------------------
  |  Branch (692:9): [True: 0, False: 10.6k]
  ------------------
  693|      0|        igraph_dqueue_int_t q;
  694|      0|        igraph_vector_int_t neis;
  695|       |
  696|      0|        igraph_vector_int_t node_order;
  697|       |        /* Initialize node ordering vector with only the not fixed nodes */
  698|      0|        if (fixed) {
  ------------------
  |  Branch (698:13): [True: 0, False: 0]
  ------------------
  699|      0|            no_of_not_fixed_nodes = 0;
  700|      0|            IGRAPH_VECTOR_INT_INIT_FINALLY(&node_order, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  701|      0|            for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (701:25): [True: 0, False: 0]
  ------------------
  702|      0|                if (!VECTOR(*fixed)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (702:21): [True: 0, False: 0]
  ------------------
  703|      0|                    VECTOR(node_order)[no_of_not_fixed_nodes] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  704|      0|                    no_of_not_fixed_nodes++;
  705|      0|                }
  706|      0|            }
  707|      0|            IGRAPH_CHECK(igraph_vector_int_resize(&node_order, no_of_not_fixed_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  708|      0|        } else {
  709|      0|            IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  710|      0|            IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  711|      0|            no_of_not_fixed_nodes = no_of_nodes;
  712|      0|        }
  713|       |        /* Shuffle the node ordering vector */
  714|      0|        igraph_vector_int_shuffle(&node_order);
  715|       |
  716|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  717|       |
  718|      0|        IGRAPH_CHECK(igraph_dqueue_int_init(&q, 0));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  719|      0|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, &q);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  720|       |
  721|      0|        for (i=0; i < no_of_not_fixed_nodes; ++i) {
  ------------------
  |  Branch (721:19): [True: 0, False: 0]
  ------------------
  722|      0|            igraph_int_t v = VECTOR(node_order)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  723|       |
  724|       |            /* Is this node unlabelled? */
  725|      0|            if (IS_UNLABELLED(v)) {
  ------------------
  |  |  568|      0|#define IS_UNLABELLED(x) (VECTOR(*membership)[x] < 0)
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  |  Branch (568:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  726|       |                /* If yes, we label it, and do a BFS to apply the same label
  727|       |                 * to all other unlabelled nodes reachable from it */
  728|      0|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, v));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  729|      0|                VECTOR(*membership)[v] = j;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  730|      0|                while (!igraph_dqueue_int_empty(&q)) {
  ------------------
  |  Branch (730:24): [True: 0, False: 0]
  ------------------
  731|      0|                    igraph_int_t ni, num_neis;
  732|      0|                    igraph_int_t actnode = igraph_dqueue_int_pop(&q);
  733|       |
  734|      0|                    IGRAPH_CHECK(igraph_neighbors(graph, &neis, actnode, mode, IGRAPH_LOOPS, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  735|      0|                    num_neis = igraph_vector_int_size(&neis);
  736|       |
  737|      0|                    for (ni = 0; ni < num_neis; ++ni) {
  ------------------
  |  Branch (737:34): [True: 0, False: 0]
  ------------------
  738|      0|                        igraph_int_t neighbor = VECTOR(neis)[ni];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  739|      0|                        if (IS_UNLABELLED(neighbor)) {
  ------------------
  |  |  568|      0|#define IS_UNLABELLED(x) (VECTOR(*membership)[x] < 0)
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  |  Branch (568:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  740|      0|                            VECTOR(*membership)[neighbor] = j;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  741|      0|                            IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  742|      0|                        }
  743|      0|                    }
  744|      0|                }
  745|      0|                j++;
  746|      0|            }
  747|      0|        }
  748|       |
  749|      0|        igraph_vector_int_destroy(&neis);
  750|      0|        igraph_dqueue_int_destroy(&q);
  751|      0|        igraph_vector_int_destroy(&node_order);
  752|      0|        IGRAPH_FINALLY_CLEAN(3);
  753|      0|    }
  754|       |
  755|  10.6k|    igraph_vector_int_destroy(&relabel_label);
  756|  10.6k|    IGRAPH_FINALLY_CLEAN(1);
  757|       |
  758|  10.6k|    if (fixed != fixed_copy) {
  ------------------
  |  Branch (758:9): [True: 0, False: 10.6k]
  ------------------
  759|      0|        igraph_vector_bool_destroy(fixed_copy);
  760|      0|        IGRAPH_FREE(fixed_copy);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  761|      0|        IGRAPH_FINALLY_CLEAN(2);
  762|      0|    }
  763|       |
  764|  10.6k|    return IGRAPH_SUCCESS;
  765|  10.6k|}
label_propagation.c:community_fast_label_propagation:
  260|  3.54k|        const igraph_vector_bool_t *fixed) {
  261|       |
  262|  3.54k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  263|  3.54k|    igraph_int_t no_of_not_fixed_nodes = 0;
  264|  3.54k|    igraph_int_t i, j, k;
  265|  3.54k|    igraph_inclist_t il;
  266|  3.54k|    igraph_adjlist_t al;
  267|       |
  268|  3.54k|    igraph_vector_t label_weights;
  269|  3.54k|    igraph_vector_int_t dominant_labels, nonzero_labels, node_order;
  270|  3.54k|    igraph_dqueue_int_t queue;
  271|  3.54k|    igraph_vector_bool_t in_queue;
  272|  3.54k|    igraph_neimode_t reverse_mode;
  273|  3.54k|    int iter = 0; /* interruption counter */
  274|       |
  275|  3.54k|    reverse_mode = IGRAPH_REVERSE_MODE(mode);
  ------------------
  |  |  110|  3.54k|    ((mode) == IGRAPH_IN ? IGRAPH_OUT : ((mode) == IGRAPH_OUT ? IGRAPH_IN : (mode)))
  |  |  ------------------
  |  |  |  Branch (110:6): [True: 0, False: 3.54k]
  |  |  |  Branch (110:42): [True: 0, False: 3.54k]
  |  |  ------------------
  ------------------
  276|       |
  277|  3.54k|    if (weights) {
  ------------------
  |  Branch (277:9): [True: 3.54k, False: 0]
  ------------------
  278|  3.54k|        IGRAPH_CHECK(igraph_inclist_init(graph, &il, reverse_mode, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  279|  3.54k|        IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  280|  3.54k|    } else {
  281|      0|        IGRAPH_CHECK(igraph_adjlist_init(graph, &al, reverse_mode, IGRAPH_LOOPS_ONCE, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  282|      0|        IGRAPH_FINALLY(igraph_adjlist_destroy, &al);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  283|      0|    }
  284|       |
  285|       |    /* Create storage space for counting distinct labels and dominant ones */
  286|  3.54k|    IGRAPH_VECTOR_INIT_FINALLY(&label_weights, no_of_nodes);
  ------------------
  |  |  104|  3.54k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  287|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&dominant_labels, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  288|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nonzero_labels, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  289|  3.54k|    IGRAPH_CHECK(igraph_vector_int_reserve(&dominant_labels, 2));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  290|       |
  291|       |    /* Initialize node ordering vector with only the not fixed nodes */
  292|  3.54k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&queue, no_of_nodes);
  ------------------
  |  |   61|  3.54k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.54k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  293|  3.54k|    IGRAPH_VECTOR_BOOL_INIT_FINALLY(&in_queue, no_of_nodes);
  ------------------
  |  |  109|  3.54k|    do { IGRAPH_CHECK(igraph_vector_bool_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  3.54k|        IGRAPH_FINALLY(igraph_vector_bool_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (110:65): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  294|       |
  295|       |    /* Initialize node ordering vector with only the not fixed nodes */
  296|  3.54k|    if (fixed) {
  ------------------
  |  Branch (296:9): [True: 0, False: 3.54k]
  ------------------
  297|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&node_order, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  298|      0|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (298:21): [True: 0, False: 0]
  ------------------
  299|      0|            if (!VECTOR(*fixed)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (299:17): [True: 0, False: 0]
  ------------------
  300|      0|                VECTOR(node_order)[no_of_not_fixed_nodes] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  301|      0|                no_of_not_fixed_nodes++;
  302|      0|            }
  303|      0|        }
  304|      0|        IGRAPH_CHECK(igraph_vector_int_resize(&node_order, no_of_not_fixed_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  305|  3.54k|    } else {
  306|  3.54k|        IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  307|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  308|  3.54k|        no_of_not_fixed_nodes = no_of_nodes;
  309|  3.54k|    }
  310|       |
  311|   158k|    for (i = 0; i < no_of_not_fixed_nodes; i++) {
  ------------------
  |  Branch (311:17): [True: 154k, False: 3.54k]
  ------------------
  312|   154k|        IGRAPH_CHECK(igraph_dqueue_int_push(&queue, VECTOR(node_order)[i]));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  313|   154k|        VECTOR(in_queue)[VECTOR(node_order)[i]] = true;
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(in_queue)[VECTOR(node_order)[i]] = true;
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  314|   154k|    }
  315|  3.54k|    igraph_vector_int_destroy(&node_order);
  316|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  317|       |
  318|   171k|    while (!igraph_dqueue_int_empty(&queue)) {
  ------------------
  |  Branch (318:12): [True: 168k, False: 3.54k]
  ------------------
  319|   168k|        igraph_int_t v1, v2, e = -1, num_neis;
  320|   168k|        igraph_real_t max_count;
  321|   168k|        igraph_vector_int_t *neis;
  322|   168k|        igraph_bool_t was_zero;
  323|       |
  324|   168k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1 << 8);
  ------------------
  |  |   71|   168k|    do { \
  |  |   72|   168k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 1, False: 168k]
  |  |  ------------------
  |  |   73|      1|            IGRAPH_ALLOW_INTERRUPTION(); \
  |  |  ------------------
  |  |  |  |   46|      1|    do { \
  |  |  |  |   47|      1|        if (igraph_i_interruption_handler) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (47:13): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |  |  |   50|      0|            } \
  |  |  |  |   51|      0|        } \
  |  |  |  |   52|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      1|            iter = 0; \
  |  |   75|      1|        } \
  |  |   76|   168k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 168k]
  |  |  ------------------
  ------------------
  325|       |
  326|   168k|        v1 = igraph_dqueue_int_pop(&queue);
  327|   168k|        VECTOR(in_queue)[v1] = false;
  ------------------
  |  |   60|   168k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  328|       |
  329|       |        /* Count the weights corresponding to different labels */
  330|   168k|        igraph_vector_int_clear(&dominant_labels);
  331|   168k|        igraph_vector_int_clear(&nonzero_labels);
  332|   168k|        max_count = 0.0;
  333|   168k|        if (weights) {
  ------------------
  |  Branch (333:13): [True: 168k, False: 0]
  ------------------
  334|   168k|            neis = igraph_inclist_get(&il, v1);
  ------------------
  |  |  102|   168k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  335|   168k|        } else {
  336|      0|            neis = igraph_adjlist_get(&al, v1);
  ------------------
  |  |   73|      0|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
  337|      0|        }
  338|       |
  339|   168k|        num_neis = igraph_vector_int_size(neis);
  340|   416k|        for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (340:21): [True: 248k, False: 168k]
  ------------------
  341|   248k|            if (weights) {
  ------------------
  |  Branch (341:17): [True: 248k, False: 0]
  ------------------
  342|   248k|                e = VECTOR(*neis)[j];
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  343|   248k|                v2 = IGRAPH_OTHER(graph, e, v1);
  ------------------
  |  |  146|   248k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   248k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   138k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   138k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   110k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   110k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 138k, False: 110k]
  |  |  ------------------
  ------------------
  344|   248k|            } else {
  345|      0|                v2 = VECTOR(*neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  346|      0|            }
  347|   248k|            k = VECTOR(*membership)[v2];
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  348|   248k|            if (k < 0) {
  ------------------
  |  Branch (348:17): [True: 0, False: 248k]
  ------------------
  349|      0|                continue;    /* skip if it has no label yet */
  350|      0|            }
  351|   248k|            was_zero = (VECTOR(label_weights)[k] == 0);
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  352|   248k|            VECTOR(label_weights)[k] += (weights ? VECTOR(*weights)[e] : 1);
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(label_weights)[k] += (weights ? VECTOR(*weights)[e] : 1);
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (352:42): [True: 248k, False: 0]
  ------------------
  353|       |
  354|   248k|            if (was_zero && VECTOR(label_weights)[k] >= 0) {
  ------------------
  |  |   60|   139k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (354:17): [True: 139k, False: 109k]
  |  Branch (354:29): [True: 139k, False: 0]
  ------------------
  355|       |                /* counter just became non-negative */
  356|   139k|                IGRAPH_CHECK(igraph_vector_int_push_back(&nonzero_labels, k));
  ------------------
  |  |  656|   139k|    do { \
  |  |  657|   139k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   139k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   139k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 139k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   139k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 139k]
  |  |  ------------------
  ------------------
  357|   139k|            }
  358|       |
  359|   248k|            if (max_count < VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|   248k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (359:17): [True: 171k, False: 76.9k]
  ------------------
  360|   171k|                max_count = VECTOR(label_weights)[k];
  ------------------
  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  361|   171k|                IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|   171k|    do { \
  |  |  657|   171k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   171k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   171k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 171k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   171k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 171k]
  |  |  ------------------
  ------------------
  362|   171k|                VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  363|   171k|            } else if (max_count == VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|  76.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (363:24): [True: 3.08k, False: 73.8k]
  ------------------
  364|  3.08k|                IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  656|  3.08k|    do { \
  |  |  657|  3.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.08k]
  |  |  ------------------
  ------------------
  365|  3.08k|            }
  366|   248k|        }
  367|       |
  368|   168k|        if (igraph_vector_int_size(&dominant_labels) > 0) {
  ------------------
  |  Branch (368:13): [True: 62.1k, False: 105k]
  ------------------
  369|  62.1k|            igraph_int_t current_label = VECTOR(*membership)[v1];
  ------------------
  |  |   60|  62.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  370|       |
  371|       |            /* Select randomly from the dominant labels */
  372|  62.1k|            k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|  62.1k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  373|  62.1k|            igraph_int_t new_label = VECTOR(dominant_labels)[k]; /* a dominant label */
  ------------------
  |  |   60|  62.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  374|       |
  375|       |            /* Check if the _current_ label of the node is not the same */
  376|  62.1k|            if (new_label != current_label) {
  ------------------
  |  Branch (376:17): [True: 43.5k, False: 18.6k]
  ------------------
  377|       |                /* We still need to consider its neighbors not in the new community */
  378|   168k|                for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (378:29): [True: 125k, False: 43.5k]
  ------------------
  379|   125k|                    if (weights) {
  ------------------
  |  Branch (379:25): [True: 125k, False: 0]
  ------------------
  380|   125k|                        e = VECTOR(*neis)[j];
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  381|   125k|                        v2 = IGRAPH_OTHER(graph, e, v1);
  ------------------
  |  |  146|   125k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   125k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  64.1k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  64.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  60.9k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  60.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 64.1k, False: 60.9k]
  |  |  ------------------
  ------------------
  382|   125k|                    } else {
  383|      0|                        v2 = VECTOR(*neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  384|      0|                    }
  385|   125k|                    if (!VECTOR(in_queue)[v2]) {
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (385:25): [True: 38.5k, False: 86.5k]
  ------------------
  386|  38.5k|                        igraph_int_t neigh_label = VECTOR(*membership)[v2]; /* neighbor community */
  ------------------
  |  |   60|  38.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  387|  38.5k|                        if (neigh_label != new_label && /* not in new community */
  ------------------
  |  Branch (387:29): [True: 13.0k, False: 25.4k]
  ------------------
  388|  13.0k|                            (fixed == NULL || !VECTOR(*fixed)[v2]) ) { /* not fixed */
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (388:30): [True: 13.0k, False: 0]
  |  Branch (388:47): [True: 0, False: 0]
  ------------------
  389|  13.0k|                            IGRAPH_CHECK(igraph_dqueue_int_push(&queue, v2));
  ------------------
  |  |  656|  13.0k|    do { \
  |  |  657|  13.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  13.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  13.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  13.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
  390|  13.0k|                            VECTOR(in_queue)[v2] = true;
  ------------------
  |  |   60|  13.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  391|  13.0k|                        }
  392|  38.5k|                    }
  393|   125k|                }
  394|  43.5k|            }
  395|  62.1k|            VECTOR(*membership)[v1] = new_label;
  ------------------
  |  |   60|  62.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  396|  62.1k|        }
  397|       |
  398|       |        /* Clear the nonzero elements in label_weights */
  399|   168k|        num_neis = igraph_vector_int_size(&nonzero_labels);
  400|   307k|        for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (400:21): [True: 139k, False: 168k]
  ------------------
  401|   139k|            VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   139k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   139k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  402|   139k|        }
  403|   168k|    }
  404|       |
  405|  3.54k|    if (weights) {
  ------------------
  |  Branch (405:9): [True: 3.54k, False: 0]
  ------------------
  406|  3.54k|        igraph_inclist_destroy(&il);
  407|  3.54k|    } else {
  408|      0|        igraph_adjlist_destroy(&al);
  409|      0|    }
  410|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  411|       |
  412|  3.54k|    igraph_vector_bool_destroy(&in_queue);
  413|  3.54k|    igraph_dqueue_int_destroy(&queue);
  414|  3.54k|    igraph_vector_destroy(&label_weights);
  415|  3.54k|    igraph_vector_int_destroy(&dominant_labels);
  416|  3.54k|    igraph_vector_int_destroy(&nonzero_labels);
  417|  3.54k|    IGRAPH_FINALLY_CLEAN(5);
  418|       |
  419|  3.54k|    return IGRAPH_SUCCESS;
  420|  3.54k|}
label_propagation.c:community_label_propagation:
   35|  7.08k|        igraph_bool_t retention) {
   36|       |
   37|  7.08k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   38|  7.08k|    igraph_int_t no_of_not_fixed_nodes = 0;
   39|  7.08k|    igraph_int_t i, j, k;
   40|  7.08k|    igraph_adjlist_t al;
   41|  7.08k|    igraph_inclist_t il;
   42|  7.08k|    igraph_bool_t running, control_iteration;
   43|       |
   44|  7.08k|    igraph_vector_t label_weights;
   45|  7.08k|    igraph_vector_int_t dominant_labels, nonzero_labels, node_order;
   46|  7.08k|    igraph_neimode_t reverse_mode;
   47|  7.08k|    int iter = 0; /* interruption counter */
   48|       |
   49|  7.08k|    reverse_mode = IGRAPH_REVERSE_MODE(mode);
  ------------------
  |  |  110|  7.08k|    ((mode) == IGRAPH_IN ? IGRAPH_OUT : ((mode) == IGRAPH_OUT ? IGRAPH_IN : (mode)))
  |  |  ------------------
  |  |  |  Branch (110:6): [True: 0, False: 7.08k]
  |  |  |  Branch (110:42): [True: 0, False: 7.08k]
  |  |  ------------------
  ------------------
   50|       |
   51|       |    /* Create an adjacency/incidence list representation for efficiency.
   52|       |    * For the unweighted case, the adjacency list is enough. For the
   53|       |    * weighted case, we need the incidence list */
   54|  7.08k|    if (weights) {
  ------------------
  |  Branch (54:9): [True: 7.08k, False: 0]
  ------------------
   55|  7.08k|        IGRAPH_CHECK(igraph_inclist_init(graph, &il, reverse_mode, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   56|  7.08k|        IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  7.08k|    do { \
  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  ------------------
  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   57|  7.08k|    } else {
   58|      0|        IGRAPH_CHECK(igraph_adjlist_init(graph, &al, reverse_mode, IGRAPH_LOOPS_ONCE, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   59|      0|        IGRAPH_FINALLY(igraph_adjlist_destroy, &al);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   60|      0|    }
   61|       |
   62|       |    /* Create storage space for counting distinct labels and dominant ones */
   63|  7.08k|    IGRAPH_VECTOR_INIT_FINALLY(&label_weights, no_of_nodes);
  ------------------
  |  |  104|  7.08k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.08k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   64|  7.08k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&dominant_labels, 0);
  ------------------
  |  |  119|  7.08k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   65|  7.08k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nonzero_labels, 0);
  ------------------
  |  |  119|  7.08k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   66|  7.08k|    IGRAPH_CHECK(igraph_vector_int_reserve(&dominant_labels, 2));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   67|       |
   68|       |    /* Initialize node ordering vector with only the not fixed nodes */
   69|  7.08k|    if (fixed) {
  ------------------
  |  Branch (69:9): [True: 0, False: 7.08k]
  ------------------
   70|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&node_order, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
   71|      0|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (71:21): [True: 0, False: 0]
  ------------------
   72|      0|            if (!VECTOR(*fixed)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (72:17): [True: 0, False: 0]
  ------------------
   73|      0|                VECTOR(node_order)[no_of_not_fixed_nodes] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
   74|      0|                no_of_not_fixed_nodes++;
   75|      0|            }
   76|      0|        }
   77|      0|        IGRAPH_CHECK(igraph_vector_int_resize(&node_order, no_of_not_fixed_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   78|  7.08k|    } else {
   79|  7.08k|        IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   80|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  7.08k|    do { \
  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  ------------------
  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   81|  7.08k|        no_of_not_fixed_nodes = no_of_nodes;
   82|  7.08k|    }
   83|       |
   84|       |    /* There are two modes of operation in this implementation: retention or
   85|       |     * dominance. When using retention, we prefer to keep the current label of a node.
   86|       |     * Only if the current label is not among the dominant labels will we
   87|       |     * update the label. If a label changes, we will continue to iterate
   88|       |     * over all nodes.
   89|       |     *
   90|       |     * When not using retention we check for dominance after each iteration. This
   91|       |     * is implemented as two alternating types of iterations, one for changing
   92|       |     * labels and the other one for checking the end condition - every vertex in the
   93|       |     * graph has a label to which the maximum number of its neighbors belongs. If
   94|       |     * control_iteration is true, we are just checking the end condition and not
   95|       |     * relabeling nodes.
   96|       |     */
   97|       |
   98|  7.08k|    control_iteration = true;
   99|  7.08k|    running = true;
  100|  30.6k|    while (running) {
  ------------------
  |  Branch (100:12): [True: 23.5k, False: 7.08k]
  ------------------
  101|  23.5k|        igraph_int_t v1, num_neis;
  102|  23.5k|        igraph_real_t max_count;
  103|  23.5k|        igraph_vector_int_t *neis;
  104|  23.5k|        igraph_vector_int_t *ineis;
  105|  23.5k|        igraph_bool_t was_zero;
  106|       |
  107|  23.5k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1 << 8);
  ------------------
  |  |   71|  23.5k|    do { \
  |  |   72|  23.5k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 23.5k]
  |  |  ------------------
  |  |   73|      0|            IGRAPH_ALLOW_INTERRUPTION(); \
  |  |  ------------------
  |  |  |  |   46|      0|    do { \
  |  |  |  |   47|      0|        if (igraph_i_interruption_handler) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (47:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |  |  |   50|      0|            } \
  |  |  |  |   51|      0|        } \
  |  |  |  |   52|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      0|            iter = 0; \
  |  |   75|      0|        } \
  |  |   76|  23.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 23.5k]
  |  |  ------------------
  ------------------
  108|       |
  109|  23.5k|        if (retention) {
  ------------------
  |  Branch (109:13): [True: 8.92k, False: 14.6k]
  ------------------
  110|       |            /* We stop in this iteration by default, unless a label changes */
  111|  8.92k|            running = false;
  112|       |            /* Shuffle the node ordering vector */
  113|  8.92k|            igraph_vector_int_shuffle(&node_order);
  114|  14.6k|        } else {
  115|  14.6k|            if (control_iteration) {
  ------------------
  |  Branch (115:17): [True: 9.08k, False: 5.54k]
  ------------------
  116|       |                /* If we are in the control iteration, we expect in the beginning of
  117|       |                the iteration that all vertices meet the end condition, so 'running' is false.
  118|       |                If some of them does not, 'running' is set to true later in the code. */
  119|  9.08k|                running = false;
  120|  9.08k|            } else {
  121|       |                /* Shuffle the node ordering vector if we are in the label updating iteration */
  122|  5.54k|                igraph_vector_int_shuffle(&node_order);
  123|  5.54k|            }
  124|  14.6k|        }
  125|       |
  126|       |        /* In the prescribed order, loop over the vertices and reassign labels */
  127|  1.11M|        for (i = 0; i < no_of_not_fixed_nodes; i++) {
  ------------------
  |  Branch (127:21): [True: 1.08M, False: 23.5k]
  ------------------
  128|  1.08M|            v1 = VECTOR(node_order)[i];
  ------------------
  |  |   60|  1.08M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  129|       |
  130|       |            /* Count the weights corresponding to different labels */
  131|  1.08M|            igraph_vector_int_clear(&dominant_labels);
  132|  1.08M|            igraph_vector_int_clear(&nonzero_labels);
  133|  1.08M|            max_count = 0.0;
  134|  1.08M|            if (weights) {
  ------------------
  |  Branch (134:17): [True: 1.08M, False: 0]
  ------------------
  135|       |
  136|  1.08M|                ineis = igraph_inclist_get(&il, v1);
  ------------------
  |  |  102|  1.08M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  137|  1.08M|                num_neis = igraph_vector_int_size(ineis);
  138|       |
  139|  2.51M|                for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (139:29): [True: 1.42M, False: 1.08M]
  ------------------
  140|  1.42M|                    k = VECTOR(*membership)[IGRAPH_OTHER(graph, VECTOR(*ineis)[j], v1)];
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  k = VECTOR(*membership)[IGRAPH_OTHER(graph, VECTOR(*ineis)[j], v1)];
  ------------------
  |  |  146|  1.42M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  1.42M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   774k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   774k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   650k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   650k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 774k, False: 650k]
  |  |  ------------------
  ------------------
  141|  1.42M|                    if (k < 0) {
  ------------------
  |  Branch (141:25): [True: 0, False: 1.42M]
  ------------------
  142|      0|                        continue;    /* skip if it has no label yet */
  143|      0|                    }
  144|  1.42M|                    was_zero = (VECTOR(label_weights)[k] == 0);
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|  1.42M|                    VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  146|       |
  147|  1.42M|                    if (was_zero && VECTOR(label_weights)[k] != 0) {
  ------------------
  |  |   60|   752k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (147:25): [True: 752k, False: 673k]
  |  Branch (147:37): [True: 752k, False: 0]
  ------------------
  148|       |                        /* weights just became nonzero */
  149|   752k|                        IGRAPH_CHECK(igraph_vector_int_push_back(&nonzero_labels, k));
  ------------------
  |  |  656|   752k|    do { \
  |  |  657|   752k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   752k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   752k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 752k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   752k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 752k]
  |  |  ------------------
  ------------------
  150|   752k|                    }
  151|       |
  152|  1.42M|                    if (max_count < VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|  1.42M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (152:25): [True: 1.09M, False: 335k]
  ------------------
  153|  1.09M|                        max_count = VECTOR(label_weights)[k];
  ------------------
  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  154|  1.09M|                        IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|  1.09M|    do { \
  |  |  657|  1.09M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.09M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.09M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.09M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.09M]
  |  |  ------------------
  ------------------
  155|  1.09M|                        VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  156|  1.09M|                    } else if (max_count == VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|   335k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (156:32): [True: 14.1k, False: 320k]
  ------------------
  157|  14.1k|                        IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  158|  14.1k|                    }
  159|  1.42M|                }
  160|  1.08M|            } else {
  161|       |
  162|      0|                neis = igraph_adjlist_get(&al, v1);
  ------------------
  |  |   73|      0|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
  163|      0|                num_neis = igraph_vector_int_size(neis);
  164|       |
  165|      0|                for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (165:29): [True: 0, False: 0]
  ------------------
  166|       |
  167|      0|                    k = VECTOR(*membership)[VECTOR(*neis)[j]];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  k = VECTOR(*membership)[VECTOR(*neis)[j]];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  168|      0|                    if (k < 0) {
  ------------------
  |  Branch (168:25): [True: 0, False: 0]
  ------------------
  169|      0|                        continue;    /* skip if it has no label yet */
  170|      0|                    }
  171|      0|                    VECTOR(label_weights)[k]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  172|       |
  173|      0|                    if (VECTOR(label_weights)[k] == 1) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (173:25): [True: 0, False: 0]
  ------------------
  174|       |                        /* weights just became nonzero */
  175|      0|                        IGRAPH_CHECK(igraph_vector_int_push_back(&nonzero_labels, k));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  176|      0|                    }
  177|       |
  178|      0|                    if (max_count < VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (178:25): [True: 0, False: 0]
  ------------------
  179|      0|                        max_count = VECTOR(label_weights)[k];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|      0|                        IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  181|      0|                        VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  182|      0|                    } else if (max_count == VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (182:32): [True: 0, False: 0]
  ------------------
  183|      0|                        IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  184|      0|                    }
  185|      0|                }
  186|      0|            }
  187|       |
  188|  1.08M|            if (igraph_vector_int_size(&dominant_labels) > 0) {
  ------------------
  |  Branch (188:17): [True: 406k, False: 682k]
  ------------------
  189|   406k|                if (retention) {
  ------------------
  |  Branch (189:21): [True: 149k, False: 257k]
  ------------------
  190|       |                    /* If we are using retention, we first check if the current label
  191|       |                    is among the maximum label. */
  192|   149k|                    j = (long)VECTOR(*membership)[v1];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  193|   149k|                    if (j < 0 || /* Doesn't have a label yet */
  ------------------
  |  Branch (193:25): [True: 0, False: 149k]
  ------------------
  194|   149k|                        VECTOR(label_weights)[j] == 0 || /* Label not present in neighbors */
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (194:25): [True: 38.8k, False: 110k]
  ------------------
  195|   110k|                        VECTOR(label_weights)[j] < max_count /* Label not dominant */) {
  ------------------
  |  |   60|   110k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (195:25): [True: 4.60k, False: 105k]
  ------------------
  196|       |                        /* Select randomly from the dominant labels */
  197|  43.4k|                        k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|  43.4k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  198|  43.4k|                        k = VECTOR(dominant_labels)[(long int)k];
  ------------------
  |  |   60|  43.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  199|       |                        /* If label changes, we will continue running */
  200|  43.4k|                        if (k != j) {
  ------------------
  |  Branch (200:29): [True: 43.4k, False: 0]
  ------------------
  201|  43.4k|                            running = true;
  202|  43.4k|                        }
  203|       |                        /* Actually change label */
  204|  43.4k|                        VECTOR(*membership)[v1] = k;
  ------------------
  |  |   60|  43.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  205|  43.4k|                    }
  206|   257k|                } else {
  207|       |                    /* We are not using retention, so check if we should do a control iteration
  208|       |                    or an update iteration. */
  209|   257k|                    if (control_iteration) {
  ------------------
  |  Branch (209:25): [True: 153k, False: 104k]
  ------------------
  210|       |                        /* Check if the _current_ label of the node is also dominant */
  211|   153k|                        k = VECTOR(*membership)[v1];
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  212|   153k|                        if (k < 0 ||                              /* No label assigned yet or */
  ------------------
  |  Branch (212:29): [True: 0, False: 153k]
  ------------------
  213|   153k|                            VECTOR(label_weights)[k] < max_count /* Label is not maximum */
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (213:29): [True: 53.6k, False: 99.4k]
  ------------------
  214|   153k|                           ) {
  215|       |                            /* Nope, we need at least one more iteration */
  216|  53.6k|                            running = true;
  217|  53.6k|                        }
  218|   153k|                    } else {
  219|       |                        /* Select randomly from the dominant labels */
  220|   104k|                        k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|   104k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  221|   104k|                        VECTOR(*membership)[v1] = VECTOR(dominant_labels)[k];
  ------------------
  |  |   60|   104k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(*membership)[v1] = VECTOR(dominant_labels)[k];
  ------------------
  |  |   60|   104k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  222|   104k|                    }
  223|   257k|                }
  224|   406k|            }
  225|       |
  226|       |            /* Clear the nonzero elements in label_weights */
  227|  1.08M|            num_neis = igraph_vector_int_size(&nonzero_labels);
  228|  1.84M|            for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (228:25): [True: 752k, False: 1.08M]
  ------------------
  229|   752k|                VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   752k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   752k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  230|   752k|            }
  231|  1.08M|        }
  232|       |
  233|       |        /* Alternating between control iterations and label updating iterations */
  234|  23.5k|        if (!retention) {
  ------------------
  |  Branch (234:13): [True: 14.6k, False: 8.92k]
  ------------------
  235|  14.6k|            control_iteration = !control_iteration;
  236|  14.6k|        }
  237|  23.5k|    }
  238|       |
  239|  7.08k|    if (weights) {
  ------------------
  |  Branch (239:9): [True: 7.08k, False: 0]
  ------------------
  240|  7.08k|        igraph_inclist_destroy(&il);
  241|  7.08k|    } else {
  242|      0|        igraph_adjlist_destroy(&al);
  243|      0|    }
  244|  7.08k|    IGRAPH_FINALLY_CLEAN(1);
  245|       |
  246|  7.08k|    igraph_vector_int_destroy(&node_order);
  247|  7.08k|    igraph_vector_int_destroy(&nonzero_labels);
  248|  7.08k|    igraph_vector_int_destroy(&dominant_labels);
  249|  7.08k|    igraph_vector_destroy(&label_weights);
  250|  7.08k|    IGRAPH_FINALLY_CLEAN(4);
  251|       |
  252|  7.08k|    return IGRAPH_SUCCESS;
  253|  7.08k|}

igraph_community_leiden:
 1164|  7.08k|        igraph_real_t *quality) {
 1165|       |
 1166|  7.08k|    const igraph_int_t vcount = igraph_vcount(graph);
 1167|  7.08k|    const igraph_int_t ecount = igraph_ecount(graph);
 1168|  7.08k|    const igraph_bool_t directed = igraph_is_directed(graph);
 1169|  7.08k|    igraph_vector_t *i_edge_weights, *i_vertex_out_weights, *i_vertex_in_weights;
 1170|  7.08k|    igraph_int_t i_nb_clusters;
 1171|       |
 1172|  7.08k|    if (!nb_clusters) {
  ------------------
  |  Branch (1172:9): [True: 0, False: 7.08k]
  ------------------
 1173|      0|        nb_clusters = &i_nb_clusters;
 1174|      0|    }
 1175|       |
 1176|  7.08k|    if (start) {
  ------------------
  |  Branch (1176:9): [True: 0, False: 7.08k]
  ------------------
 1177|      0|        if (!membership) {
  ------------------
  |  Branch (1177:13): [True: 0, False: 0]
  ------------------
 1178|      0|            IGRAPH_ERROR("Cannot start optimization if membership is missing.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1179|      0|        }
 1180|       |
 1181|      0|        if (igraph_vector_int_size(membership) != vcount) {
  ------------------
  |  Branch (1181:13): [True: 0, False: 0]
  ------------------
 1182|      0|            IGRAPH_ERROR("Membership vector length does not equal the number of vertices.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1183|      0|        }
 1184|  7.08k|    } else {
 1185|  7.08k|        if (!membership)
  ------------------
  |  Branch (1185:13): [True: 0, False: 7.08k]
  ------------------
 1186|      0|            IGRAPH_ERROR("Membership vector should be supplied and initialized, "
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1187|  7.08k|                         "even when not starting optimization from it.", IGRAPH_EINVAL);
 1188|       |
 1189|  7.08k|        IGRAPH_CHECK(igraph_vector_int_range(membership, 0, vcount));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1190|  7.08k|    }
 1191|       |
 1192|       |    /* Check edge weights to possibly use default. */
 1193|  7.08k|    if (!edge_weights) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 7.08k]
  ------------------
 1194|      0|        i_edge_weights = IGRAPH_CALLOC(1, igraph_vector_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1195|      0|        IGRAPH_CHECK_OOM(i_edge_weights, "Leiden algorithm failed, could not allocate memory for edge weights.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1196|      0|        IGRAPH_FINALLY(igraph_free, i_edge_weights);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1197|      0|        IGRAPH_CHECK(igraph_vector_init(i_edge_weights, igraph_ecount(graph)));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1198|      0|        IGRAPH_FINALLY(igraph_vector_destroy, i_edge_weights);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1199|      0|        igraph_vector_fill(i_edge_weights, 1);
 1200|  7.08k|    } else {
 1201|  7.08k|        if (igraph_vector_size(edge_weights) != ecount) {
  ------------------
  |  Branch (1201:13): [True: 0, False: 7.08k]
  ------------------
 1202|      0|            IGRAPH_ERRORF("Edge weight vector length (%" IGRAPH_PRId ") does not match number of edges (%" IGRAPH_PRId ").",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1203|      0|                          IGRAPH_EINVAL, igraph_vector_size(edge_weights), ecount);
 1204|      0|        }
 1205|  7.08k|        i_edge_weights = (igraph_vector_t*)edge_weights;
 1206|  7.08k|    }
 1207|       |
 1208|       |    /* Check vertex out-weights to possibly use default. */
 1209|  7.08k|    if (!vertex_out_weights) {
  ------------------
  |  Branch (1209:9): [True: 7.08k, False: 0]
  ------------------
 1210|  7.08k|        i_vertex_out_weights = IGRAPH_CALLOC(1, igraph_vector_t);
  ------------------
  |  |   33|  7.08k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  14.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 7.08k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1211|  7.08k|        IGRAPH_CHECK_OOM(i_vertex_out_weights, "Leiden algorithm failed, could not allocate memory for vertex weights.");
  ------------------
  |  |  709|  7.08k|    do { \
  |  |  710|  7.08k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1212|  7.08k|        IGRAPH_FINALLY(igraph_free, i_vertex_out_weights);
  ------------------
  |  |  603|  7.08k|    do { \
  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  ------------------
  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1213|  7.08k|        IGRAPH_VECTOR_INIT_FINALLY(i_vertex_out_weights, vcount);
  ------------------
  |  |  104|  7.08k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.08k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1214|  7.08k|        igraph_vector_fill(i_vertex_out_weights, 1);
 1215|  7.08k|    } else {
 1216|      0|        if (igraph_vector_size(vertex_out_weights) != vcount) {
  ------------------
  |  Branch (1216:13): [True: 0, False: 0]
  ------------------
 1217|      0|            IGRAPH_ERRORF("Vertex %sweight vector length (%" IGRAPH_PRId ") does not match number of vertices (%" IGRAPH_PRId ").",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  ------------------
  |  |  |  Branch (466:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1218|      0|                          IGRAPH_EINVAL,
 1219|      0|                          directed ? "out-" : "",
 1220|      0|                          igraph_vector_size(vertex_out_weights), vcount);
 1221|      0|        }
 1222|      0|        i_vertex_out_weights = (igraph_vector_t*)vertex_out_weights;
 1223|      0|    }
 1224|       |
 1225|  7.08k|    if (directed) {
  ------------------
  |  Branch (1225:9): [True: 3.54k, False: 3.54k]
  ------------------
 1226|       |        /* When in-weights are not given for a directed graph,
 1227|       |         * assume that they are the same as the out-weights.
 1228|       |         * This effectively ignores edge directions. */
 1229|  3.54k|        if (vertex_in_weights) {
  ------------------
  |  Branch (1229:13): [True: 0, False: 3.54k]
  ------------------
 1230|      0|            if (igraph_vector_size(vertex_in_weights) != vcount) {
  ------------------
  |  Branch (1230:17): [True: 0, False: 0]
  ------------------
 1231|      0|                IGRAPH_ERRORF("Vertex in-weight vector length (%" IGRAPH_PRId ") does not match number of vertices (%" IGRAPH_PRId ").",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1232|      0|                              IGRAPH_EINVAL,
 1233|      0|                              igraph_vector_size(vertex_in_weights), vcount);
 1234|      0|            }
 1235|      0|            i_vertex_in_weights = (igraph_vector_t*)vertex_in_weights;
 1236|  3.54k|        } else {
 1237|  3.54k|            i_vertex_in_weights = i_vertex_out_weights;
 1238|  3.54k|        }
 1239|  3.54k|    } else {
 1240|       |        /* In-weights must be NULL in the undirected case. */
 1241|  3.54k|        if (vertex_in_weights) {
  ------------------
  |  Branch (1241:13): [True: 0, False: 3.54k]
  ------------------
 1242|      0|            IGRAPH_ERROR("Vertex in-weights must not be given for undirected graphs.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1243|  3.54k|        } else {
 1244|  3.54k|            i_vertex_in_weights = NULL;
 1245|  3.54k|        }
 1246|  3.54k|    }
 1247|       |
 1248|       |    /* Perform actual Leiden algorithm iteratively. We either
 1249|       |     * perform a fixed number of iterations, or we perform
 1250|       |     * iterations until the quality remains unchanged. Even if
 1251|       |     * a single iteration did not change anything, a subsequent
 1252|       |     * iteration may still find some improvement. This is because
 1253|       |     * each iteration explores different subsets of vertices.
 1254|       |     */
 1255|  7.08k|    igraph_bool_t changed = true;
 1256|  7.08k|    for (igraph_int_t itr = 0;
 1257|  21.2k|         n_iterations < 0 ? changed : itr < n_iterations;
  ------------------
  |  Branch (1257:10): [True: 0, False: 21.2k]
  |  Branch (1257:10): [True: 14.1k, False: 7.08k]
  ------------------
 1258|  14.1k|         itr++) {
 1259|  14.1k|        IGRAPH_CHECK(community_leiden(graph,
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
 1260|  14.1k|                                      i_edge_weights, i_vertex_out_weights, i_vertex_in_weights,
 1261|  14.1k|                                      resolution, beta,
 1262|  14.1k|                                      membership, nb_clusters, quality, &changed));
 1263|  14.1k|    }
 1264|       |
 1265|  7.08k|    if (!edge_weights) {
  ------------------
  |  Branch (1265:9): [True: 0, False: 7.08k]
  ------------------
 1266|      0|        igraph_vector_destroy(i_edge_weights);
 1267|      0|        IGRAPH_FREE(i_edge_weights);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1268|      0|        IGRAPH_FINALLY_CLEAN(2);
 1269|      0|    }
 1270|       |
 1271|  7.08k|    if (!vertex_out_weights) {
  ------------------
  |  Branch (1271:9): [True: 7.08k, False: 0]
  ------------------
 1272|  7.08k|        igraph_vector_destroy(i_vertex_out_weights);
 1273|  7.08k|        IGRAPH_FREE(i_vertex_out_weights);
  ------------------
  |  |   36|  7.08k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1274|  7.08k|        IGRAPH_FINALLY_CLEAN(2);
 1275|  7.08k|    }
 1276|       |
 1277|  7.08k|    return IGRAPH_SUCCESS;
 1278|  7.08k|}
leiden.c:community_leiden:
  814|  14.1k|        igraph_bool_t *changed) {
  815|       |
  816|  14.1k|    const igraph_int_t n = igraph_vcount(graph);
  817|  14.1k|    const igraph_bool_t directed = (vertex_in_weights != NULL);
  818|  14.1k|    igraph_int_t nb_refined_clusters;
  819|  14.1k|    igraph_int_t i, c;
  820|  14.1k|    igraph_t aggregated_graph, *i_graph;
  821|  14.1k|    igraph_vector_t aggregated_edge_weights;
  822|  14.1k|    igraph_vector_t aggregated_vertex_out_weights, aggregated_vertex_in_weights;
  823|  14.1k|    igraph_vector_int_t aggregated_membership;
  824|  14.1k|    igraph_vector_t *i_edge_weights;
  825|  14.1k|    igraph_vector_t *i_vertex_out_weights, *i_vertex_in_weights;
  826|  14.1k|    igraph_vector_int_t *i_membership;
  827|  14.1k|    igraph_vector_t tmp_edge_weights, tmp_vertex_out_weights, tmp_vertex_in_weights;
  828|  14.1k|    igraph_vector_int_t tmp_membership;
  829|  14.1k|    igraph_vector_int_t refined_membership;
  830|  14.1k|    igraph_vector_int_t aggregate_vertex;
  831|  14.1k|    igraph_vector_int_list_t clusters;
  832|  14.1k|    igraph_inclist_t edges_per_vertex;
  833|  14.1k|    igraph_bool_t continue_clustering;
  834|  14.1k|    igraph_int_t level = 0;
  835|       |
  836|       |    /* Initialize temporary weights and membership to be used in aggregation */
  837|  14.1k|    IGRAPH_VECTOR_INIT_FINALLY(&tmp_edge_weights, 0);
  ------------------
  |  |  104|  14.1k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  14.1k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  838|  14.1k|    IGRAPH_VECTOR_INIT_FINALLY(&tmp_vertex_out_weights, 0);
  ------------------
  |  |  104|  14.1k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  14.1k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  839|  14.1k|    if (directed) {
  ------------------
  |  Branch (839:9): [True: 7.08k, False: 7.08k]
  ------------------
  840|  7.08k|        IGRAPH_VECTOR_INIT_FINALLY(&tmp_vertex_in_weights, 0);
  ------------------
  |  |  104|  7.08k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.08k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  841|  7.08k|    }
  842|  14.1k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&tmp_membership, 0);
  ------------------
  |  |  119|  14.1k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  14.1k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  843|       |
  844|       |    /* Initialize clusters */
  845|  14.1k|    IGRAPH_VECTOR_INT_LIST_INIT_FINALLY(&clusters, n);
  ------------------
  |  |   58|  14.1k|    do { IGRAPH_CHECK(igraph_vector_int_list_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  14.1k|        IGRAPH_FINALLY(igraph_vector_int_list_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (59:69): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  846|       |
  847|       |    /* Initialize aggregate vertices, which initially is identical to simply the
  848|       |     * vertices in the graph. */
  849|  14.1k|    IGRAPH_CHECK(igraph_vector_int_init_range(&aggregate_vertex, 0, n));
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  850|  14.1k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &aggregate_vertex);
  ------------------
  |  |  603|  14.1k|    do { \
  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  ------------------
  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  851|       |
  852|       |    /* Initialize refined membership */
  853|  14.1k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&refined_membership, 0);
  ------------------
  |  |  119|  14.1k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  14.1k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  854|       |
  855|       |    /* Initialize aggregated graph */
  856|  14.1k|    IGRAPH_CHECK(igraph_empty(&aggregated_graph, 0, directed));
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  857|  14.1k|    IGRAPH_FINALLY(igraph_destroy, &aggregated_graph);
  ------------------
  |  |  603|  14.1k|    do { \
  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  ------------------
  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  858|       |
  859|       |    /* Initialize aggregated edge weights */
  860|  14.1k|    IGRAPH_VECTOR_INIT_FINALLY(&aggregated_edge_weights, 0);
  ------------------
  |  |  104|  14.1k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  14.1k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  861|       |
  862|       |    /* Initialize aggregated vertex weights */
  863|  14.1k|    IGRAPH_VECTOR_INIT_FINALLY(&aggregated_vertex_out_weights, 0);
  ------------------
  |  |  104|  14.1k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  14.1k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  864|  14.1k|    if (directed) {
  ------------------
  |  Branch (864:9): [True: 7.08k, False: 7.08k]
  ------------------
  865|  7.08k|        IGRAPH_VECTOR_INIT_FINALLY(&aggregated_vertex_in_weights, 0);
  ------------------
  |  |  104|  7.08k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.08k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  866|  7.08k|    }
  867|       |
  868|       |    /* Initialize aggregated membership */
  869|  14.1k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&aggregated_membership, 0);
  ------------------
  |  |  119|  14.1k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  14.1k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  870|       |
  871|       |    /* Set actual graph, weights and membership to be used. */
  872|  14.1k|    i_graph = (igraph_t*)graph;
  873|  14.1k|    i_edge_weights = edge_weights;
  874|  14.1k|    i_vertex_out_weights = vertex_out_weights;
  875|  14.1k|    i_vertex_in_weights = directed ? vertex_in_weights : NULL;
  ------------------
  |  Branch (875:27): [True: 7.08k, False: 7.08k]
  ------------------
  876|  14.1k|    i_membership = membership;
  877|       |
  878|       |    /* Clean membership: ensure that cluster indices are 0 <= c < n. */
  879|  14.1k|    IGRAPH_CHECK(igraph_reindex_membership(i_membership, NULL, nb_clusters));
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  880|       |
  881|       |    /* We start out with no changes, whenever a vertex is moved, this will be set to true. */
  882|  14.1k|    *changed = false;
  883|  20.5k|    do {
  884|       |
  885|       |        /* Get incidence list for fast iteration */
  886|  20.5k|        IGRAPH_CHECK(igraph_inclist_init( i_graph, &edges_per_vertex, IGRAPH_ALL, IGRAPH_LOOPS_TWICE));
  ------------------
  |  |  656|  20.5k|    do { \
  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  887|  20.5k|        IGRAPH_FINALLY(igraph_inclist_destroy, &edges_per_vertex);
  ------------------
  |  |  603|  20.5k|    do { \
  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  ------------------
  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  888|       |
  889|       |        /* Move around the vertices in order to increase the quality */
  890|  20.5k|        IGRAPH_CHECK(leiden_fastmove_vertices(i_graph,
  ------------------
  |  |  656|  20.5k|    do { \
  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  891|  20.5k|                                              &edges_per_vertex,
  892|  20.5k|                                              i_edge_weights,
  893|  20.5k|                                              i_vertex_out_weights, i_vertex_in_weights,
  894|  20.5k|                                              resolution,
  895|  20.5k|                                              nb_clusters,
  896|  20.5k|                                              i_membership,
  897|  20.5k|                                              changed));
  898|       |
  899|       |        /* We only continue clustering if not all clusters are represented by a
  900|       |         * single vertex yet
  901|       |         */
  902|  20.5k|        continue_clustering = (*nb_clusters < igraph_vcount(i_graph));
  903|       |
  904|  20.5k|        if (continue_clustering) {
  ------------------
  |  Branch (904:13): [True: 6.35k, False: 14.1k]
  ------------------
  905|       |            /* Get vertex sets for each cluster. */
  906|  6.35k|            IGRAPH_CHECK(leiden_get_clusters(i_membership, &clusters));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  907|       |
  908|       |            /* Ensure refined membership is correct size */
  909|  6.35k|            IGRAPH_CHECK(igraph_vector_int_resize(&refined_membership, igraph_vcount(i_graph)));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  910|       |
  911|       |            /* Refine each cluster */
  912|  6.35k|            nb_refined_clusters = 0;
  913|   265k|            for (c = 0; c < *nb_clusters; c++) {
  ------------------
  |  Branch (913:25): [True: 258k, False: 6.35k]
  ------------------
  914|   258k|                igraph_vector_int_t* cluster = igraph_vector_int_list_get_ptr(&clusters, c);
  915|   258k|                IGRAPH_CHECK(leiden_merge_vertices(i_graph,
  ------------------
  |  |  656|   258k|    do { \
  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   258k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  916|   258k|                                                   &edges_per_vertex,
  917|   258k|                                                   i_edge_weights,
  918|   258k|                                                   i_vertex_out_weights, i_vertex_in_weights,
  919|   258k|                                                   cluster, i_membership, c,
  920|   258k|                                                   resolution, beta,
  921|   258k|                                                   &nb_refined_clusters, &refined_membership));
  922|       |                /* Empty cluster */
  923|   258k|                igraph_vector_int_clear(cluster);
  924|   258k|            }
  925|       |
  926|       |            /* If refinement didn't aggregate anything, we aggregate on the basis of
  927|       |             * the actual clustering */
  928|  6.35k|            if (nb_refined_clusters >= igraph_vcount(i_graph)) {
  ------------------
  |  Branch (928:17): [True: 97, False: 6.26k]
  ------------------
  929|     97|                IGRAPH_CHECK(igraph_vector_int_update(&refined_membership, i_membership));
  ------------------
  |  |  656|     97|    do { \
  |  |  657|     97|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|     97|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|     97|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|     97|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 97]
  |  |  ------------------
  ------------------
  930|     97|                nb_refined_clusters = *nb_clusters;
  931|     97|            }
  932|       |
  933|       |            /* Keep track of aggregate vertex. */
  934|   283k|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (934:25): [True: 277k, False: 6.35k]
  ------------------
  935|       |                /* Current aggregate vertex */
  936|   277k|                igraph_int_t v_aggregate = VECTOR(aggregate_vertex)[i];
  ------------------
  |  |   60|   277k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  937|       |                /* New aggregate vertex */
  938|   277k|                VECTOR(aggregate_vertex)[i] = VECTOR(refined_membership)[v_aggregate];
  ------------------
  |  |   60|   277k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(aggregate_vertex)[i] = VECTOR(refined_membership)[v_aggregate];
  ------------------
  |  |   60|   277k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  939|   277k|            }
  940|       |
  941|  6.35k|            IGRAPH_CHECK(leiden_aggregate(
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  12.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  ------------------
  |  |  |  Branch (657:40): [True: 1.32k, False: 5.03k]
  |  |  ------------------
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  942|  6.35k|                i_graph,
  943|  6.35k|                &edges_per_vertex,
  944|  6.35k|                i_edge_weights,
  945|  6.35k|                i_vertex_out_weights, i_vertex_in_weights,
  946|  6.35k|                i_membership, &refined_membership, nb_refined_clusters,
  947|  6.35k|                &aggregated_graph,
  948|  6.35k|                &tmp_edge_weights,
  949|  6.35k|                &tmp_vertex_out_weights, directed ? &tmp_vertex_in_weights : NULL,
  950|  6.35k|                &tmp_membership));
  951|       |
  952|       |            /* On the lowest level, the actual graph and vertex and edge weights and
  953|       |             * membership are used. On higher levels, we will use the aggregated graph
  954|       |             * and associated vectors.
  955|       |             */
  956|  6.35k|            if (level == 0) {
  ------------------
  |  Branch (956:17): [True: 5.62k, False: 729]
  ------------------
  957|       |                /* Set actual graph, weights and membership to be used. */
  958|  5.62k|                i_graph = &aggregated_graph;
  959|  5.62k|                i_edge_weights = &aggregated_edge_weights;
  960|  5.62k|                i_vertex_out_weights = &aggregated_vertex_out_weights;
  961|  5.62k|                if (directed) {
  ------------------
  |  Branch (961:21): [True: 1.12k, False: 4.50k]
  ------------------
  962|  1.12k|                    i_vertex_in_weights = &aggregated_vertex_in_weights;
  963|  1.12k|                }
  964|  5.62k|                i_membership = &aggregated_membership;
  965|  5.62k|            }
  966|       |
  967|       |            /* Update the aggregated administration. */
  968|  6.35k|            IGRAPH_CHECK(igraph_vector_update(i_edge_weights, &tmp_edge_weights));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  969|  6.35k|            IGRAPH_CHECK(igraph_vector_update(i_vertex_out_weights, &tmp_vertex_out_weights));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  970|  6.35k|            if (directed) {
  ------------------
  |  Branch (970:17): [True: 1.32k, False: 5.03k]
  ------------------
  971|  1.32k|                IGRAPH_CHECK(igraph_vector_update(i_vertex_in_weights, &tmp_vertex_in_weights));
  ------------------
  |  |  656|  1.32k|    do { \
  |  |  657|  1.32k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.32k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.32k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.32k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
  972|  1.32k|            }
  973|  6.35k|            IGRAPH_CHECK(igraph_vector_int_update(i_membership, &tmp_membership));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  974|       |
  975|  6.35k|            level += 1;
  976|  6.35k|        }
  977|       |
  978|       |        /* We are done iterating, so we destroy the incidence list */
  979|  20.5k|        igraph_inclist_destroy(&edges_per_vertex);
  980|  20.5k|        IGRAPH_FINALLY_CLEAN(1);
  981|  20.5k|    } while (continue_clustering);
  ------------------
  |  Branch (981:14): [True: 6.35k, False: 14.1k]
  ------------------
  982|       |
  983|       |    /* Map the cluster membership in the aggregate network (level > 0) back to the clusters
  984|       |     * in the original network (level == 0).
  985|       |     */
  986|  14.1k|    if (level > 0) {
  ------------------
  |  Branch (986:9): [True: 5.62k, False: 8.53k]
  ------------------
  987|   248k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (987:21): [True: 242k, False: 5.62k]
  ------------------
  988|   242k|            VECTOR(*membership)[i] = VECTOR(*i_membership)[VECTOR(aggregate_vertex)[i]];
  ------------------
  |  |   60|   242k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(*i_membership)[VECTOR(aggregate_vertex)[i]];
  ------------------
  |  |   60|   242k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(*i_membership)[VECTOR(aggregate_vertex)[i]];
  ------------------
  |  |   60|   242k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  989|   242k|        }
  990|  5.62k|    }
  991|       |
  992|       |    /* Free aggregated graph and associated vectors */
  993|  14.1k|    igraph_vector_int_destroy(&aggregated_membership);
  994|  14.1k|    if (directed) igraph_vector_destroy(&aggregated_vertex_in_weights);
  ------------------
  |  Branch (994:9): [True: 7.08k, False: 7.08k]
  ------------------
  995|  14.1k|    igraph_vector_destroy(&aggregated_vertex_out_weights);
  996|  14.1k|    igraph_vector_destroy(&aggregated_edge_weights);
  997|  14.1k|    igraph_destroy(&aggregated_graph);
  998|       |
  999|       |    /* Free remaining memory */
 1000|  14.1k|    igraph_vector_int_destroy(&refined_membership);
 1001|  14.1k|    igraph_vector_int_destroy(&aggregate_vertex);
 1002|  14.1k|    igraph_vector_int_list_destroy(&clusters);
 1003|  14.1k|    igraph_vector_int_destroy(&tmp_membership);
 1004|  14.1k|    igraph_vector_destroy(&tmp_vertex_out_weights);
 1005|  14.1k|    if (directed) igraph_vector_destroy(&tmp_vertex_in_weights);
  ------------------
  |  Branch (1005:9): [True: 7.08k, False: 7.08k]
  ------------------
 1006|  14.1k|    igraph_vector_destroy(&tmp_edge_weights);
 1007|       |
 1008|  14.1k|    if (directed) {
  ------------------
  |  Branch (1008:9): [True: 7.08k, False: 7.08k]
  ------------------
 1009|  7.08k|        IGRAPH_FINALLY_CLEAN(12);
 1010|  7.08k|    } else {
 1011|  7.08k|        IGRAPH_FINALLY_CLEAN(10);
 1012|  7.08k|    }
 1013|       |
 1014|       |    /* Calculate quality */
 1015|  14.1k|    if (quality) {
  ------------------
  |  Branch (1015:9): [True: 14.1k, False: 0]
  ------------------
 1016|  14.1k|        IGRAPH_CHECK(leiden_quality(graph,
  ------------------
  |  |  656|  14.1k|    do { \
  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
 1017|  14.1k|                                    edge_weights, vertex_out_weights, vertex_in_weights,
 1018|  14.1k|                                    membership,
 1019|  14.1k|                                    *nb_clusters, resolution,
 1020|  14.1k|                                    quality));
 1021|  14.1k|    }
 1022|       |
 1023|  14.1k|    return IGRAPH_SUCCESS;
 1024|  14.1k|}
leiden.c:leiden_fastmove_vertices:
   59|  20.5k|        igraph_bool_t *changed) {
   60|       |
   61|  20.5k|    const igraph_int_t n = igraph_vcount(graph);
   62|  20.5k|    const igraph_bool_t directed = (vertex_in_weights != NULL);
   63|  20.5k|    igraph_dqueue_int_t unstable_vertices;
   64|  20.5k|    igraph_real_t max_diff, diff;
   65|  20.5k|    igraph_bitset_t neighbor_cluster_added, vertex_is_stable;
   66|  20.5k|    igraph_vector_t cluster_out_weights, cluster_in_weights;
   67|  20.5k|    igraph_vector_t edge_weights_per_cluster;
   68|  20.5k|    igraph_vector_int_t neighbor_clusters;
   69|  20.5k|    igraph_vector_int_t vertex_order;
   70|  20.5k|    igraph_vector_int_t nb_vertices_per_cluster;
   71|  20.5k|    igraph_stack_int_t empty_clusters;
   72|  20.5k|    igraph_int_t c, nb_neigh_clusters;
   73|  20.5k|    int iter = 0;
   74|       |
   75|       |    /* Initialize queue of unstable vertices and whether vertex is stable. Only
   76|       |     * unstable vertices are in the queue. */
   77|  20.5k|    IGRAPH_BITSET_INIT_FINALLY(&vertex_is_stable, n);
  ------------------
  |  |  259|  20.5k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  20.5k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  20.5k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   78|       |
   79|  20.5k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&unstable_vertices, n);
  ------------------
  |  |   61|  20.5k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  20.5k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   80|       |
   81|       |    /* Shuffle vertices */
   82|  20.5k|    IGRAPH_CHECK(igraph_vector_int_init_range(&vertex_order, 0, n));
  ------------------
  |  |  656|  20.5k|    do { \
  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   83|  20.5k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &vertex_order);
  ------------------
  |  |  603|  20.5k|    do { \
  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  ------------------
  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   84|  20.5k|    igraph_vector_int_shuffle(&vertex_order);
   85|       |
   86|       |    /* Add to the queue */
   87|   900k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (87:30): [True: 879k, False: 20.5k]
  ------------------
   88|   879k|        IGRAPH_CHECK(igraph_dqueue_int_push(&unstable_vertices, VECTOR(vertex_order)[i]));
  ------------------
  |  |  656|   879k|    do { \
  |  |  657|   879k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   879k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   879k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 879k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   879k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 879k]
  |  |  ------------------
  ------------------
   89|   879k|    }
   90|       |
   91|       |    /* Initialize cluster weights and nb vertices */
   92|  20.5k|    IGRAPH_VECTOR_INIT_FINALLY(&cluster_out_weights, n);
  ------------------
  |  |  104|  20.5k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  20.5k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   93|  20.5k|    if (directed) {
  ------------------
  |  Branch (93:9): [True: 8.40k, False: 12.1k]
  ------------------
   94|  8.40k|        IGRAPH_VECTOR_INIT_FINALLY(&cluster_in_weights, n);
  ------------------
  |  |  104|  8.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  8.40k|    do { \
  |  |  |  |  657|  8.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  8.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  8.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 8.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  8.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 8.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  8.40k|    do { \
  |  |  |  |  604|  8.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  8.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  8.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  8.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 8.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  8.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  8.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 8.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 8.40k]
  |  |  ------------------
  ------------------
   95|  8.40k|    }
   96|  20.5k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nb_vertices_per_cluster, n);
  ------------------
  |  |  119|  20.5k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  20.5k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
   97|   900k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (97:30): [True: 879k, False: 20.5k]
  ------------------
   98|   879k|        c = VECTOR(*membership)[i];
  ------------------
  |  |   60|   879k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   99|   879k|        VECTOR(cluster_out_weights)[c] += VECTOR(*vertex_out_weights)[i];
  ------------------
  |  |   60|   879k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(cluster_out_weights)[c] += VECTOR(*vertex_out_weights)[i];
  ------------------
  |  |   60|   879k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  100|   879k|        if (directed) {
  ------------------
  |  Branch (100:13): [True: 360k, False: 518k]
  ------------------
  101|   360k|            VECTOR(cluster_in_weights)[c] += VECTOR(*vertex_in_weights)[i];
  ------------------
  |  |   60|   360k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_in_weights)[c] += VECTOR(*vertex_in_weights)[i];
  ------------------
  |  |   60|   360k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  102|   360k|        }
  103|   879k|        VECTOR(nb_vertices_per_cluster)[c] += 1;
  ------------------
  |  |   60|   879k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  104|   879k|    }
  105|       |
  106|       |    /* Initialize empty clusters */
  107|  20.5k|    IGRAPH_STACK_INT_INIT_FINALLY(&empty_clusters, n);
  ------------------
  |  |   61|  20.5k|    do { IGRAPH_CHECK(igraph_stack_int_init(s, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  20.5k|        IGRAPH_FINALLY(igraph_stack_int_destroy, s); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:63): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  108|   900k|    for (c = 0; c < n; c++) {
  ------------------
  |  Branch (108:17): [True: 879k, False: 20.5k]
  ------------------
  109|   879k|        if (VECTOR(nb_vertices_per_cluster)[c] == 0) {
  ------------------
  |  |   60|   879k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (109:13): [True: 8.00k, False: 871k]
  ------------------
  110|  8.00k|            IGRAPH_CHECK(igraph_stack_int_push(&empty_clusters, c));
  ------------------
  |  |  656|  8.00k|    do { \
  |  |  657|  8.00k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  8.00k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  8.00k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 8.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  8.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 8.00k]
  |  |  ------------------
  ------------------
  111|  8.00k|        }
  112|   879k|    }
  113|       |
  114|       |    /* Initialize vectors to be used in calculating differences */
  115|  20.5k|    IGRAPH_VECTOR_INIT_FINALLY(&edge_weights_per_cluster, n);
  ------------------
  |  |  104|  20.5k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  20.5k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  116|       |
  117|       |    /* Initialize neighboring cluster */
  118|  20.5k|    IGRAPH_BITSET_INIT_FINALLY(&neighbor_cluster_added, n);
  ------------------
  |  |  259|  20.5k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  20.5k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  20.5k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  119|  20.5k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neighbor_clusters, n);
  ------------------
  |  |  119|  20.5k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  20.5k|    do { \
  |  |  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  20.5k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  20.5k|    do { \
  |  |  |  |  604|  20.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  20.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  20.5k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  20.5k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |  608|  20.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  20.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  120|       |
  121|       |    /* Iterate while the queue is not empty */
  122|   908k|    while (!igraph_dqueue_int_empty(&unstable_vertices)) {
  ------------------
  |  Branch (122:12): [True: 887k, False: 20.5k]
  ------------------
  123|   887k|        igraph_int_t v = igraph_dqueue_int_pop(&unstable_vertices);
  124|   887k|        igraph_int_t best_cluster, current_cluster = VECTOR(*membership)[v];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  125|   887k|        igraph_int_t degree;
  126|   887k|        igraph_vector_int_t *edges;
  127|       |
  128|       |        /* Remove vertex from current cluster */
  129|   887k|        VECTOR(cluster_out_weights)[current_cluster] -= VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(cluster_out_weights)[current_cluster] -= VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  130|   887k|        if (directed) {
  ------------------
  |  Branch (130:13): [True: 362k, False: 525k]
  ------------------
  131|   362k|            VECTOR(cluster_in_weights)[current_cluster] -= VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_in_weights)[current_cluster] -= VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  132|   362k|        }
  133|   887k|        VECTOR(nb_vertices_per_cluster)[current_cluster]--;
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  134|   887k|        if (VECTOR(nb_vertices_per_cluster)[current_cluster] == 0) {
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (134:13): [True: 864k, False: 23.0k]
  ------------------
  135|   864k|            IGRAPH_CHECK(igraph_stack_int_push(&empty_clusters, current_cluster));
  ------------------
  |  |  656|   864k|    do { \
  |  |  657|   864k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   864k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   864k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 864k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   864k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 864k]
  |  |  ------------------
  ------------------
  136|   864k|        }
  137|       |
  138|       |        /* Find out neighboring clusters */
  139|   887k|        c = igraph_stack_int_top(&empty_clusters);
  140|   887k|        VECTOR(neighbor_clusters)[0] = c;
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  141|   887k|        IGRAPH_BIT_SET(neighbor_cluster_added, c);
  ------------------
  |  |  103|   887k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   887k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   887k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   887k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   887k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|   887k|        nb_neigh_clusters = 1;
  143|       |
  144|       |        /* Determine the edge weight to each neighboring cluster */
  145|   887k|        edges = igraph_inclist_get(edges_per_vertex, v);
  ------------------
  |  |  102|   887k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  146|   887k|        degree = igraph_vector_int_size(edges);
  147|  1.73M|        for (igraph_int_t i = 0; i < degree; i++) {
  ------------------
  |  Branch (147:34): [True: 849k, False: 887k]
  ------------------
  148|   849k|            igraph_int_t e = VECTOR(*edges)[i];
  ------------------
  |  |   60|   849k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  149|   849k|            igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|   849k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   849k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   849k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   473k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   473k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   376k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   376k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 473k, False: 376k]
  |  |  ------------------
  ------------------
  150|   849k|            if (u != v) {
  ------------------
  |  Branch (150:17): [True: 751k, False: 98.0k]
  ------------------
  151|   751k|                c = VECTOR(*membership)[u];
  ------------------
  |  |   60|   751k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  152|   751k|                if (!IGRAPH_BIT_TEST(neighbor_cluster_added, c)) {
  ------------------
  |  |  142|   751k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   751k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   751k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   751k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   751k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   751k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (152:21): [True: 671k, False: 79.5k]
  ------------------
  153|   671k|                    IGRAPH_BIT_SET(neighbor_cluster_added, c);
  ------------------
  |  |  103|   671k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   671k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   671k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   671k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   671k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   671k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|   671k|                    VECTOR(neighbor_clusters)[nb_neigh_clusters++] = c;
  ------------------
  |  |   60|   671k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  155|   671k|                }
  156|   751k|                VECTOR(edge_weights_per_cluster)[c] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|   751k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(edge_weights_per_cluster)[c] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|   751k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  157|   751k|            }
  158|   849k|        }
  159|       |
  160|       |        /* Calculate maximum diff */
  161|   887k|        best_cluster = current_cluster;
  162|   887k|        max_diff = VECTOR(edge_weights_per_cluster)[current_cluster];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  163|   887k|        if (directed) {
  ------------------
  |  Branch (163:13): [True: 362k, False: 525k]
  ------------------
  164|   362k|            max_diff -=
  165|   362k|                (VECTOR(*vertex_in_weights)[v]  * VECTOR(cluster_out_weights)[current_cluster] +
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              (VECTOR(*vertex_in_weights)[v]  * VECTOR(cluster_out_weights)[current_cluster] +
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  166|   362k|                 VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[current_cluster]) * resolution;
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                               VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[current_cluster]) * resolution;
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  167|   525k|        } else {
  168|   525k|            max_diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[current_cluster] * resolution;
  ------------------
  |  |   60|   525k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          max_diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[current_cluster] * resolution;
  ------------------
  |  |   60|   525k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  169|   525k|        }
  170|  2.44M|        for (igraph_int_t i = 0; i < nb_neigh_clusters; i++) {
  ------------------
  |  Branch (170:34): [True: 1.55M, False: 887k]
  ------------------
  171|  1.55M|            c = VECTOR(neighbor_clusters)[i];
  ------------------
  |  |   60|  1.55M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  172|  1.55M|            diff = VECTOR(edge_weights_per_cluster)[c];
  ------------------
  |  |   60|  1.55M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  173|  1.55M|            if (directed) {
  ------------------
  |  Branch (173:17): [True: 627k, False: 931k]
  ------------------
  174|   627k|                diff -= (VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[c] +
  ------------------
  |  |   60|   627k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              diff -= (VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[c] +
  ------------------
  |  |   60|   627k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  175|   627k|                         VECTOR(*vertex_in_weights)[v]  * VECTOR(cluster_out_weights)[c]) * resolution;
  ------------------
  |  |   60|   627k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                       VECTOR(*vertex_in_weights)[v]  * VECTOR(cluster_out_weights)[c]) * resolution;
  ------------------
  |  |   60|   627k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  176|   931k|            } else {
  177|   931k|                diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[c] * resolution;
  ------------------
  |  |   60|   931k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[c] * resolution;
  ------------------
  |  |   60|   931k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  178|   931k|            }
  179|       |            /* Only consider strictly improving moves.
  180|       |             * Note that this is important in considering convergence.
  181|       |             */
  182|  1.55M|            if (diff > max_diff) {
  ------------------
  |  Branch (182:17): [True: 8.96k, False: 1.55M]
  ------------------
  183|  8.96k|                best_cluster = c;
  184|  8.96k|                max_diff = diff;
  185|  8.96k|            }
  186|  1.55M|            VECTOR(edge_weights_per_cluster)[c] = 0.0;
  ------------------
  |  |   60|  1.55M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  187|  1.55M|            IGRAPH_BIT_CLEAR(neighbor_cluster_added, c);
  ------------------
  |  |  121|  1.55M|#define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  1.55M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  1.55M|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.55M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  1.55M|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.55M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  1.55M|        }
  189|       |
  190|       |        /* Move vertex to best cluster */
  191|   887k|        VECTOR(cluster_out_weights)[best_cluster] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(cluster_out_weights)[best_cluster] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  192|   887k|        if (directed) {
  ------------------
  |  Branch (192:13): [True: 362k, False: 525k]
  ------------------
  193|   362k|            VECTOR(cluster_in_weights)[best_cluster] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_in_weights)[best_cluster] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|   362k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  194|   362k|        }
  195|   887k|        VECTOR(nb_vertices_per_cluster)[best_cluster]++;
  ------------------
  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  196|   887k|        if (best_cluster == igraph_stack_int_top(&empty_clusters)) {
  ------------------
  |  Branch (196:13): [True: 857k, False: 30.0k]
  ------------------
  197|   857k|            igraph_stack_int_pop(&empty_clusters);
  198|   857k|        }
  199|       |
  200|       |        /* Mark vertex as stable */
  201|   887k|        IGRAPH_BIT_SET(vertex_is_stable, v);
  ------------------
  |  |  103|   887k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   887k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   887k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   887k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   887k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   887k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|       |
  203|       |        /* Add stable neighbours that are not part of the new cluster to the queue */
  204|   887k|        if (best_cluster != current_cluster) {
  ------------------
  |  Branch (204:13): [True: 8.10k, False: 879k]
  ------------------
  205|  8.10k|            *changed = true;
  206|  8.10k|            VECTOR(*membership)[v] = best_cluster;
  ------------------
  |  |   60|  8.10k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  207|       |
  208|  54.1k|            for (igraph_int_t i = 0; i < degree; i++) {
  ------------------
  |  Branch (208:38): [True: 46.0k, False: 8.10k]
  ------------------
  209|  46.0k|                igraph_int_t e = VECTOR(*edges)[i];
  ------------------
  |  |   60|  46.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  210|  46.0k|                igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|  46.0k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  46.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  46.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  28.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  28.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  17.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  17.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 28.3k, False: 17.6k]
  |  |  ------------------
  ------------------
  211|  46.0k|                if (IGRAPH_BIT_TEST(vertex_is_stable, u) && VECTOR(*membership)[u] != best_cluster) {
  ------------------
  |  |  142|  92.0k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  46.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  46.0k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  46.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  46.0k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  46.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 12.9k, False: 33.0k]
  |  |  ------------------
  ------------------
                              if (IGRAPH_BIT_TEST(vertex_is_stable, u) && VECTOR(*membership)[u] != best_cluster) {
  ------------------
  |  |   60|  12.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (211:61): [True: 7.70k, False: 5.23k]
  ------------------
  212|  7.70k|                    IGRAPH_CHECK(igraph_dqueue_int_push(&unstable_vertices, u));
  ------------------
  |  |  656|  7.70k|    do { \
  |  |  657|  7.70k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.70k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.70k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.70k]
  |  |  ------------------
  ------------------
  213|  7.70k|                    IGRAPH_BIT_CLEAR(vertex_is_stable, u);
  ------------------
  |  |  121|  7.70k|#define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  7.70k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  7.70k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  7.70k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  7.70k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  7.70k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  7.70k|                }
  215|  46.0k|            }
  216|  8.10k|        }
  217|       |
  218|   887k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1 << 14);
  ------------------
  |  |   71|   887k|    do { \
  |  |   72|   887k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 887k]
  |  |  ------------------
  |  |   73|      0|            IGRAPH_ALLOW_INTERRUPTION(); \
  |  |  ------------------
  |  |  |  |   46|      0|    do { \
  |  |  |  |   47|      0|        if (igraph_i_interruption_handler) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (47:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |  |  |   50|      0|            } \
  |  |  |  |   51|      0|        } \
  |  |  |  |   52|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      0|            iter = 0; \
  |  |   75|      0|        } \
  |  |   76|   887k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 887k]
  |  |  ------------------
  ------------------
  219|   887k|    }
  220|       |
  221|  20.5k|    IGRAPH_CHECK(igraph_reindex_membership(membership, NULL, nb_clusters));
  ------------------
  |  |  656|  20.5k|    do { \
  |  |  657|  20.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  20.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  20.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  222|       |
  223|  20.5k|    igraph_vector_int_destroy(&neighbor_clusters);
  224|  20.5k|    igraph_bitset_destroy(&neighbor_cluster_added);
  225|  20.5k|    igraph_vector_destroy(&edge_weights_per_cluster);
  226|  20.5k|    igraph_stack_int_destroy(&empty_clusters);
  227|  20.5k|    igraph_vector_int_destroy(&nb_vertices_per_cluster);
  228|  20.5k|    if (directed) igraph_vector_destroy(&cluster_in_weights);
  ------------------
  |  Branch (228:9): [True: 8.40k, False: 12.1k]
  ------------------
  229|  20.5k|    igraph_vector_destroy(&cluster_out_weights);
  230|  20.5k|    igraph_vector_int_destroy(&vertex_order);
  231|  20.5k|    igraph_dqueue_int_destroy(&unstable_vertices);
  232|  20.5k|    igraph_bitset_destroy(&vertex_is_stable);
  233|  20.5k|    if (directed) {
  ------------------
  |  Branch (233:9): [True: 8.40k, False: 12.1k]
  ------------------
  234|  8.40k|        IGRAPH_FINALLY_CLEAN(10);
  235|  12.1k|    } else {
  236|  12.1k|        IGRAPH_FINALLY_CLEAN(9);
  237|  12.1k|    }
  238|       |
  239|  20.5k|    return IGRAPH_SUCCESS;
  240|  20.5k|}
leiden.c:leiden_get_clusters:
  556|  12.7k|        igraph_vector_int_list_t *clusters) {
  557|       |
  558|  12.7k|    const igraph_int_t n = igraph_vector_int_size(membership);
  559|       |
  560|   560k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (560:30): [True: 547k, False: 12.7k]
  ------------------
  561|       |        /* Get cluster for vertex i */
  562|   547k|        igraph_vector_int_t *cluster = igraph_vector_int_list_get_ptr(clusters, VECTOR(*membership)[i]);
  ------------------
  |  |   60|   547k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  563|       |
  564|       |        /* Add vertex i to cluster vector */
  565|   547k|        IGRAPH_CHECK(igraph_vector_int_push_back(cluster, i));
  ------------------
  |  |  656|   547k|    do { \
  |  |  657|   547k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   547k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   547k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 547k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   547k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 547k]
  |  |  ------------------
  ------------------
  566|   547k|    }
  567|       |
  568|  12.7k|    return IGRAPH_SUCCESS;
  569|  12.7k|}
leiden.c:leiden_merge_vertices:
  330|   258k|        igraph_vector_int_t *refined_membership) {
  331|       |
  332|   258k|    const igraph_bool_t directed = (vertex_in_weights != NULL);
  333|   258k|    igraph_vector_int_t vertex_order;
  334|   258k|    igraph_bitset_t non_singleton_cluster, neighbor_cluster_added;
  335|   258k|    igraph_real_t max_diff, total_cum_trans_diff, diff;
  336|   258k|    igraph_real_t total_vertex_out_weight = 0.0, total_vertex_in_weight = 0.0;
  337|   258k|    const igraph_int_t n = igraph_vector_int_size(vertex_subset);
  338|   258k|    igraph_vector_t cluster_out_weights, cluster_in_weights;
  339|   258k|    igraph_vector_t cum_trans_diff, edge_weights_per_cluster, external_edge_weight_per_cluster_in_subset;
  340|   258k|    igraph_vector_int_t neighbor_clusters;
  341|   258k|    igraph_vector_int_t *edges, nb_vertices_per_cluster;
  342|   258k|    igraph_int_t degree, nb_neigh_clusters;
  343|       |
  344|       |    /* Initialize cluster weights */
  345|   258k|    IGRAPH_VECTOR_INIT_FINALLY(&cluster_out_weights, n);
  ------------------
  |  |  104|   258k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|   258k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  346|   258k|    if (directed) {
  ------------------
  |  Branch (346:9): [True: 50.6k, False: 208k]
  ------------------
  347|  50.6k|        IGRAPH_VECTOR_INIT_FINALLY(&cluster_in_weights, n);
  ------------------
  |  |  104|  50.6k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  50.6k|    do { \
  |  |  |  |  657|  50.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  50.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  50.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 50.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  50.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 50.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  50.6k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  50.6k|    do { \
  |  |  |  |  604|  50.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  50.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  50.6k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  50.6k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 50.6k]
  |  |  |  |  ------------------
  |  |  |  |  608|  50.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  50.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 50.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 50.6k]
  |  |  ------------------
  ------------------
  348|  50.6k|    }
  349|       |
  350|       |    /* Initialize number of vertices per cluster */
  351|   258k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nb_vertices_per_cluster, n);
  ------------------
  |  |  119|   258k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   258k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  352|       |
  353|       |    /* Initialize external edge weight per cluster in subset */
  354|   258k|    IGRAPH_VECTOR_INIT_FINALLY(&external_edge_weight_per_cluster_in_subset, n);
  ------------------
  |  |  104|   258k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|   258k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  355|       |
  356|       |    /* Initialize administration for a singleton partition */
  357|   532k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (357:30): [True: 273k, False: 258k]
  ------------------
  358|   273k|        igraph_int_t v = VECTOR(*vertex_subset)[i];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  359|   273k|        VECTOR(*refined_membership)[v] = i;
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  360|   273k|        VECTOR(cluster_out_weights)[i] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(cluster_out_weights)[i] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  361|   273k|        total_vertex_out_weight += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  362|   273k|        if (directed) {
  ------------------
  |  Branch (362:13): [True: 53.9k, False: 220k]
  ------------------
  363|  53.9k|            VECTOR(cluster_in_weights)[i] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_in_weights)[i] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  364|  53.9k|            total_vertex_in_weight += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  365|  53.9k|        }
  366|   273k|        VECTOR(nb_vertices_per_cluster)[i] += 1;
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  367|       |
  368|       |        /* Find out neighboring clusters */
  369|   273k|        edges = igraph_inclist_get(edges_per_vertex, v);
  ------------------
  |  |  102|   273k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  370|   273k|        degree = igraph_vector_int_size(edges);
  371|   590k|        for (igraph_int_t j = 0; j < degree; j++) {
  ------------------
  |  Branch (371:34): [True: 316k, False: 273k]
  ------------------
  372|   316k|            igraph_int_t e = VECTOR(*edges)[j];
  ------------------
  |  |   60|   316k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  373|   316k|            igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|   316k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   316k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   316k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   164k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   151k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 164k, False: 151k]
  |  |  ------------------
  ------------------
  374|   316k|            if (u != v && VECTOR(*membership)[u] == cluster_subset) {
  ------------------
  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (374:17): [True: 303k, False: 12.7k]
  |  Branch (374:27): [True: 67.7k, False: 235k]
  ------------------
  375|  67.7k|                VECTOR(external_edge_weight_per_cluster_in_subset)[i] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  67.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(external_edge_weight_per_cluster_in_subset)[i] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  67.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  376|  67.7k|            }
  377|   316k|        }
  378|   273k|    }
  379|       |
  380|       |    /* Shuffle vertices */
  381|   258k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&vertex_order, vertex_subset));
  ------------------
  |  |  656|   258k|    do { \
  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   258k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  382|   258k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &vertex_order);
  ------------------
  |  |  603|   258k|    do { \
  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  ------------------
  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   258k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  383|   258k|    igraph_vector_int_shuffle(&vertex_order);
  384|       |
  385|       |    /* Initialize non singleton clusters */
  386|   258k|    IGRAPH_BITSET_INIT_FINALLY(&non_singleton_cluster, n);
  ------------------
  |  |  259|   258k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|   258k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|   258k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  387|       |
  388|       |    /* Initialize vectors to be used in calculating differences */
  389|   258k|    IGRAPH_VECTOR_INIT_FINALLY(&edge_weights_per_cluster, n);
  ------------------
  |  |  104|   258k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|   258k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  390|       |
  391|       |    /* Initialize neighboring cluster */
  392|   258k|    IGRAPH_BITSET_INIT_FINALLY(&neighbor_cluster_added, n);
  ------------------
  |  |  259|   258k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|   258k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|   258k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  393|   258k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neighbor_clusters, n);
  ------------------
  |  |  119|   258k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   258k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  394|       |
  395|       |    /* Initialize cumulative transformed difference */
  396|   258k|    IGRAPH_VECTOR_INIT_FINALLY(&cum_trans_diff, n);
  ------------------
  |  |  104|   258k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|   258k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  397|       |
  398|   532k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (398:30): [True: 273k, False: 258k]
  ------------------
  399|   273k|        igraph_int_t v = VECTOR(vertex_order)[i];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  400|   273k|        igraph_int_t chosen_cluster, best_cluster, current_cluster = VECTOR(*refined_membership)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  401|   273k|        igraph_real_t vertex_weight_prod;
  402|       |
  403|   273k|        if (directed) {
  ------------------
  |  Branch (403:13): [True: 53.9k, False: 220k]
  ------------------
  404|  53.9k|            vertex_weight_prod =
  405|  53.9k|                VECTOR(cluster_out_weights)[current_cluster] * (total_vertex_in_weight - VECTOR(cluster_in_weights)[current_cluster]) +
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(cluster_out_weights)[current_cluster] * (total_vertex_in_weight - VECTOR(cluster_in_weights)[current_cluster]) +
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  406|  53.9k|                VECTOR(cluster_in_weights)[current_cluster] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[current_cluster]);
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(cluster_in_weights)[current_cluster] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[current_cluster]);
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  407|   220k|        } else {
  408|   220k|            vertex_weight_prod = VECTOR(cluster_out_weights)[current_cluster] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[current_cluster]);
  ------------------
  |  |   60|   220k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          vertex_weight_prod = VECTOR(cluster_out_weights)[current_cluster] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[current_cluster]);
  ------------------
  |  |   60|   220k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  409|   220k|        }
  410|       |
  411|   273k|        if (!IGRAPH_BIT_TEST(non_singleton_cluster, current_cluster) &&
  ------------------
  |  |  142|   547k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   273k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   273k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   273k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   273k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (411:13): [True: 261k, False: 12.3k]
  ------------------
  412|   261k|            (VECTOR(external_edge_weight_per_cluster_in_subset)[current_cluster] >=
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (412:13): [True: 261k, False: 127]
  ------------------
  413|   261k|             vertex_weight_prod * resolution)) {
  414|       |            /* Remove vertex from current cluster, which is then a singleton by
  415|       |             * definition. */
  416|   261k|            VECTOR(cluster_out_weights)[current_cluster] = 0.0;
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  417|   261k|            if (directed) {
  ------------------
  |  Branch (417:17): [True: 51.3k, False: 210k]
  ------------------
  418|  51.3k|                VECTOR(cluster_in_weights)[current_cluster] = 0.0;
  ------------------
  |  |   60|  51.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  419|  51.3k|            }
  420|   261k|            VECTOR(nb_vertices_per_cluster)[current_cluster] = 0;
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  421|   261k|            VECTOR(external_edge_weight_per_cluster_in_subset)[current_cluster] = 0.0;
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  422|       |
  423|       |            /* Find out neighboring clusters */
  424|   261k|            edges = igraph_inclist_get(edges_per_vertex, v);
  ------------------
  |  |  102|   261k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  425|   261k|            degree = igraph_vector_int_size(edges);
  426|       |
  427|       |            /* Also add current cluster to ensure it can be chosen. */
  428|   261k|            VECTOR(neighbor_clusters)[0] = current_cluster;
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  429|   261k|            IGRAPH_BIT_SET(neighbor_cluster_added, current_cluster);
  ------------------
  |  |  103|   261k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   261k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   261k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   261k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   261k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|   261k|            nb_neigh_clusters = 1;
  431|   505k|            for (igraph_int_t j = 0; j < degree; j++) {
  ------------------
  |  Branch (431:38): [True: 243k, False: 261k]
  ------------------
  432|   243k|                igraph_int_t e = VECTOR(*edges)[j];
  ------------------
  |  |   60|   243k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  433|   243k|                igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|   243k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   243k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   243k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   120k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   122k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   122k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 120k, False: 122k]
  |  |  ------------------
  ------------------
  434|   243k|                if (u != v && VECTOR(*membership)[u] == cluster_subset) {
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (434:21): [True: 236k, False: 7.11k]
  |  Branch (434:31): [True: 37.1k, False: 199k]
  ------------------
  435|  37.1k|                    igraph_int_t c = VECTOR(*refined_membership)[u];
  ------------------
  |  |   60|  37.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  436|  37.1k|                    if (!IGRAPH_BIT_TEST(neighbor_cluster_added, c)) {
  ------------------
  |  |  142|  37.1k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  37.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  37.1k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  37.1k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  37.1k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  37.1k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (436:25): [True: 17.8k, False: 19.3k]
  ------------------
  437|  17.8k|                        IGRAPH_BIT_SET(neighbor_cluster_added, c);
  ------------------
  |  |  103|  17.8k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  17.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  17.8k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  17.8k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  17.8k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  17.8k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|  17.8k|                        VECTOR(neighbor_clusters)[nb_neigh_clusters++] = c;
  ------------------
  |  |   60|  17.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  439|  17.8k|                    }
  440|  37.1k|                    VECTOR(edge_weights_per_cluster)[c] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  37.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(edge_weights_per_cluster)[c] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  37.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  441|  37.1k|                }
  442|   243k|            }
  443|       |
  444|       |            /* Calculate diffs */
  445|   261k|            best_cluster = current_cluster;
  446|   261k|            max_diff = 0.0;
  447|   261k|            total_cum_trans_diff = 0.0;
  448|   540k|            for (igraph_int_t j = 0; j < nb_neigh_clusters; j++) {
  ------------------
  |  Branch (448:38): [True: 279k, False: 261k]
  ------------------
  449|   279k|                igraph_int_t c = VECTOR(neighbor_clusters)[j];
  ------------------
  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  450|       |
  451|   279k|                if (directed) {
  ------------------
  |  Branch (451:21): [True: 55.3k, False: 224k]
  ------------------
  452|  55.3k|                    vertex_weight_prod =
  453|  55.3k|                        VECTOR(cluster_out_weights)[c] * (total_vertex_in_weight - VECTOR(cluster_in_weights)[c]) +
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(cluster_out_weights)[c] * (total_vertex_in_weight - VECTOR(cluster_in_weights)[c]) +
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  454|  55.3k|                        VECTOR(cluster_in_weights)[c] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[c]);
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(cluster_in_weights)[c] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[c]);
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  455|   224k|                } else {
  456|   224k|                    vertex_weight_prod = VECTOR(cluster_out_weights)[c] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[c]);
  ------------------
  |  |   60|   224k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  vertex_weight_prod = VECTOR(cluster_out_weights)[c] * (total_vertex_out_weight - VECTOR(cluster_out_weights)[c]);
  ------------------
  |  |   60|   224k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  457|   224k|                }
  458|       |
  459|   279k|                if (VECTOR(external_edge_weight_per_cluster_in_subset)[c] >= vertex_weight_prod * resolution) {
  ------------------
  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (459:21): [True: 279k, False: 110]
  ------------------
  460|   279k|                    diff = VECTOR(edge_weights_per_cluster)[c];
  ------------------
  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  461|   279k|                    if (directed) {
  ------------------
  |  Branch (461:25): [True: 55.3k, False: 223k]
  ------------------
  462|  55.3k|                        diff -= (VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[c] +
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      diff -= (VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_in_weights)[c] +
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  463|  55.3k|                                 VECTOR(*vertex_in_weights)[v] * VECTOR(cluster_out_weights)[c]) * resolution;
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                               VECTOR(*vertex_in_weights)[v] * VECTOR(cluster_out_weights)[c]) * resolution;
  ------------------
  |  |   60|  55.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  464|   223k|                    } else {
  465|   223k|                        diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[c] * resolution;
  ------------------
  |  |   60|   223k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      diff -= VECTOR(*vertex_out_weights)[v] * VECTOR(cluster_out_weights)[c] * resolution;
  ------------------
  |  |   60|   223k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  466|   223k|                    }
  467|       |
  468|       |
  469|   279k|                    if (diff > max_diff) {
  ------------------
  |  Branch (469:25): [True: 16.2k, False: 262k]
  ------------------
  470|  16.2k|                        best_cluster = c;
  471|  16.2k|                        max_diff = diff;
  472|  16.2k|                    }
  473|       |
  474|       |                    /* Calculate the transformed difference for sampling */
  475|   279k|                    if (diff >= 0) {
  ------------------
  |  Branch (475:25): [True: 278k, False: 489]
  ------------------
  476|   278k|                        total_cum_trans_diff += exp(diff / beta);
  477|   278k|                    }
  478|       |
  479|   279k|                }
  480|       |
  481|   279k|                VECTOR(cum_trans_diff)[j] = total_cum_trans_diff;
  ------------------
  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  482|   279k|                VECTOR(edge_weights_per_cluster)[c] = 0.0;
  ------------------
  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  483|   279k|                IGRAPH_BIT_CLEAR(neighbor_cluster_added, c);
  ------------------
  |  |  121|   279k|#define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   279k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   279k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   279k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   279k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   279k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|   279k|            }
  485|       |
  486|       |            /* Determine the neighboring cluster to which the currently selected vertex
  487|       |             * will be moved.
  488|       |             */
  489|   261k|            if (total_cum_trans_diff < IGRAPH_INFINITY) {
  ------------------
  |  |  137|   261k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  |  Branch (489:17): [True: 260k, False: 987]
  ------------------
  490|   260k|                igraph_real_t r = RNG_UNIF(0, total_cum_trans_diff);
  ------------------
  |  |  154|   260k|#define RNG_UNIF(l,h)    (igraph_rng_get_unif(igraph_rng_default(),(l),(h)))
  ------------------
  491|   260k|                igraph_int_t chosen_idx;
  492|   260k|                igraph_vector_binsearch_slice(&cum_trans_diff, r, &chosen_idx, 0, nb_neigh_clusters);
  493|   260k|                chosen_cluster = VECTOR(neighbor_clusters)[chosen_idx];
  ------------------
  |  |   60|   260k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  494|   260k|            } else {
  495|    987|                chosen_cluster = best_cluster;
  496|    987|            }
  497|       |
  498|       |            /* Move vertex to randomly chosen cluster */
  499|   261k|            VECTOR(cluster_out_weights)[chosen_cluster] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_out_weights)[chosen_cluster] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  500|   261k|            if (directed) {
  ------------------
  |  Branch (500:17): [True: 51.3k, False: 210k]
  ------------------
  501|  51.3k|                VECTOR(cluster_in_weights)[chosen_cluster] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  51.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(cluster_in_weights)[chosen_cluster] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  51.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  502|  51.3k|            }
  503|   261k|            VECTOR(nb_vertices_per_cluster)[chosen_cluster]++;
  ------------------
  |  |   60|   261k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  504|       |
  505|   505k|            for (igraph_int_t j = 0; j < degree; j++) {
  ------------------
  |  Branch (505:38): [True: 243k, False: 261k]
  ------------------
  506|   243k|                igraph_int_t e = VECTOR(*edges)[j];
  ------------------
  |  |   60|   243k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  507|   243k|                igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|   243k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   243k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   243k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   120k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   122k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   122k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 120k, False: 122k]
  |  |  ------------------
  ------------------
  508|   243k|                if (u != v && VECTOR(*membership)[u] == cluster_subset) {
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (508:21): [True: 236k, False: 7.11k]
  |  Branch (508:31): [True: 37.1k, False: 199k]
  ------------------
  509|  37.1k|                    if (VECTOR(*refined_membership)[u] == chosen_cluster) {
  ------------------
  |  |   60|  37.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (509:25): [True: 30.9k, False: 6.20k]
  ------------------
  510|  30.9k|                        VECTOR(external_edge_weight_per_cluster_in_subset)[chosen_cluster] -= VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  30.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(external_edge_weight_per_cluster_in_subset)[chosen_cluster] -= VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  30.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  511|  30.9k|                    } else {
  512|  6.20k|                        VECTOR(external_edge_weight_per_cluster_in_subset)[chosen_cluster] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  6.20k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(external_edge_weight_per_cluster_in_subset)[chosen_cluster] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  6.20k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  513|  6.20k|                    }
  514|  37.1k|                }
  515|   243k|            }
  516|       |
  517|       |            /* Set cluster  */
  518|   261k|            if (chosen_cluster != current_cluster) {
  ------------------
  |  Branch (518:17): [True: 13.9k, False: 247k]
  ------------------
  519|  13.9k|                VECTOR(*refined_membership)[v] = chosen_cluster;
  ------------------
  |  |   60|  13.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  520|       |
  521|  13.9k|                IGRAPH_BIT_SET(non_singleton_cluster, chosen_cluster);
  ------------------
  |  |  103|  13.9k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  13.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  13.9k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  13.9k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  13.9k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  13.9k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|  13.9k|            }
  523|   261k|        } /* end if singleton and may be merged */
  524|   273k|    }
  525|       |
  526|   258k|    IGRAPH_CHECK(leiden_clean_refined_membership(vertex_subset, refined_membership, nb_refined_clusters));
  ------------------
  |  |  656|   258k|    do { \
  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   258k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  527|       |
  528|   258k|    igraph_vector_destroy(&cum_trans_diff);
  529|   258k|    igraph_vector_int_destroy(&neighbor_clusters);
  530|   258k|    igraph_bitset_destroy(&neighbor_cluster_added);
  531|   258k|    igraph_vector_destroy(&edge_weights_per_cluster);
  532|   258k|    igraph_bitset_destroy(&non_singleton_cluster);
  533|   258k|    igraph_vector_int_destroy(&vertex_order);
  534|   258k|    igraph_vector_destroy(&external_edge_weight_per_cluster_in_subset);
  535|   258k|    igraph_vector_int_destroy(&nb_vertices_per_cluster);
  536|   258k|    if (directed) igraph_vector_destroy(&cluster_in_weights);
  ------------------
  |  Branch (536:9): [True: 50.6k, False: 208k]
  ------------------
  537|   258k|    igraph_vector_destroy(&cluster_out_weights);
  538|   258k|    if (directed) {
  ------------------
  |  Branch (538:9): [True: 50.6k, False: 208k]
  ------------------
  539|  50.6k|        IGRAPH_FINALLY_CLEAN(10);
  540|   208k|    } else {
  541|   208k|        IGRAPH_FINALLY_CLEAN(9);
  542|   208k|    }
  543|       |
  544|   258k|    return IGRAPH_SUCCESS;
  545|   258k|}
leiden.c:leiden_clean_refined_membership:
  254|   258k|        igraph_int_t* nb_refined_clusters) {
  255|       |
  256|   258k|    const igraph_int_t n = igraph_vector_int_size(vertex_subset);
  257|   258k|    igraph_vector_int_t new_cluster;
  258|       |
  259|   258k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&new_cluster, n);
  ------------------
  |  |  119|   258k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   258k|    do { \
  |  |  |  |  657|   258k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   258k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   258k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   258k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   258k|    do { \
  |  |  |  |  604|   258k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   258k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   258k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   258k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  608|   258k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   258k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 258k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  260|       |
  261|       |    /* Clean clusters. We will store the new cluster + 1 so that cluster == 0
  262|       |     * indicates that no membership was assigned yet. */
  263|   258k|    *nb_refined_clusters += 1;
  264|   532k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (264:30): [True: 273k, False: 258k]
  ------------------
  265|   273k|        igraph_int_t v = VECTOR(*vertex_subset)[i];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  266|   273k|        igraph_int_t c = VECTOR(*refined_membership)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  267|   273k|        if (VECTOR(new_cluster)[c] == 0) {
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (267:13): [True: 260k, False: 13.9k]
  ------------------
  268|   260k|            VECTOR(new_cluster)[c] = *nb_refined_clusters;
  ------------------
  |  |   60|   260k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  269|   260k|            *nb_refined_clusters += 1;
  270|   260k|        }
  271|   273k|    }
  272|       |
  273|       |    /* Assign new cluster */
  274|   532k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (274:30): [True: 273k, False: 258k]
  ------------------
  275|   273k|        igraph_int_t v = VECTOR(*vertex_subset)[i];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  276|   273k|        igraph_int_t c = VECTOR(*refined_membership)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  277|   273k|        VECTOR(*refined_membership)[v] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*refined_membership)[v] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  278|   273k|    }
  279|       |    /* We used the cluster + 1, so correct */
  280|   258k|    *nb_refined_clusters -= 1;
  281|       |
  282|   258k|    igraph_vector_int_destroy(&new_cluster);
  283|   258k|    IGRAPH_FINALLY_CLEAN(1);
  284|       |
  285|   258k|    return IGRAPH_SUCCESS;
  286|   258k|}
leiden.c:leiden_aggregate:
  598|  6.35k|        igraph_vector_int_t *aggregated_membership) {
  599|       |
  600|  6.35k|    const igraph_bool_t directed = (vertex_in_weights != NULL);
  601|  6.35k|    igraph_vector_int_t aggregated_edges;
  602|  6.35k|    igraph_vector_t edge_weight_to_cluster;
  603|  6.35k|    igraph_vector_int_list_t refined_clusters;
  604|  6.35k|    igraph_vector_int_t *incident_edges;
  605|  6.35k|    igraph_vector_int_t neighbor_clusters;
  606|  6.35k|    igraph_bitset_t neighbor_cluster_added;
  607|  6.35k|    igraph_int_t c, degree, nb_neigh_clusters;
  608|       |
  609|       |    /* Get refined clusters */
  610|  6.35k|    IGRAPH_VECTOR_INT_LIST_INIT_FINALLY(&refined_clusters, nb_refined_clusters);
  ------------------
  |  |   58|  6.35k|    do { IGRAPH_CHECK(igraph_vector_int_list_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.35k|    do { \
  |  |  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  6.35k|        IGRAPH_FINALLY(igraph_vector_int_list_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.35k|    do { \
  |  |  |  |  604|  6.35k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.35k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.35k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.35k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.35k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (59:69): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  611|  6.35k|    IGRAPH_CHECK(leiden_get_clusters(refined_membership, &refined_clusters));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  612|       |
  613|       |    /* Initialize new edges */
  614|  6.35k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&aggregated_edges, 0);
  ------------------
  |  |  119|  6.35k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.35k|    do { \
  |  |  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.35k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.35k|    do { \
  |  |  |  |  604|  6.35k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.35k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.35k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.35k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.35k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  615|       |
  616|       |    /* We clear the aggregated edge weights, we will push each new edge weight */
  617|  6.35k|    igraph_vector_clear(aggregated_edge_weights);
  618|       |    /* Simply resize the aggregated vertex weights and membership, they can be set directly */
  619|  6.35k|    IGRAPH_CHECK(igraph_vector_resize(aggregated_vertex_out_weights, nb_refined_clusters));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  620|  6.35k|    if (directed) {
  ------------------
  |  Branch (620:9): [True: 1.32k, False: 5.03k]
  ------------------
  621|  1.32k|        IGRAPH_CHECK(igraph_vector_resize(aggregated_vertex_in_weights, nb_refined_clusters));
  ------------------
  |  |  656|  1.32k|    do { \
  |  |  657|  1.32k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.32k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.32k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.32k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
  622|  1.32k|    }
  623|  6.35k|    IGRAPH_CHECK(igraph_vector_int_resize(aggregated_membership, nb_refined_clusters));
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  624|       |
  625|  6.35k|    IGRAPH_VECTOR_INIT_FINALLY(&edge_weight_to_cluster, nb_refined_clusters);
  ------------------
  |  |  104|  6.35k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.35k|    do { \
  |  |  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  6.35k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.35k|    do { \
  |  |  |  |  604|  6.35k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.35k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.35k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.35k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.35k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  626|       |
  627|       |    /* Initialize neighboring cluster */
  628|  6.35k|    IGRAPH_BITSET_INIT_FINALLY(&neighbor_cluster_added, nb_refined_clusters);
  ------------------
  |  |  259|  6.35k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  6.35k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.35k|    do { \
  |  |  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  6.35k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.35k|    do { \
  |  |  |  |  604|  6.35k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.35k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.35k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.35k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.35k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  629|  6.35k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neighbor_clusters, nb_refined_clusters);
  ------------------
  |  |  119|  6.35k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.35k|    do { \
  |  |  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.35k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.35k|    do { \
  |  |  |  |  604|  6.35k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.35k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.35k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.35k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.35k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.35k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  630|       |
  631|       |    /* Check per cluster */
  632|   266k|    for (c = 0; c < nb_refined_clusters; c++) {
  ------------------
  |  Branch (632:17): [True: 259k, False: 6.35k]
  ------------------
  633|   259k|        igraph_vector_int_t* refined_cluster = igraph_vector_int_list_get_ptr(&refined_clusters, c);
  634|   259k|        igraph_int_t n_c = igraph_vector_int_size(refined_cluster);
  635|   259k|        igraph_int_t v = -1;
  636|       |
  637|       |        /* Calculate the total edge weight to other clusters */
  638|   259k|        VECTOR(*aggregated_vertex_out_weights)[c] = 0.0;
  ------------------
  |  |   60|   259k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  639|   259k|        if (directed) {
  ------------------
  |  Branch (639:13): [True: 50.9k, False: 209k]
  ------------------
  640|  50.9k|            VECTOR(*aggregated_vertex_in_weights)[c] = 0.0;
  ------------------
  |  |   60|  50.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  641|  50.9k|        }
  642|   259k|        nb_neigh_clusters = 0;
  643|   533k|        for (igraph_int_t i = 0; i < n_c; i++) {
  ------------------
  |  Branch (643:34): [True: 273k, False: 259k]
  ------------------
  644|   273k|            v = VECTOR(*refined_cluster)[i];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  645|   273k|            incident_edges = igraph_inclist_get(edges_per_vertex, v);
  ------------------
  |  |  102|   273k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  646|   273k|            degree = igraph_vector_int_size(incident_edges);
  647|       |
  648|   590k|            for (igraph_int_t j = 0; j < degree; j++) {
  ------------------
  |  Branch (648:38): [True: 316k, False: 273k]
  ------------------
  649|   316k|                igraph_int_t e = VECTOR(*incident_edges)[j];
  ------------------
  |  |   60|   316k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  650|   316k|                igraph_int_t u = IGRAPH_OTHER(graph, e, v);
  ------------------
  |  |  146|   316k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   316k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   316k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   164k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   151k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 164k, False: 151k]
  |  |  ------------------
  ------------------
  651|   316k|                igraph_int_t c2 = VECTOR(*refined_membership)[u];
  ------------------
  |  |   60|   316k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  652|       |
  653|   316k|                if (c2 > c) {
  ------------------
  |  Branch (653:21): [True: 120k, False: 195k]
  ------------------
  654|   120k|                    if (!IGRAPH_BIT_TEST(neighbor_cluster_added, c2)) {
  ------------------
  |  |  142|   120k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   120k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   120k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   120k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   120k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (654:25): [True: 105k, False: 15.5k]
  ------------------
  655|   105k|                        IGRAPH_BIT_SET(neighbor_cluster_added, c2);
  ------------------
  |  |  103|   105k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   105k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   105k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   105k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   105k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|   105k|                        VECTOR(neighbor_clusters)[nb_neigh_clusters++] = c2;
  ------------------
  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  657|   105k|                    }
  658|   120k|                    VECTOR(edge_weight_to_cluster)[c2] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(edge_weight_to_cluster)[c2] += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  659|   120k|                }
  660|   316k|            }
  661|       |
  662|   273k|            VECTOR(*aggregated_vertex_out_weights)[c] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*aggregated_vertex_out_weights)[c] += VECTOR(*vertex_out_weights)[v];
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  663|   273k|            if (directed) {
  ------------------
  |  Branch (663:17): [True: 53.9k, False: 220k]
  ------------------
  664|  53.9k|                VECTOR(*aggregated_vertex_in_weights)[c] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*aggregated_vertex_in_weights)[c] += VECTOR(*vertex_in_weights)[v];
  ------------------
  |  |   60|  53.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  665|  53.9k|            }
  666|   273k|        }
  667|       |
  668|       |        /* Add actual edges from this cluster to the other clusters */
  669|   364k|        for (igraph_int_t i = 0; i < nb_neigh_clusters; i++) {
  ------------------
  |  Branch (669:34): [True: 105k, False: 259k]
  ------------------
  670|   105k|            igraph_int_t c2 = VECTOR(neighbor_clusters)[i];
  ------------------
  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  671|       |
  672|       |            /* Add edge */
  673|   105k|            IGRAPH_CHECK(igraph_vector_int_push_back(&aggregated_edges, c));
  ------------------
  |  |  656|   105k|    do { \
  |  |  657|   105k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   105k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   105k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  674|   105k|            IGRAPH_CHECK(igraph_vector_int_push_back(&aggregated_edges, c2));
  ------------------
  |  |  656|   105k|    do { \
  |  |  657|   105k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   105k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   105k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  675|       |
  676|       |            /* Add edge weight */
  677|   105k|            IGRAPH_CHECK(igraph_vector_push_back(aggregated_edge_weights, VECTOR(edge_weight_to_cluster)[c2]));
  ------------------
  |  |  656|   105k|    do { \
  |  |  657|   105k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   105k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   105k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  678|       |
  679|   105k|            VECTOR(edge_weight_to_cluster)[c2] = 0.0;
  ------------------
  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  680|   105k|            IGRAPH_BIT_CLEAR(neighbor_cluster_added, c2);
  ------------------
  |  |  121|   105k|#define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   105k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   105k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   105k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_CLEAR(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] &= ~IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   105k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   105k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  681|   105k|        }
  682|       |
  683|   259k|        VECTOR(*aggregated_membership)[c] = VECTOR(*membership)[v];
  ------------------
  |  |   60|   259k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*aggregated_membership)[c] = VECTOR(*membership)[v];
  ------------------
  |  |   60|   259k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  684|       |
  685|   259k|    }
  686|       |
  687|  6.35k|    igraph_vector_int_destroy(&neighbor_clusters);
  688|  6.35k|    igraph_bitset_destroy(&neighbor_cluster_added);
  689|  6.35k|    igraph_vector_destroy(&edge_weight_to_cluster);
  690|  6.35k|    igraph_vector_int_list_destroy(&refined_clusters);
  691|  6.35k|    IGRAPH_FINALLY_CLEAN(4);
  692|       |
  693|  6.35k|    igraph_destroy(aggregated_graph);
  694|  6.35k|    IGRAPH_CHECK(igraph_create(aggregated_graph, &aggregated_edges, nb_refined_clusters,
  ------------------
  |  |  656|  6.35k|    do { \
  |  |  657|  6.35k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.35k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.35k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.35k]
  |  |  ------------------
  ------------------
  695|  6.35k|                               directed));
  696|       |
  697|  6.35k|    igraph_vector_int_destroy(&aggregated_edges);
  698|  6.35k|    IGRAPH_FINALLY_CLEAN(1);
  699|       |
  700|  6.35k|    return IGRAPH_SUCCESS;
  701|  6.35k|}
leiden.c:leiden_quality:
  738|  14.1k|        igraph_real_t *quality) {
  739|       |
  740|  14.1k|    const igraph_int_t vcount = igraph_vcount(graph);
  741|  14.1k|    const igraph_int_t ecount = igraph_ecount(graph);
  742|  14.1k|    const igraph_bool_t directed = (vertex_in_weights != NULL);
  743|  14.1k|    const igraph_real_t directed_multiplier = directed ? 1.0 : 2.0;
  ------------------
  |  Branch (743:47): [True: 7.08k, False: 7.08k]
  ------------------
  744|  14.1k|    igraph_vector_t cluster_out_weights, cluster_in_weights;
  745|  14.1k|    igraph_real_t total_edge_weight = 0.0;
  746|       |
  747|  14.1k|    *quality = 0.0;
  748|       |
  749|   317k|    for (igraph_int_t e=0; e < ecount; e++) {
  ------------------
  |  Branch (749:28): [True: 303k, False: 14.1k]
  ------------------
  750|   303k|        igraph_int_t from = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|   303k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  751|   303k|        igraph_int_t to = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|   303k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  752|   303k|        total_edge_weight += VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  753|       |
  754|       |        /* We add the internal edge weights. */
  755|   303k|        if (VECTOR(*membership)[from] == VECTOR(*membership)[to]) {
  ------------------
  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(*membership)[from] == VECTOR(*membership)[to]) {
  ------------------
  |  |   60|   303k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (755:13): [True: 81.9k, False: 221k]
  ------------------
  756|  81.9k|            *quality += directed_multiplier * VECTOR(*edge_weights)[e];
  ------------------
  |  |   60|  81.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  757|  81.9k|        }
  758|   303k|    }
  759|       |
  760|       |    /* Initialize and compute cluster weights. */
  761|       |
  762|  14.1k|    IGRAPH_VECTOR_INIT_FINALLY(&cluster_out_weights, vcount);
  ------------------
  |  |  104|  14.1k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  14.1k|    do { \
  |  |  |  |  657|  14.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  14.1k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  14.1k|    do { \
  |  |  |  |  604|  14.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  14.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  14.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  14.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  14.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  763|  14.1k|    if (directed) {
  ------------------
  |  Branch (763:9): [True: 7.08k, False: 7.08k]
  ------------------
  764|  7.08k|        IGRAPH_VECTOR_INIT_FINALLY(&cluster_in_weights, vcount);
  ------------------
  |  |  104|  7.08k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.08k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  765|  7.08k|    }
  766|       |
  767|   634k|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (767:30): [True: 619k, False: 14.1k]
  ------------------
  768|   619k|        igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|   619k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  769|   619k|        VECTOR(cluster_out_weights)[c] += VECTOR(*vertex_out_weights)[i];
  ------------------
  |  |   60|   619k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(cluster_out_weights)[c] += VECTOR(*vertex_out_weights)[i];
  ------------------
  |  |   60|   619k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  770|   619k|        if (directed) {
  ------------------
  |  Branch (770:13): [True: 309k, False: 309k]
  ------------------
  771|   309k|            VECTOR(cluster_in_weights)[c] += VECTOR(*vertex_in_weights)[i];
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(cluster_in_weights)[c] += VECTOR(*vertex_in_weights)[i];
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  772|   309k|        }
  773|   619k|    }
  774|       |
  775|       |    /* We subtract gamma * N^out_c * N^in_c */
  776|       |
  777|   620k|    for (igraph_int_t c = 0; c < nb_clusters; c++) {
  ------------------
  |  Branch (777:30): [True: 605k, False: 14.1k]
  ------------------
  778|   605k|        if (directed) {
  ------------------
  |  Branch (778:13): [True: 306k, False: 298k]
  ------------------
  779|   306k|            *quality -= resolution * VECTOR(cluster_out_weights)[c] * VECTOR(cluster_in_weights)[c];
  ------------------
  |  |   60|   306k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          *quality -= resolution * VECTOR(cluster_out_weights)[c] * VECTOR(cluster_in_weights)[c];
  ------------------
  |  |   60|   306k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  780|   306k|        } else {
  781|   298k|            *quality -= resolution * VECTOR(cluster_out_weights)[c] * VECTOR(cluster_out_weights)[c];
  ------------------
  |  |   60|   298k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          *quality -= resolution * VECTOR(cluster_out_weights)[c] * VECTOR(cluster_out_weights)[c];
  ------------------
  |  |   60|   298k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  782|   298k|        }
  783|   605k|    }
  784|       |
  785|  14.1k|    if (directed) {
  ------------------
  |  Branch (785:9): [True: 7.08k, False: 7.08k]
  ------------------
  786|  7.08k|        igraph_vector_destroy(&cluster_in_weights);
  787|  7.08k|        IGRAPH_FINALLY_CLEAN(1);
  788|  7.08k|    }
  789|  14.1k|    igraph_vector_destroy(&cluster_out_weights);
  790|  14.1k|    IGRAPH_FINALLY_CLEAN(1);
  791|       |
  792|       |    /* We normalise by m or 2m depending on directedness */
  793|  14.1k|    *quality /= (directed_multiplier * total_edge_weight);
  794|       |
  795|  14.1k|    return IGRAPH_SUCCESS;
  796|  14.1k|}

igraph_community_multilevel:
  597|  3.54k|                                           igraph_vector_t *modularity) {
  598|       |
  599|  3.54k|    igraph_t g;
  600|  3.54k|    igraph_vector_t w;
  601|  3.54k|    igraph_vector_int_t m;
  602|  3.54k|    igraph_vector_int_t level_membership;
  603|  3.54k|    igraph_real_t prev_q = -1, q = -1;
  604|  3.54k|    igraph_int_t level = 1;
  605|  3.54k|    igraph_int_t vcount = igraph_vcount(graph);
  606|  3.54k|    igraph_int_t ecount = igraph_ecount(graph);
  607|       |
  608|       |    /* Initial sanity checks on the input parameters */
  609|  3.54k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (609:9): [True: 0, False: 3.54k]
  ------------------
  610|      0|        IGRAPH_ERROR("Multi-level community detection works for undirected graphs only.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  611|      0|                     IGRAPH_UNIMPLEMENTED);
  612|      0|    }
  613|  3.54k|    if (weights) {
  ------------------
  |  Branch (613:9): [True: 3.54k, False: 0]
  ------------------
  614|  3.54k|        if (igraph_vector_size(weights) != ecount) {
  ------------------
  |  Branch (614:13): [True: 0, False: 3.54k]
  ------------------
  615|      0|            IGRAPH_ERROR("Weight vector length must agree with number of edges.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  616|      0|        }
  617|  3.54k|        if (ecount > 0) {
  ------------------
  |  Branch (617:13): [True: 3.43k, False: 107]
  ------------------
  618|  3.43k|            igraph_real_t minweight = igraph_vector_min(weights);
  619|  3.43k|            if (minweight < 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 3.43k]
  ------------------
  620|      0|                IGRAPH_ERROR("Weight vector must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  621|  3.43k|            } else if (isnan(minweight)) {
  ------------------
  |  Branch (621:24): [True: 0, False: 3.43k]
  ------------------
  622|      0|                IGRAPH_ERROR("Weight vector must not contain NaN values.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  623|      0|            }
  624|  3.43k|        }
  625|  3.54k|    }
  626|  3.54k|    if (resolution < 0.0) {
  ------------------
  |  Branch (626:9): [True: 0, False: 3.54k]
  ------------------
  627|      0|        IGRAPH_ERROR("The resolution parameter must be non-negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  628|      0|    }
  629|       |
  630|       |    /* Make a copy of the original graph, we will do the merges on the copy */
  631|  3.54k|    IGRAPH_CHECK(igraph_copy(&g, graph));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  632|  3.54k|    IGRAPH_FINALLY(igraph_destroy, &g);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  633|       |
  634|  3.54k|    if (weights) {
  ------------------
  |  Branch (634:9): [True: 3.54k, False: 0]
  ------------------
  635|  3.54k|        IGRAPH_CHECK(igraph_vector_init_copy(&w, weights));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  636|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, &w);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  637|  3.54k|    } else {
  638|      0|        IGRAPH_VECTOR_INIT_FINALLY(&w, igraph_ecount(&g));
  ------------------
  |  |  104|      0|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 0]
  |  |  ------------------
  ------------------
  639|      0|        igraph_vector_fill(&w, 1);
  640|      0|    }
  641|       |
  642|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&m, vcount);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  643|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&level_membership, vcount);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  644|       |
  645|  3.54k|    if (memberships || membership) {
  ------------------
  |  Branch (645:9): [True: 3.54k, False: 0]
  |  Branch (645:24): [True: 0, False: 0]
  ------------------
  646|       |        /* Put each vertex in its own community */
  647|   158k|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (647:34): [True: 154k, False: 3.54k]
  ------------------
  648|   154k|            VECTOR(level_membership)[i] = i;
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  649|   154k|        }
  650|  3.54k|    }
  651|  3.54k|    if (memberships) {
  ------------------
  |  Branch (651:9): [True: 3.54k, False: 0]
  ------------------
  652|       |        /* Resize the membership matrix to have vcount columns and no rows */
  653|  3.54k|        IGRAPH_CHECK(igraph_matrix_int_resize(memberships, 0, vcount));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  654|  3.54k|    }
  655|  3.54k|    if (modularity) {
  ------------------
  |  Branch (655:9): [True: 3.54k, False: 0]
  ------------------
  656|       |        /* Clear the modularity vector */
  657|  3.54k|        igraph_vector_clear(modularity);
  658|  3.54k|    }
  659|       |
  660|  7.81k|    while (true) {
  ------------------
  |  Branch (660:12): [True: 7.81k, Folded]
  ------------------
  661|       |        /* Remember the previous modularity and vertex count, do a single step */
  662|  7.81k|        igraph_int_t step_vcount = igraph_vcount(&g);
  663|       |
  664|  7.81k|        prev_q = q;
  665|  7.81k|        IGRAPH_CHECK(igraph_i_community_multilevel_step(&g, &w, &m, &q, resolution));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  666|       |
  667|       |        /* Were there any merges? If not, we have to stop the process */
  668|  7.81k|        if (igraph_vcount(&g) == step_vcount || q < prev_q) {
  ------------------
  |  Branch (668:13): [True: 3.53k, False: 4.27k]
  |  Branch (668:49): [True: 1, False: 4.27k]
  ------------------
  669|  3.54k|            break;
  670|  3.54k|        }
  671|       |
  672|  4.27k|        if (memberships || membership) {
  ------------------
  |  Branch (672:13): [True: 4.27k, False: 0]
  |  Branch (672:28): [True: 0, False: 0]
  ------------------
  673|   202k|            for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (673:38): [True: 198k, False: 4.27k]
  ------------------
  674|       |                /* Readjust the membership vector */
  675|   198k|                VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  676|   198k|            }
  677|  4.27k|        }
  678|       |
  679|  4.27k|        if (modularity) {
  ------------------
  |  Branch (679:13): [True: 4.27k, False: 0]
  ------------------
  680|       |            /* If we have to return the modularity scores, add it to the modularity vector */
  681|  4.27k|            IGRAPH_CHECK(igraph_vector_push_back(modularity, q));
  ------------------
  |  |  656|  4.27k|    do { \
  |  |  657|  4.27k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.27k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.27k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  682|  4.27k|        }
  683|       |
  684|  4.27k|        if (memberships) {
  ------------------
  |  Branch (684:13): [True: 4.27k, False: 0]
  ------------------
  685|       |            /* If we have to return the membership vectors at each level, store the new
  686|       |             * membership vector */
  687|  4.27k|            IGRAPH_CHECK(igraph_matrix_int_add_rows(memberships, 1));
  ------------------
  |  |  656|  4.27k|    do { \
  |  |  657|  4.27k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.27k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.27k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  688|  4.27k|            IGRAPH_CHECK(igraph_matrix_int_set_row(memberships, &level_membership, level - 1));
  ------------------
  |  |  656|  4.27k|    do { \
  |  |  657|  4.27k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.27k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.27k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  689|  4.27k|        }
  690|       |
  691|       |        /* debug("Level: %d Communities: %ld Modularity: %f\n", level, igraph_vcount(&g),
  692|       |          (double) q); */
  693|       |
  694|       |        /* Increase the level counter */
  695|  4.27k|        level++;
  696|  4.27k|    }
  697|       |
  698|       |    /* It might happen that there are no merges, so every vertex is in its
  699|       |       own community. We still might want the modularity score for that. */
  700|  3.54k|    if (modularity && igraph_vector_size(modularity) == 0) {
  ------------------
  |  Branch (700:9): [True: 3.54k, False: 0]
  |  Branch (700:23): [True: 107, False: 3.43k]
  ------------------
  701|    107|        igraph_vector_int_t tmp;
  702|    107|        igraph_real_t mod;
  703|       |
  704|    107|        IGRAPH_CHECK(igraph_vector_int_init_range(&tmp, 0, vcount));
  ------------------
  |  |  656|    107|    do { \
  |  |  657|    107|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    107|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  705|    107|        IGRAPH_FINALLY(igraph_vector_int_destroy, &tmp);
  ------------------
  |  |  603|    107|    do { \
  |  |  604|    107|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    107|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    107|         * incorrect destructor function with the pointer */ \
  |  |  607|    107|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 107]
  |  |  ------------------
  |  |  608|    107|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  706|       |
  707|    107|        IGRAPH_CHECK(igraph_modularity(graph, &tmp, weights, resolution,
  ------------------
  |  |  656|    107|    do { \
  |  |  657|    107|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    107|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  708|    107|                                       /* only undirected */ false, &mod));
  709|       |
  710|    107|        igraph_vector_int_destroy(&tmp);
  711|    107|        IGRAPH_FINALLY_CLEAN(1);
  712|       |
  713|    107|        IGRAPH_CHECK(igraph_vector_resize(modularity, 1));
  ------------------
  |  |  656|    107|    do { \
  |  |  657|    107|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    107|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  714|    107|        VECTOR(*modularity)[0] = mod;
  ------------------
  |  |   60|    107|#define VECTOR(v) ((v).stor_begin)
  ------------------
  715|    107|    }
  716|       |
  717|       |    /* If we need the final membership vector, copy it to the output */
  718|  3.54k|    if (membership) {
  ------------------
  |  Branch (718:9): [True: 3.54k, False: 0]
  ------------------
  719|  3.54k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, vcount));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  720|   158k|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (720:34): [True: 154k, False: 3.54k]
  ------------------
  721|   154k|            VECTOR(*membership)[i] = VECTOR(level_membership)[i];
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(level_membership)[i];
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  722|   154k|        }
  723|  3.54k|    }
  724|       |
  725|       |    /* Destroy the copy of the graph */
  726|  3.54k|    igraph_destroy(&g);
  727|       |
  728|       |    /* Destroy the temporary vectors */
  729|  3.54k|    igraph_vector_int_destroy(&m);
  730|  3.54k|    igraph_vector_destroy(&w);
  731|  3.54k|    igraph_vector_int_destroy(&level_membership);
  732|  3.54k|    IGRAPH_FINALLY_CLEAN(4);
  733|       |
  734|  3.54k|    return IGRAPH_SUCCESS;
  735|  3.54k|}
louvain.c:igraph_i_community_multilevel_step:
  327|  7.81k|        const igraph_real_t resolution) {
  328|       |
  329|  7.81k|    igraph_int_t vcount = igraph_vcount(graph);
  330|  7.81k|    igraph_int_t ecount = igraph_ecount(graph);
  331|  7.81k|    igraph_real_t q, pass_q;
  332|       |    /* int pass; // used only for debugging */
  333|  7.81k|    igraph_bool_t changed;
  334|  7.81k|    igraph_vector_int_t links_community;
  335|  7.81k|    igraph_vector_t links_weight;
  336|  7.81k|    igraph_vector_int_t edges;
  337|  7.81k|    igraph_vector_int_t temp_membership;
  338|  7.81k|    igraph_i_multilevel_community_list communities;
  339|  7.81k|    igraph_vector_int_t node_order;
  340|       |
  341|  7.81k|    IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, vcount));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  342|  7.81k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  7.81k|    do { \
  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  ------------------
  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  343|  7.81k|    igraph_vector_int_shuffle(&node_order);
  344|       |
  345|       |    /* Initialize data structures */
  346|  7.81k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&links_community, 0);
  ------------------
  |  |  119|  7.81k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.81k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  347|  7.81k|    IGRAPH_VECTOR_INIT_FINALLY(&links_weight, 0);
  ------------------
  |  |  104|  7.81k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.81k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  348|  7.81k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  7.81k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.81k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  349|  7.81k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&temp_membership, vcount);
  ------------------
  |  |  119|  7.81k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.81k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  350|  7.81k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, vcount));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  351|       |
  352|       |    /* Initialize list of communities from graph vertices */
  353|  7.81k|    communities.vertices_no = vcount;
  354|  7.81k|    communities.communities_no = vcount;
  355|  7.81k|    communities.weights = weights;
  356|  7.81k|    communities.weight_sum = 2.0 * igraph_vector_sum(weights);
  357|  7.81k|    communities.membership = membership;
  358|  7.81k|    communities.item = IGRAPH_CALLOC(vcount, igraph_i_multilevel_community);
  ------------------
  |  |   33|  7.81k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  15.6k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.81k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.81k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.81k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|  7.81k|    IGRAPH_CHECK_OOM(communities.item, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|  7.81k|    do { \
  |  |  710|  7.81k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  360|  7.81k|    IGRAPH_FINALLY(igraph_free, communities.item);
  ------------------
  |  |  603|  7.81k|    do { \
  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  ------------------
  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  361|       |
  362|       |    /* Still initializing the communities data structure */
  363|   304k|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (363:30): [True: 296k, False: 7.81k]
  ------------------
  364|   296k|        VECTOR(*communities.membership)[i] = i;
  ------------------
  |  |   60|   296k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  365|   296k|        communities.item[i].size = 1;
  366|   296k|        communities.item[i].weight_inside = 0;
  367|   296k|        communities.item[i].weight_all = 0;
  368|   296k|    }
  369|       |
  370|       |    /* Some more initialization :) */
  371|  96.1k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (371:30): [True: 88.3k, False: 7.81k]
  ------------------
  372|  88.3k|        igraph_int_t ffrom = IGRAPH_FROM(graph, i), fto = IGRAPH_TO(graph, i);
  ------------------
  |  |  115|  88.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      igraph_int_t ffrom = IGRAPH_FROM(graph, i), fto = IGRAPH_TO(graph, i);
  ------------------
  |  |  128|  88.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  373|  88.3k|        igraph_real_t weight = 1;
  374|       |
  375|  88.3k|        weight = VECTOR(*weights)[i];
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  376|  88.3k|        communities.item[ffrom].weight_all += weight;
  377|  88.3k|        communities.item[fto].weight_all += weight;
  378|  88.3k|        if (ffrom == fto) {
  ------------------
  |  Branch (378:13): [True: 17.5k, False: 70.7k]
  ------------------
  379|  17.5k|            communities.item[ffrom].weight_inside += 2 * weight;
  380|  17.5k|        }
  381|  88.3k|    }
  382|       |
  383|  7.81k|    q = igraph_i_multilevel_community_modularity(&communities, resolution);
  384|       |    /* pass = 1; */
  385|       |
  386|  20.7k|    do { /* Pass begin */
  387|  20.7k|        igraph_int_t temp_communities_no = communities.communities_no;
  388|       |
  389|  20.7k|        pass_q = q;
  390|  20.7k|        changed = false;
  391|       |
  392|       |        /* Save the current membership, it will be restored in case of worse result */
  393|  20.7k|        IGRAPH_CHECK(igraph_vector_int_update(&temp_membership, communities.membership));
  ------------------
  |  |  656|  20.7k|    do { \
  |  |  657|  20.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  20.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  20.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  20.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 20.7k]
  |  |  ------------------
  ------------------
  394|       |
  395|       |        /* Apply a random inversion to the node_order permutation vector to help escape
  396|       |         * rare situations of an infinite loop. A full re-shuffling of node_order would
  397|       |         * have a measurable performance impact, hence the single inversion.
  398|       |         * See https://github.com/igraph/igraph/issues/2650 for details. */
  399|  20.7k|        if (vcount > 1) {
  ------------------
  |  Branch (399:13): [True: 20.4k, False: 384]
  ------------------
  400|  20.4k|            igraph_int_t i1 = RNG_INTEGER(0, vcount-1);
  ------------------
  |  |  152|  20.4k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  401|  20.4k|            igraph_int_t i2 = RNG_INTEGER(0, vcount-1);
  ------------------
  |  |  152|  20.4k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  402|  20.4k|            igraph_int_t tmp = VECTOR(node_order)[i1];
  ------------------
  |  |   60|  20.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  403|  20.4k|            VECTOR(node_order)[i1] = VECTOR(node_order)[i2];
  ------------------
  |  |   60|  20.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(node_order)[i1] = VECTOR(node_order)[i2];
  ------------------
  |  |   60|  20.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  404|  20.4k|            VECTOR(node_order)[i2] = tmp;
  ------------------
  |  |   60|  20.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  405|  20.4k|        }
  406|       |
  407|  1.00M|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (407:34): [True: 985k, False: 20.7k]
  ------------------
  408|       |            /* Exclude vertex from its current community */
  409|   985k|            igraph_real_t weight_all = 0;
  410|   985k|            igraph_real_t weight_inside = 0;
  411|   985k|            igraph_real_t weight_loop = 0;
  412|   985k|            igraph_real_t max_q_gain = 0;
  413|   985k|            igraph_real_t max_weight;
  414|   985k|            igraph_int_t old_id, new_id, n, ni;
  415|       |
  416|   985k|            ni = VECTOR(node_order)[i];
  ------------------
  |  |   60|   985k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  417|       |
  418|   985k|            igraph_i_multilevel_community_links(graph, &communities,
  419|   985k|                                                ni, &edges,
  420|   985k|                                                &weight_all, &weight_inside,
  421|   985k|                                                &weight_loop, &links_community,
  422|   985k|                                                &links_weight);
  423|       |
  424|   985k|            old_id = VECTOR(*(communities.membership))[ni];
  ------------------
  |  |   60|   985k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  425|   985k|            new_id = old_id;
  426|       |
  427|       |            /* Update old community */
  428|   985k|            VECTOR(*communities.membership)[ni] = -1;
  ------------------
  |  |   60|   985k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  429|   985k|            communities.item[old_id].size--;
  430|   985k|            if (communities.item[old_id].size == 0) {
  ------------------
  |  Branch (430:17): [True: 776k, False: 208k]
  ------------------
  431|   776k|                communities.communities_no--;
  432|   776k|            }
  433|   985k|            communities.item[old_id].weight_all -= weight_all;
  434|   985k|            communities.item[old_id].weight_inside -= 2 * weight_inside + weight_loop;
  435|       |
  436|       |            /* debug("Remove %ld all: %lf Inside: %lf\n", ni, -weight_all, -2*weight_inside + weight_loop); */
  437|       |
  438|       |            /* Find new community to join with the best modification gain */
  439|   985k|            max_q_gain = 0;
  440|   985k|            max_weight = weight_inside;
  441|   985k|            n = igraph_vector_int_size(&links_community);
  442|       |
  443|  1.43M|            for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (443:38): [True: 451k, False: 985k]
  ------------------
  444|   451k|                igraph_int_t c = VECTOR(links_community)[j];
  ------------------
  |  |   60|   451k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  445|   451k|                igraph_real_t w = VECTOR(links_weight)[j];
  ------------------
  |  |   60|   451k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  446|       |
  447|   451k|                igraph_real_t q_gain =
  448|   451k|                    igraph_i_multilevel_community_modularity_gain(&communities, c, ni,
  449|   451k|                                                                  weight_all, w, resolution);
  450|       |                /* debug("Link %ld -> %ld weight: %lf gain: %lf\n", ni, c, (double) w, (double) q_gain); */
  451|   451k|                if (q_gain > max_q_gain) {
  ------------------
  |  Branch (451:21): [True: 286k, False: 165k]
  ------------------
  452|   286k|                    new_id = c;
  453|   286k|                    max_q_gain = q_gain;
  454|   286k|                    max_weight = w;
  455|   286k|                }
  456|   451k|            }
  457|       |
  458|       |            /* debug("Added vertex %ld to community %ld (gain %lf).\n", ni, new_id, (double) max_q_gain); */
  459|       |
  460|       |            /* Add vertex to "new" community and update it */
  461|   985k|            VECTOR(*communities.membership)[ni] = new_id;
  ------------------
  |  |   60|   985k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  462|   985k|            if (communities.item[new_id].size == 0) {
  ------------------
  |  Branch (462:17): [True: 738k, False: 247k]
  ------------------
  463|   738k|                communities.communities_no++;
  464|   738k|            }
  465|   985k|            communities.item[new_id].size++;
  466|   985k|            communities.item[new_id].weight_all += weight_all;
  467|   985k|            communities.item[new_id].weight_inside += 2 * max_weight + weight_loop;
  468|       |
  469|   985k|            if (new_id != old_id) {
  ------------------
  |  Branch (469:17): [True: 50.1k, False: 935k]
  ------------------
  470|  50.1k|                changed = true;
  471|  50.1k|            }
  472|   985k|        }
  473|       |
  474|  20.7k|        q = igraph_i_multilevel_community_modularity(&communities, resolution);
  475|       |
  476|  20.7k|        if (changed && (q > pass_q)) {
  ------------------
  |  Branch (476:13): [True: 12.9k, False: 7.79k]
  |  Branch (476:24): [True: 12.9k, False: 21]
  ------------------
  477|       |            /* debug("Pass %d (changed: %d) Communities: %ld Modularity from %lf to %lf\n",
  478|       |              pass, changed, communities.communities_no, (double) pass_q, (double) q); */
  479|       |            /* pass++; */
  480|  12.9k|        } else {
  481|       |            /* No changes or the modularity became worse, restore last membership */
  482|  7.81k|            IGRAPH_CHECK(igraph_vector_int_update(communities.membership, &temp_membership));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  483|  7.81k|            communities.communities_no = temp_communities_no;
  484|  7.81k|            break;
  485|  7.81k|        }
  486|       |
  487|  12.9k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  12.9k|    do { \
  |  |   47|  12.9k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 12.9k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  12.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 12.9k]
  |  |  ------------------
  ------------------
  488|  12.9k|    } while (changed && (q > pass_q)); /* Pass end */
  ------------------
  |  Branch (488:14): [True: 12.9k, False: 0]
  |  Branch (488:25): [True: 12.9k, False: 0]
  ------------------
  489|       |
  490|  7.81k|    if (modularity) {
  ------------------
  |  Branch (490:9): [True: 7.81k, False: 0]
  ------------------
  491|  7.81k|        *modularity = q;
  492|  7.81k|    }
  493|       |
  494|       |    /* debug("Result Communities: %ld Modularity: %lf\n",
  495|       |      communities.communities_no, (double) q); */
  496|       |
  497|  7.81k|    IGRAPH_CHECK(igraph_reindex_membership(membership, NULL, NULL));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  498|       |
  499|       |    /* Shrink the nodes of the graph according to the present community structure
  500|       |     * and simplify the resulting graph */
  501|       |
  502|       |    /* TODO: check if we really need to copy temp_membership */
  503|  7.81k|    IGRAPH_CHECK(igraph_vector_int_update(&temp_membership, membership));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  504|  7.81k|    IGRAPH_CHECK(igraph_i_multilevel_shrink(graph, &temp_membership));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  505|  7.81k|    igraph_vector_int_destroy(&temp_membership);
  506|  7.81k|    IGRAPH_FINALLY_CLEAN(1);
  507|       |
  508|       |    /* Update edge weights after shrinking and simplification */
  509|       |    /* Here we reuse the edges vector as we don't need the previous contents anymore */
  510|       |    /* TODO: can we use igraph_simplify here? */
  511|  7.81k|    IGRAPH_CHECK(igraph_i_multilevel_simplify_multiple(graph, &edges));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  512|       |
  513|       |    /* We reuse the links_weight vector to store the old edge weights */
  514|  7.81k|    IGRAPH_CHECK(igraph_vector_update(&links_weight, weights));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  515|  7.81k|    igraph_vector_null(weights);
  516|       |
  517|  96.1k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (517:30): [True: 88.3k, False: 7.81k]
  ------------------
  518|  88.3k|        VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  519|  88.3k|    }
  520|       |
  521|  7.81k|    igraph_free(communities.item);
  522|  7.81k|    igraph_vector_int_destroy(&links_community);
  523|  7.81k|    igraph_vector_destroy(&links_weight);
  524|  7.81k|    igraph_vector_int_destroy(&edges);
  525|  7.81k|    igraph_vector_int_destroy(&node_order);
  526|  7.81k|    IGRAPH_FINALLY_CLEAN(5);
  527|       |
  528|  7.81k|    return IGRAPH_SUCCESS;
  529|  7.81k|}
louvain.c:igraph_i_multilevel_community_modularity:
   52|  28.6k|        const igraph_real_t resolution) {
   53|  28.6k|    igraph_real_t result = 0.0;
   54|  28.6k|    igraph_real_t m = communities->weight_sum;
   55|       |
   56|  1.31M|    for (igraph_int_t i = 0; i < communities->vertices_no; i++) {
  ------------------
  |  Branch (56:30): [True: 1.28M, False: 28.6k]
  ------------------
   57|  1.28M|        if (communities->item[i].size > 0) {
  ------------------
  |  Branch (57:13): [True: 1.10M, False: 182k]
  ------------------
   58|  1.10M|            result += (communities->item[i].weight_inside - resolution * communities->item[i].weight_all * communities->item[i].weight_all / m) / m;
   59|  1.10M|        }
   60|  1.28M|    }
   61|       |
   62|  28.6k|    return result;
   63|  28.6k|}
louvain.c:igraph_i_multilevel_community_links:
  178|   985k|        igraph_vector_int_t *links_community, igraph_vector_t *links_weight) {
  179|       |
  180|   985k|    igraph_int_t n, last = -1, c = -1;
  181|   985k|    igraph_real_t weight = 1;
  182|   985k|    igraph_int_t to, to_community;
  183|   985k|    igraph_int_t community = VECTOR(*(communities->membership))[vertex];
  ------------------
  |  |   60|   985k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  184|   985k|    igraph_i_multilevel_community_link *links;
  185|       |
  186|   985k|    *weight_all = *weight_inside = *weight_loop = 0;
  187|       |
  188|   985k|    igraph_vector_int_clear(links_community);
  189|   985k|    igraph_vector_clear(links_weight);
  190|       |
  191|       |    /* Get the list of incident edges */
  192|   985k|    IGRAPH_CHECK(igraph_incident(graph, edges, vertex, IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|   985k|    do { \
  |  |  657|   985k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   985k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   985k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 985k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   985k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 985k]
  |  |  ------------------
  ------------------
  193|       |
  194|   985k|    n = igraph_vector_int_size(edges);
  195|   985k|    links = IGRAPH_CALLOC(n, igraph_i_multilevel_community_link);
  ------------------
  |  |   33|   985k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  1.97M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 985k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 985k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 264k, False: 721k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   985k|    IGRAPH_CHECK_OOM(links, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|   985k|    do { \
  |  |  710|   985k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   985k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 985k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   985k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 985k]
  |  |  ------------------
  ------------------
  197|   985k|    IGRAPH_FINALLY(igraph_free, links);
  ------------------
  |  |  603|   985k|    do { \
  |  |  604|   985k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   985k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   985k|         * incorrect destructor function with the pointer */ \
  |  |  607|   985k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 985k]
  |  |  ------------------
  |  |  608|   985k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   985k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 985k]
  |  |  ------------------
  ------------------
  198|       |
  199|  1.61M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (199:30): [True: 630k, False: 985k]
  ------------------
  200|   630k|        igraph_int_t eidx = VECTOR(*edges)[i];
  ------------------
  |  |   60|   630k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  201|   630k|        weight = VECTOR(*communities->weights)[eidx];
  ------------------
  |  |   60|   630k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  202|       |
  203|   630k|        to = IGRAPH_OTHER(graph, eidx, vertex);
  ------------------
  |  |  146|   630k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   630k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   630k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   341k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   341k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   289k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   289k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 341k, False: 289k]
  |  |  ------------------
  ------------------
  204|       |
  205|   630k|        *weight_all += weight;
  206|   630k|        if (to == vertex) {
  ------------------
  |  Branch (206:13): [True: 52.5k, False: 578k]
  ------------------
  207|  52.5k|            *weight_loop += weight;
  208|       |
  209|  52.5k|            links[i].community = community;
  210|  52.5k|            links[i].weight = 0;
  211|  52.5k|            continue;
  212|  52.5k|        }
  213|       |
  214|   578k|        to_community = VECTOR(*(communities->membership))[to];
  ------------------
  |  |   60|   578k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  215|   578k|        if (community == to_community) {
  ------------------
  |  Branch (215:13): [True: 326k, False: 251k]
  ------------------
  216|   326k|            *weight_inside += weight;
  217|   326k|        }
  218|       |
  219|       |        /* debug("Link %ld (C: %ld) <-> %ld (C: %ld)\n", vertex, community, to, to_community); */
  220|       |
  221|   578k|        links[i].community = to_community;
  222|   578k|        links[i].weight = weight;
  223|   578k|    }
  224|       |
  225|       |    /* Sort links by community ID and merge the same */
  226|   985k|    igraph_qsort((void*)links, (size_t) n, sizeof(igraph_i_multilevel_community_link),
  227|   985k|                 igraph_i_multilevel_community_link_cmp);
  228|  1.61M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (228:30): [True: 630k, False: 985k]
  ------------------
  229|   630k|        to_community = links[i].community;
  230|   630k|        if (to_community != last) {
  ------------------
  |  Branch (230:13): [True: 451k, False: 178k]
  ------------------
  231|   451k|            IGRAPH_CHECK(igraph_vector_int_push_back(links_community, to_community));
  ------------------
  |  |  656|   451k|    do { \
  |  |  657|   451k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   451k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   451k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 451k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   451k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 451k]
  |  |  ------------------
  ------------------
  232|   451k|            IGRAPH_CHECK(igraph_vector_push_back(links_weight, links[i].weight));
  ------------------
  |  |  656|   451k|    do { \
  |  |  657|   451k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   451k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   451k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 451k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   451k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 451k]
  |  |  ------------------
  ------------------
  233|   451k|            last = to_community;
  234|   451k|            c++;
  235|   451k|        } else {
  236|   178k|            VECTOR(*links_weight)[c] += links[i].weight;
  ------------------
  |  |   60|   178k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  237|   178k|        }
  238|   630k|    }
  239|       |
  240|   985k|    igraph_free(links);
  241|   985k|    IGRAPH_FINALLY_CLEAN(1);
  242|       |
  243|   985k|    return IGRAPH_SUCCESS;
  244|   985k|}
louvain.c:igraph_i_multilevel_community_link_cmp:
  152|   604k|static int igraph_i_multilevel_community_link_cmp(const void *a, const void *b) {
  153|   604k|    igraph_int_t diff = (
  154|   604k|        ((igraph_i_multilevel_community_link*)a)->community -
  155|   604k|        ((igraph_i_multilevel_community_link*)b)->community
  156|   604k|    );
  157|   604k|    return diff < 0 ? -1 : diff > 0 ? 1 : 0;
  ------------------
  |  Branch (157:12): [True: 208k, False: 396k]
  |  Branch (157:28): [True: 208k, False: 187k]
  ------------------
  158|   604k|}
louvain.c:igraph_i_multilevel_community_modularity_gain:
  250|   451k|        const igraph_real_t resolution) {
  251|   451k|    IGRAPH_UNUSED(vertex);
  ------------------
  |  |   30|   451k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
  252|   451k|    return weight_inside -
  253|   451k|           resolution * communities->item[community].weight_all * weight_all / communities->weight_sum;
  254|   451k|}
louvain.c:igraph_i_multilevel_shrink:
  262|  7.81k|static igraph_error_t igraph_i_multilevel_shrink(igraph_t *graph, igraph_vector_int_t *membership) {
  263|  7.81k|    igraph_vector_int_t edges;
  264|  7.81k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  265|  7.81k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  266|  7.81k|    igraph_bool_t directed = igraph_is_directed(graph);
  267|       |
  268|  7.81k|    IGRAPH_ASSERT(igraph_vector_int_size(membership) == no_of_nodes);
  ------------------
  |  |  924|  7.81k|    do { \
  |  |  925|  7.81k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  269|       |
  270|  7.81k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (270:9): [True: 1, False: 7.81k]
  ------------------
  271|      1|        return IGRAPH_SUCCESS;
  272|      1|    }
  273|       |
  274|  7.81k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 2*no_of_edges);
  ------------------
  |  |  119|  7.81k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.81k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  275|       |
  276|  7.81k|    IGRAPH_CHECK(igraph_reindex_membership(membership, NULL, NULL));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  277|       |
  278|       |    /* Create the new edgelist */
  279|  7.81k|    IGRAPH_CHECK(igraph_get_edgelist(graph, &edges, /* bycol= */ false));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  280|   184k|    for (igraph_int_t i=0; i < 2*no_of_edges; i++) {
  ------------------
  |  Branch (280:28): [True: 176k, False: 7.81k]
  ------------------
  281|   176k|        VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   176k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   176k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   176k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  282|   176k|    }
  283|       |
  284|       |    /* Create the new graph */
  285|  7.81k|    igraph_destroy(graph);
  286|  7.81k|    no_of_nodes = igraph_vector_int_max(membership) + 1;
  287|  7.81k|    IGRAPH_CHECK(igraph_create(graph, &edges, no_of_nodes, directed));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  288|       |
  289|  7.81k|    igraph_vector_int_destroy(&edges);
  290|  7.81k|    IGRAPH_FINALLY_CLEAN(1);
  291|       |
  292|  7.81k|    return IGRAPH_SUCCESS;
  293|  7.81k|}
louvain.c:igraph_i_multilevel_simplify_multiple:
   94|  7.81k|static igraph_error_t igraph_i_multilevel_simplify_multiple(igraph_t *graph, igraph_vector_int_t *eids) {
   95|  7.81k|    igraph_int_t ecount = igraph_ecount(graph);
   96|  7.81k|    igraph_int_t l = -1, last_from = -1, last_to = -1;
   97|  7.81k|    igraph_bool_t directed = igraph_is_directed(graph);
   98|  7.81k|    igraph_vector_int_t edges;
   99|  7.81k|    igraph_i_multilevel_link *links;
  100|       |
  101|       |    /* Make sure there's enough space in eids to store the new edge IDs */
  102|  7.81k|    IGRAPH_CHECK(igraph_vector_int_resize(eids, ecount));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  103|       |
  104|  7.81k|    links = IGRAPH_CALLOC(ecount, igraph_i_multilevel_link);
  ------------------
  |  |   33|  7.81k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  15.6k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.81k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.81k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.71k, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  7.81k|    IGRAPH_CHECK_OOM(links, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|  7.81k|    do { \
  |  |  710|  7.81k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  106|  7.81k|    IGRAPH_FINALLY(igraph_free, links);
  ------------------
  |  |  603|  7.81k|    do { \
  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  ------------------
  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  107|       |
  108|  96.1k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (108:30): [True: 88.3k, False: 7.81k]
  ------------------
  109|  88.3k|        links[i].from = IGRAPH_FROM(graph, i);
  ------------------
  |  |  115|  88.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  110|  88.3k|        links[i].to = IGRAPH_TO(graph, i);
  ------------------
  |  |  128|  88.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  111|  88.3k|        links[i].id = i;
  112|  88.3k|    }
  113|       |
  114|  7.81k|    igraph_qsort(links, (size_t) ecount, sizeof(igraph_i_multilevel_link),
  115|  7.81k|                 igraph_i_multilevel_link_cmp);
  116|       |
  117|  7.81k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  7.81k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.81k|    do { \
  |  |  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.81k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.81k|    do { \
  |  |  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.81k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  118|  96.1k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (118:30): [True: 88.3k, False: 7.81k]
  ------------------
  119|  88.3k|        if (links[i].from == last_from && links[i].to == last_to) {
  ------------------
  |  Branch (119:13): [True: 60.3k, False: 28.0k]
  |  Branch (119:43): [True: 40.3k, False: 19.9k]
  ------------------
  120|  40.3k|            VECTOR(*eids)[links[i].id] = l;
  ------------------
  |  |   60|  40.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  121|  40.3k|            continue;
  122|  40.3k|        }
  123|       |
  124|  47.9k|        last_from = links[i].from;
  125|  47.9k|        last_to = links[i].to;
  126|       |
  127|  47.9k|        IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last_from));
  ------------------
  |  |  656|  47.9k|    do { \
  |  |  657|  47.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  47.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  47.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  47.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 47.9k]
  |  |  ------------------
  ------------------
  128|  47.9k|        IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last_to));
  ------------------
  |  |  656|  47.9k|    do { \
  |  |  657|  47.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  47.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  47.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  47.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 47.9k]
  |  |  ------------------
  ------------------
  129|       |
  130|  47.9k|        l++;
  131|       |
  132|  47.9k|        VECTOR(*eids)[links[i].id] = l;
  ------------------
  |  |   60|  47.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  133|  47.9k|    }
  134|       |
  135|  7.81k|    IGRAPH_FREE(links);
  ------------------
  |  |   36|  7.81k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  136|  7.81k|    IGRAPH_FINALLY_CLEAN(1);
  137|       |
  138|  7.81k|    igraph_destroy(graph);
  139|  7.81k|    IGRAPH_CHECK(igraph_create(graph, &edges, igraph_vcount(graph), directed));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  140|       |
  141|  7.81k|    igraph_vector_int_destroy(&edges);
  142|  7.81k|    IGRAPH_FINALLY_CLEAN(1);
  143|       |
  144|  7.81k|    return IGRAPH_SUCCESS;
  145|  7.81k|}
louvain.c:igraph_i_multilevel_link_cmp:
   71|   269k|static int igraph_i_multilevel_link_cmp(const void *a, const void *b) {
   72|   269k|    igraph_int_t diff;
   73|       |
   74|   269k|    diff = ((igraph_i_multilevel_link*)a)->from - ((igraph_i_multilevel_link*)b)->from;
   75|       |
   76|   269k|    if (diff < 0) {
  ------------------
  |  Branch (76:9): [True: 78.1k, False: 191k]
  ------------------
   77|  78.1k|        return -1;
   78|   191k|    } else if (diff > 0) {
  ------------------
  |  Branch (78:16): [True: 93.3k, False: 98.0k]
  ------------------
   79|  93.3k|        return 1;
   80|  93.3k|    }
   81|       |
   82|  98.0k|    diff = ((igraph_i_multilevel_link*)a)->to - ((igraph_i_multilevel_link*)b)->to;
   83|       |
   84|  98.0k|    if (diff < 0) {
  ------------------
  |  Branch (84:9): [True: 25.5k, False: 72.5k]
  ------------------
   85|  25.5k|        return -1;
   86|  72.5k|    } else if (diff > 0) {
  ------------------
  |  Branch (86:16): [True: 26.9k, False: 45.6k]
  ------------------
   87|  26.9k|        return 1;
   88|  45.6k|    } else {
   89|  45.6k|        return 0;
   90|  45.6k|    }
   91|  98.0k|}

igraph_modularity:
  121|  52.5k|                      igraph_real_t *modularity) {
  122|       |
  123|  52.5k|    const igraph_int_t vcount = igraph_vcount(graph);
  124|  52.5k|    const igraph_int_t ecount = igraph_ecount(graph);
  125|  52.5k|    const igraph_vector_int_t *p_membership;
  126|  52.5k|    igraph_vector_int_t i_membership;
  127|  52.5k|    igraph_bool_t using_i_membership = false;
  128|  52.5k|    igraph_vector_t k_out, k_in;
  129|  52.5k|    igraph_int_t min_cluster_id, max_cluster_id, no_of_partitions;
  130|  52.5k|    igraph_real_t e; /* count/fraction of edges/weights within partitions */
  131|  52.5k|    igraph_real_t m; /* edge count / weight sum */
  132|  52.5k|    igraph_int_t c1, c2;
  133|       |    /* Only consider the graph as directed if it actually is directed */
  134|  52.5k|    igraph_bool_t use_directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (134:34): [True: 48.9k, False: 3.66k]
  |  Branch (134:46): [True: 48.9k, False: 0]
  ------------------
  135|  52.5k|    igraph_real_t directed_multiplier = (use_directed ? 1 : 2);
  ------------------
  |  Branch (135:42): [True: 48.9k, False: 3.66k]
  ------------------
  136|       |
  137|  52.5k|    if (igraph_vector_int_size(membership) != vcount) {
  ------------------
  |  Branch (137:9): [True: 0, False: 52.5k]
  ------------------
  138|      0|        IGRAPH_ERROR("Membership vector size differs from number of vertices.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  139|      0|                     IGRAPH_EINVAL);
  140|      0|    }
  141|  52.5k|    if (resolution < 0.0) {
  ------------------
  |  Branch (141:9): [True: 0, False: 52.5k]
  ------------------
  142|      0|      IGRAPH_ERROR("The resolution parameter must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  143|      0|    }
  144|       |
  145|  52.5k|    if (ecount == 0) {
  ------------------
  |  Branch (145:9): [True: 226, False: 52.3k]
  ------------------
  146|       |        /* Special case: the modularity of graphs with no edges is not
  147|       |         * well-defined */
  148|    226|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|    226|#define IGRAPH_NAN ((double)NAN)
  ------------------
  149|    226|        return IGRAPH_SUCCESS;
  150|    226|    }
  151|       |
  152|       |    /* At this point, the 'membership' vector does not have length zero,
  153|       |       thus it is safe to call igraph_vector_int_minmax(). */
  154|       |
  155|       |    /* If community indices are outside of the standard range, automatically
  156|       |     * reindex them. */
  157|  52.3k|    igraph_vector_int_minmax(membership, &min_cluster_id, &max_cluster_id);
  158|  52.3k|    if (min_cluster_id < 0 || max_cluster_id >= vcount) {
  ------------------
  |  Branch (158:9): [True: 0, False: 52.3k]
  |  Branch (158:31): [True: 41.9k, False: 10.4k]
  ------------------
  159|  41.9k|        IGRAPH_CHECK(igraph_vector_int_init_copy(&i_membership, membership));
  ------------------
  |  |  656|  41.9k|    do { \
  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  160|  41.9k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &i_membership);
  ------------------
  |  |  603|  41.9k|    do { \
  |  |  604|  41.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  41.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  41.9k|         * incorrect destructor function with the pointer */ \
  |  |  607|  41.9k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 41.9k]
  |  |  ------------------
  |  |  608|  41.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  161|  41.9k|        IGRAPH_CHECK(igraph_i_reindex_membership_large(&i_membership, NULL, &no_of_partitions));
  ------------------
  |  |  656|  41.9k|    do { \
  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
  162|  41.9k|        p_membership = &i_membership;
  163|  41.9k|        using_i_membership = true;
  164|  41.9k|    } else {
  165|  10.4k|        no_of_partitions = max_cluster_id + 1;
  166|  10.4k|        p_membership = membership;
  167|  10.4k|    }
  168|       |
  169|  52.3k|    IGRAPH_VECTOR_INIT_FINALLY(&k_out, no_of_partitions);
  ------------------
  |  |  104|  52.3k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  52.3k|    do { \
  |  |  |  |  657|  52.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  52.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  52.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 52.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  52.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  52.3k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  52.3k|    do { \
  |  |  |  |  604|  52.3k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  52.3k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  52.3k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  52.3k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  |  |  608|  52.3k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  52.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 52.3k]
  |  |  ------------------
  ------------------
  170|  52.3k|    IGRAPH_VECTOR_INIT_FINALLY(&k_in, no_of_partitions);
  ------------------
  |  |  104|  52.3k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  52.3k|    do { \
  |  |  |  |  657|  52.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  52.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  52.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 52.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  52.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  52.3k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  52.3k|    do { \
  |  |  |  |  604|  52.3k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  52.3k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  52.3k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  52.3k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  |  |  608|  52.3k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  52.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 52.3k]
  |  |  ------------------
  ------------------
  171|       |
  172|  52.3k|    e = 0.0;
  173|  52.3k|    if (weights) {
  ------------------
  |  Branch (173:9): [True: 52.3k, False: 0]
  ------------------
  174|  52.3k|        if (igraph_vector_size(weights) != ecount)
  ------------------
  |  Branch (174:13): [True: 0, False: 52.3k]
  ------------------
  175|      0|            IGRAPH_ERROR("Weight vector size differs from number of edges.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  176|  52.3k|                         IGRAPH_EINVAL);
  177|  52.3k|        m = 0.0;
  178|  2.60M|        for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (178:34): [True: 2.54M, False: 52.3k]
  ------------------
  179|  2.54M|            igraph_real_t w = VECTOR(*weights)[i];
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|  2.54M|            if (w < 0) {
  ------------------
  |  Branch (180:17): [True: 0, False: 2.54M]
  ------------------
  181|      0|                IGRAPH_ERROR("Negative weight in weight vector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  182|      0|            }
  183|  2.54M|            c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |  115|  2.54M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  184|  2.54M|            c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |  128|  2.54M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  185|  2.54M|            if (c1 == c2) {
  ------------------
  |  Branch (185:17): [True: 1.31M, False: 1.23M]
  ------------------
  186|  1.31M|                e += directed_multiplier * w;
  187|  1.31M|            }
  188|  2.54M|            VECTOR(k_out)[c1] += w;
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|  2.54M|            VECTOR(k_in)[c2]  += w;
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  190|  2.54M|            m += w;
  191|  2.54M|        }
  192|  52.3k|    } else {
  193|      0|        m = ecount;
  194|      0|        for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (194:34): [True: 0, False: 0]
  ------------------
  195|      0|            c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  196|      0|            c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  197|      0|            if (c1 == c2) {
  ------------------
  |  Branch (197:17): [True: 0, False: 0]
  ------------------
  198|      0|                e += directed_multiplier;
  199|      0|            }
  200|      0|            VECTOR(k_out)[c1] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  201|      0|            VECTOR(k_in)[c2]  += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  202|      0|        }
  203|      0|    }
  204|       |
  205|  52.3k|    if (!use_directed) {
  ------------------
  |  Branch (205:9): [True: 3.48k, False: 48.8k]
  ------------------
  206|       |        /* Graph is undirected, simply add vectors.
  207|       |         * Vectors are the same size, calls below can't fail. */
  208|  3.48k|        igraph_vector_add(&k_out, &k_in);
  209|  3.48k|        igraph_vector_update(&k_in, &k_out);
  210|  3.48k|    }
  211|       |
  212|       |    /* Divide all vectors by total weight. */
  213|  52.3k|    igraph_vector_scale(&k_out, 1.0/( directed_multiplier * m ) );
  214|  52.3k|    igraph_vector_scale(&k_in, 1.0/( directed_multiplier * m ) );
  215|  52.3k|    e /= directed_multiplier * m;
  216|       |
  217|  52.3k|    if (m > 0) {
  ------------------
  |  Branch (217:9): [True: 52.3k, False: 0]
  ------------------
  218|  52.3k|        *modularity = e;
  219|  2.22M|        for (igraph_int_t i = 0; i < no_of_partitions; i++) {
  ------------------
  |  Branch (219:34): [True: 2.17M, False: 52.3k]
  ------------------
  220|  2.17M|            *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  221|  2.17M|        }
  222|  52.3k|    } else {
  223|      0|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|      0|#define IGRAPH_NAN ((double)NAN)
  ------------------
  224|      0|    }
  225|       |
  226|  52.3k|    igraph_vector_destroy(&k_out);
  227|  52.3k|    igraph_vector_destroy(&k_in);
  228|  52.3k|    IGRAPH_FINALLY_CLEAN(2);
  229|       |
  230|  52.3k|    if (using_i_membership) {
  ------------------
  |  Branch (230:9): [True: 41.9k, False: 10.4k]
  ------------------
  231|  41.9k|        igraph_vector_int_destroy(&i_membership);
  232|  41.9k|        IGRAPH_FINALLY_CLEAN(1);
  233|  41.9k|    }
  234|       |
  235|  52.3k|    return IGRAPH_SUCCESS;
  236|  52.3k|}
igraph_modularity_matrix:
  329|  3.54k|                             igraph_bool_t directed) {
  330|       |
  331|  3.54k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  332|  3.54k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  333|  3.54k|    const igraph_real_t sw = weights ? igraph_vector_sum(weights) : no_of_edges;
  ------------------
  |  Branch (333:30): [True: 3.54k, False: 0]
  ------------------
  334|  3.54k|    igraph_vector_t deg, in_deg, out_deg;
  335|  3.54k|    igraph_real_t scaling_factor;
  336|       |
  337|  3.54k|    if (weights && igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (337:9): [True: 3.54k, False: 0]
  |  Branch (337:20): [True: 0, False: 3.54k]
  ------------------
  338|      0|        IGRAPH_ERROR("Invalid weight vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  339|      0|    }
  340|       |
  341|  3.54k|    if (resolution < 0.0) {
  ------------------
  |  Branch (341:9): [True: 0, False: 3.54k]
  ------------------
  342|      0|        IGRAPH_ERROR("The resolution parameter must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  343|      0|    }
  344|       |
  345|  3.54k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (345:9): [True: 0, False: 3.54k]
  ------------------
  346|      0|        directed = false;
  347|      0|    }
  348|  3.54k|    IGRAPH_CHECK(igraph_i_modularity_matrix_get_adjacency(graph, modmat, weights, directed));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  349|       |
  350|       |    /* Performance notes:
  351|       |     *  - Iterating in column-major order makes a large difference.
  352|       |     *  - Applying the scaling_factor to in_deg (or out_deg) first to reduce the
  353|       |     *    number of multiplications does not make an appreciable performance
  354|       |     *    difference. However, doing this in the undirected case causes the result
  355|       |     *    matrix to sometimes not be strictly symmetric due to the non-associativity
  356|       |     *    of floating point multiplication.
  357|       |     */
  358|       |
  359|  3.54k|    if (directed) {
  ------------------
  |  Branch (359:9): [True: 3.54k, False: 0]
  ------------------
  360|  3.54k|        IGRAPH_VECTOR_INIT_FINALLY(&in_deg, no_of_nodes);
  ------------------
  |  |  104|  3.54k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  361|  3.54k|        IGRAPH_VECTOR_INIT_FINALLY(&out_deg, no_of_nodes);
  ------------------
  |  |  104|  3.54k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.54k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  362|       |
  363|  3.54k|        IGRAPH_CHECK(igraph_strength(graph, &in_deg, igraph_vss_all(), IGRAPH_IN,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  364|  3.54k|                                     IGRAPH_LOOPS, weights));
  365|  3.54k|        IGRAPH_CHECK(igraph_strength(graph, &out_deg, igraph_vss_all(), IGRAPH_OUT,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  366|  3.54k|                                     IGRAPH_LOOPS, weights));
  367|       |
  368|  3.54k|        scaling_factor = resolution / sw;
  369|       |
  370|   158k|        for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (370:34): [True: 154k, False: 3.54k]
  ------------------
  371|  8.74M|            for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (371:38): [True: 8.59M, False: 154k]
  ------------------
  372|  8.59M|                MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   83|  8.59M|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   60|  8.59M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   60|  8.59M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  373|  8.59M|            }
  374|   154k|        }
  375|  3.54k|        igraph_vector_destroy(&in_deg);
  376|  3.54k|        igraph_vector_destroy(&out_deg);
  377|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  378|  3.54k|    } else {
  379|      0|        IGRAPH_VECTOR_INIT_FINALLY(&deg, no_of_nodes);
  ------------------
  |  |  104|      0|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 0]
  |  |  ------------------
  ------------------
  380|       |
  381|      0|        IGRAPH_CHECK(igraph_strength(graph, &deg, igraph_vss_all(), IGRAPH_ALL,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  382|      0|                                     IGRAPH_LOOPS, weights));
  383|       |
  384|      0|        scaling_factor = resolution / 2.0 / sw;
  385|       |
  386|      0|        for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (386:34): [True: 0, False: 0]
  ------------------
  387|      0|            for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (387:38): [True: 0, False: 0]
  ------------------
  388|      0|                MATRIX(*modmat, i, j) -= VECTOR(deg)[i] * VECTOR(deg)[j] * scaling_factor;
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(deg)[i] * VECTOR(deg)[j] * scaling_factor;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(deg)[i] * VECTOR(deg)[j] * scaling_factor;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  389|      0|            }
  390|      0|        }
  391|      0|        igraph_vector_destroy(&deg);
  392|      0|        IGRAPH_FINALLY_CLEAN(1);
  393|      0|    }
  394|       |
  395|  3.54k|    return IGRAPH_SUCCESS;
  396|  3.54k|}
modularity.c:igraph_i_modularity_matrix_get_adjacency:
  240|  3.54k|           const igraph_vector_t *weights, igraph_bool_t directed) {
  241|       |
  242|       |    /* Specifically used to handle weights and/or ignore direction */
  243|  3.54k|    igraph_eit_t edgeit;
  244|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  245|  3.54k|    igraph_int_t from, to;
  246|       |
  247|  3.54k|    IGRAPH_CHECK(igraph_matrix_resize(res, no_of_nodes, no_of_nodes));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  248|  3.54k|    igraph_matrix_null(res);
  249|  3.54k|    IGRAPH_CHECK(igraph_eit_create(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  250|  3.54k|    IGRAPH_FINALLY(igraph_eit_destroy, &edgeit);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  251|       |
  252|  3.54k|    if (weights) {
  ------------------
  |  Branch (252:9): [True: 3.54k, False: 0]
  ------------------
  253|  99.5k|        for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|  99.5k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                      for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  359|  96.0k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (253:16): [True: 96.0k, False: 3.54k]
  ------------------
  254|  96.0k|            igraph_int_t edge = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|  96.0k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 96.0k, False: 0]
  |  |  ------------------
  |  |  406|  96.0k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  255|  96.0k|            from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  256|  96.0k|            to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  257|  96.0k|            MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   83|  96.0k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                          MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  258|  96.0k|            if (!directed) {
  ------------------
  |  Branch (258:17): [True: 0, False: 96.0k]
  ------------------
  259|      0|                MATRIX(*res, to, from) += VECTOR(*weights)[edge];
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                              MATRIX(*res, to, from) += VECTOR(*weights)[edge];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  260|      0|            }
  261|  96.0k|        }
  262|  3.54k|    } else {
  263|      0|        for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                      for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (263:16): [True: 0, False: 0]
  ------------------
  264|      0|            igraph_int_t edge = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  265|      0|            from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  266|      0|            to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  267|      0|            MATRIX(*res, from, to) += 1;
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  268|      0|            if (!directed) {
  ------------------
  |  Branch (268:17): [True: 0, False: 0]
  ------------------
  269|      0|                MATRIX(*res, to, from) += 1;
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  270|      0|            }
  271|      0|        }
  272|      0|    }
  273|       |
  274|  3.54k|    igraph_eit_destroy(&edgeit);
  275|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  276|  3.54k|    return IGRAPH_SUCCESS;
  277|  3.54k|}

_ZN5NNode10Connect_ToEPS_d:
   45|  7.28k|int NNode::Connect_To(NNode* neighbour, double weight_) {
   46|  7.28k|    NLink *link;
   47|       |    //sollen doppelte Links erlaubt sein??  NEIN
   48|  7.28k|    if (!neighbour) {
  ------------------
  |  Branch (48:9): [True: 0, False: 7.28k]
  ------------------
   49|      0|        return 0;
   50|      0|    }
   51|  7.28k|    if (!(neighbours.Is_In_List(neighbour)) && (neighbour != this)) {
  ------------------
  |  Branch (51:9): [True: 7.28k, False: 0]
  |  Branch (51:48): [True: 7.28k, False: 0]
  ------------------
   52|  7.28k|        neighbours.Push(neighbour);        // nachbar hier eintragen
   53|  7.28k|        neighbour->neighbours.Push(this); // diesen knoten beim nachbarn eintragen
   54|       |
   55|  7.28k|        link = new NLink(this, neighbour, weight_);     //link erzeugen
   56|  7.28k|        global_link_list->Push(link);                        // in globaler liste eintragen
   57|  7.28k|        n_links.Push(link);                                   // bei diesem Knoten eintragen
   58|  7.28k|        neighbour->n_links.Push(link);                  // beim nachbarn eintragen
   59|       |
   60|  7.28k|        return 1;
   61|  7.28k|    }
   62|      0|    return 0;
   63|  7.28k|}
_ZN5NNode19Get_LinkToNeighbourEPKS_:
   65|  14.5k|NLink *NNode::Get_LinkToNeighbour(const NNode* neighbour) {
   66|  14.5k|    DLList_Iter<NLink*> iter;
   67|  14.5k|    NLink *l_cur, *link = nullptr;
   68|  14.5k|    bool found = false;
   69|       |    // finde einen bestimmten Link aus der Liste der links eines Knotens
   70|  14.5k|    l_cur = iter.First(&n_links);
   71|  83.4k|    while (!iter.End() && !found) {
  ------------------
  |  Branch (71:12): [True: 68.8k, False: 14.5k]
  |  Branch (71:27): [True: 68.8k, False: 0]
  ------------------
   72|  68.8k|        if (((l_cur->Get_Start() == this) && (l_cur->Get_End() == neighbour)) || ((l_cur->Get_End() == this) && (l_cur->Get_Start() == neighbour))) {
  ------------------
  |  Branch (72:14): [True: 23.0k, False: 45.8k]
  |  Branch (72:46): [True: 7.28k, False: 15.7k]
  |  Branch (72:83): [True: 45.8k, False: 15.7k]
  |  Branch (72:113): [True: 7.28k, False: 38.5k]
  ------------------
   73|  14.5k|            found = true;
   74|  14.5k|            link = l_cur;
   75|  14.5k|        }
   76|  68.8k|        l_cur = iter.Next();
   77|  68.8k|    }
   78|  14.5k|    if (found) {
  ------------------
  |  Branch (78:9): [True: 14.5k, False: 0]
  ------------------
   79|  14.5k|        return link;
   80|  14.5k|    } else {
   81|      0|        return nullptr;
   82|      0|    }
   83|  14.5k|}
_ZN5NNode15Disconnect_FromEPS_:
   85|  7.28k|igraph_int_t NNode::Disconnect_From(NNode* neighbour) {
   86|       |    //sollen doppelte Links erlaubt sein??  s.o.
   87|  7.28k|    neighbours.fDelete(neighbour);
   88|  7.28k|    n_links.fDelete(Get_LinkToNeighbour(neighbour));
   89|  7.28k|    neighbour->n_links.fDelete(neighbour->Get_LinkToNeighbour(this));
   90|  7.28k|    neighbour->neighbours.fDelete(this);
   91|  7.28k|    return 1;
   92|  7.28k|}
_ZN5NNode19Disconnect_From_AllEv:
   94|  5.14k|igraph_int_t NNode::Disconnect_From_All() {
   95|  5.14k|    igraph_int_t number_of_neighbours = 0;
   96|  5.14k|    while (neighbours.Size()) {
  ------------------
  |  Branch (96:12): [True: 0, False: 5.14k]
  ------------------
   97|      0|        Disconnect_From(neighbours.Pop());
   98|      0|        number_of_neighbours++;
   99|      0|    }
  100|  5.14k|    return number_of_neighbours ;
  101|  5.14k|}

_ZNK6DLListIP5NNodeE4SizeEv:
  120|   216k|    igraph_int_t Size() const {
  121|   216k|        return number_of_items;
  122|   216k|    }
_ZN7networkC2Ev:
  259|    515|    network() = default;
_ZN15DL_Indexed_ListIP5NNodeEC2Ev:
  139|    515|    DL_Indexed_List() = default;
_ZN6DLListIP5NNodeEC2Ev:
  355|  5.65k|DLList<L_DATA>::DLList() {
  356|  5.65k|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|  5.65k|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|  5.65k|    head->next = tail;
  360|  5.65k|    tail->previous = head;
  361|  5.65k|}
_ZN6DLItemIP5NNodeEC2ES1_l:
  347|  11.3k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLListIP5NNodeE7pInsertES1_P6DLItemIS1_E:
  388|  14.5k|DLItem<L_DATA> *DLList<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  389|  14.5k|    auto *i = new DLItem<L_DATA>(data, number_of_items + 1, pos->previous, pos);
  390|  14.5k|    pos->previous->next = i;
  391|  14.5k|    pos->previous = i;
  392|  14.5k|    number_of_items++;
  393|  14.5k|    return i;
  394|  14.5k|}
_ZN6DLItemIP5NNodeEC2ES1_lPS2_S3_:
  351|  19.7k|    item(i), index(ind), previous(p), next(n) { }
_ZN6DLListIP5NNodeE7pDeleteEP6DLItemIS1_E:
  397|  14.5k|L_DATA DLList<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  398|  14.5k|    assert(number_of_items > 0);
  ------------------
  |  Branch (398:5): [True: 14.5k, False: 0]
  ------------------
  399|  14.5k|    L_DATA data = i->item;
  400|  14.5k|    i->previous->next = i->next;
  401|  14.5k|    i->next->previous = i->previous;
  402|  14.5k|    delete i;
  403|  14.5k|    number_of_items--;
  404|  14.5k|    return data;
  405|  14.5k|}
_ZN6DLListIP5NNodeE4PushES1_:
  425|  14.5k|L_DATA DLList<L_DATA>::Push(L_DATA data) {
  426|  14.5k|    DLItem<L_DATA> *tmp = pInsert(data, tail);
  427|  14.5k|    return tmp->item;
  428|  14.5k|}
_ZN9HugeArrayIP6DLItemIP5NNodeEEC2Ev:
  283|    515|HugeArray<DATA>::HugeArray() {
  284|    515|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    515|    data[0] = 0;
  286|    515|    data[1] = 0;
  287|  16.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 16.4k, False: 515]
  ------------------
  288|  16.4k|        field = nullptr;
  289|  16.4k|    }
  290|    515|    fields[highest_field_index] = data;
  291|    515|}
_ZN6DLListIP5NNodeED2Ev:
  364|  5.65k|DLList<L_DATA>::~DLList() {
  365|  5.65k|    DLItem<L_DATA> *cur = head, *next;
  366|  16.9k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 11.3k, False: 5.65k]
  ------------------
  367|  11.3k|        next = cur->next;
  368|  11.3k|        delete cur;
  369|  11.3k|        cur = next;
  370|  11.3k|    }
  371|  5.65k|    number_of_items = 0;
  372|  5.65k|}
_ZN15DL_Indexed_ListIP5NNodeE7pInsertES1_P6DLItemIS1_E:
  468|  5.14k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  5.14k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  5.14k|    pos->previous->next = i;
  471|  5.14k|    pos->previous = i;
  472|  5.14k|    this->number_of_items++;
  473|  5.14k|    array[last_index] = i;
  474|  5.14k|    last_index++;
  475|  5.14k|    return i;
  476|  5.14k|}
_ZN9HugeArrayIP6DLItemIP5NNodeEEixEl:
   78|   114M|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIP5NNodeEE3SetEl:
  323|   114M|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|   114M|    igraph_int_t data_size;
  325|   114M|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 869, False: 114M]
  ------------------
  326|    869|        highest_field_index++;
  327|    869|        data_size = igraph_int_t(1) << highest_field_index;
  328|    869|        data = new DATA[data_size];
  329|  5.95k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 5.08k, False: 869]
  ------------------
  330|  5.08k|            data[i] = 0;
  331|  5.08k|        }
  332|    869|        size = size + data_size; //overflow noch abfangen
  333|    869|        fields[highest_field_index] = data;
  334|    869|    }
  335|   114M|    HUGE_INDEX h_index = get_huge_index(index);
  336|   114M|    data = fields[h_index.field_index];
  337|   114M|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 4.62k, False: 114M]
  ------------------
  338|  4.62k|        max_index = index;
  339|  4.62k|    }
  340|   114M|    return data[h_index.in_field_index];
  341|   114M|}
_ZNK9HugeArrayIP6DLItemIP5NNodeEE14get_huge_indexEl:
  301|   114M|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|   114M|    HUGE_INDEX h_index;
  303|   114M|    unsigned int shift_index = 0;
  304|   114M|    igraph_int_t help_index;
  305|   114M|    help_index = index;
  306|   114M|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 19.5M, False: 95.0M]
  ------------------
  307|  19.5M|        h_index.field_index = 0;
  308|  19.5M|        h_index.in_field_index = index;
  309|  19.5M|        return h_index;
  310|  19.5M|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|  2.71G|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 2.61G, False: 95.0M]
  ------------------
  313|  2.61G|        help_index <<= 1;
  314|  2.61G|        shift_index++;
  315|  2.61G|    }
  316|  95.0M|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  95.0M|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  95.0M|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  95.0M|    return h_index;
  320|   114M|}
_ZN15DL_Indexed_ListIP5NNodeE7pDeleteEP6DLItemIS1_E:
  479|  5.14k|L_DATA DL_Indexed_List<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  480|  5.14k|    assert(this->number_of_items > 0);
  ------------------
  |  Branch (480:5): [True: 5.14k, False: 0]
  ------------------
  481|  5.14k|    L_DATA data = i->item;
  482|  5.14k|    i->previous->next = i->next;
  483|  5.14k|    i->next->previous = i->previous;
  484|  5.14k|    array[i->index] = 0;
  485|  5.14k|    last_index = i->index;
  486|  5.14k|    delete i;
  487|  5.14k|    this->number_of_items--;
  488|  5.14k|    return data;
  489|  5.14k|}
_ZN15DL_Indexed_ListIP5NNodeE4PushES1_:
  491|  5.14k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  5.14k|    DLItem<L_DATA> *tmp;
  493|  5.14k|    tmp = pInsert(data, this->tail);
  494|  5.14k|    return tmp->item;
  495|  5.14k|}
_ZN15DL_Indexed_ListIP5NNodeE3PopEv:
  498|  5.14k|L_DATA DL_Indexed_List<L_DATA>::Pop() {
  499|  5.14k|    return pDelete(this->tail->previous);
  500|  5.14k|}
_ZN15DL_Indexed_ListIP5NNodeE3GetEl:
  503|   114M|L_DATA DL_Indexed_List<L_DATA>::Get(igraph_int_t pos) {
  504|   114M|    if (pos > this->number_of_items - 1) {
  ------------------
  |  Branch (504:9): [True: 0, False: 114M]
  ------------------
  505|      0|        return 0;
  506|      0|    }
  507|   114M|    return array[pos]->item;
  508|   114M|}
_ZN15DL_Indexed_ListIP5NLinkEC2Ev:
  139|    515|    DL_Indexed_List() = default;
_ZN6DLListIP5NLinkEC2Ev:
  355|  5.65k|DLList<L_DATA>::DLList() {
  356|  5.65k|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|  5.65k|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|  5.65k|    head->next = tail;
  360|  5.65k|    tail->previous = head;
  361|  5.65k|}
_ZN6DLItemIP5NLinkEC2ES1_l:
  347|  11.3k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLListIP5NLinkE7pInsertES1_P6DLItemIS1_E:
  388|  14.5k|DLItem<L_DATA> *DLList<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  389|  14.5k|    auto *i = new DLItem<L_DATA>(data, number_of_items + 1, pos->previous, pos);
  390|  14.5k|    pos->previous->next = i;
  391|  14.5k|    pos->previous = i;
  392|  14.5k|    number_of_items++;
  393|  14.5k|    return i;
  394|  14.5k|}
_ZN6DLItemIP5NLinkEC2ES1_lPS2_S3_:
  351|  21.8k|    item(i), index(ind), previous(p), next(n) { }
_ZN6DLListIP5NLinkE7pDeleteEP6DLItemIS1_E:
  397|  14.5k|L_DATA DLList<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  398|  14.5k|    assert(number_of_items > 0);
  ------------------
  |  Branch (398:5): [True: 14.5k, False: 0]
  ------------------
  399|  14.5k|    L_DATA data = i->item;
  400|  14.5k|    i->previous->next = i->next;
  401|  14.5k|    i->next->previous = i->previous;
  402|  14.5k|    delete i;
  403|  14.5k|    number_of_items--;
  404|  14.5k|    return data;
  405|  14.5k|}
_ZN6DLListIP5NLinkE4PushES1_:
  425|  14.5k|L_DATA DLList<L_DATA>::Push(L_DATA data) {
  426|  14.5k|    DLItem<L_DATA> *tmp = pInsert(data, tail);
  427|  14.5k|    return tmp->item;
  428|  14.5k|}
_ZN9HugeArrayIP6DLItemIP5NLinkEEC2Ev:
  283|    515|HugeArray<DATA>::HugeArray() {
  284|    515|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    515|    data[0] = 0;
  286|    515|    data[1] = 0;
  287|  16.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 16.4k, False: 515]
  ------------------
  288|  16.4k|        field = nullptr;
  289|  16.4k|    }
  290|    515|    fields[highest_field_index] = data;
  291|    515|}
_ZN6DLListIP5NLinkED2Ev:
  364|  5.65k|DLList<L_DATA>::~DLList() {
  365|  5.65k|    DLItem<L_DATA> *cur = head, *next;
  366|  16.9k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 11.3k, False: 5.65k]
  ------------------
  367|  11.3k|        next = cur->next;
  368|  11.3k|        delete cur;
  369|  11.3k|        cur = next;
  370|  11.3k|    }
  371|  5.65k|    number_of_items = 0;
  372|  5.65k|}
_ZN15DL_Indexed_ListIP5NLinkE7pInsertES1_P6DLItemIS1_E:
  468|  7.28k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  7.28k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  7.28k|    pos->previous->next = i;
  471|  7.28k|    pos->previous = i;
  472|  7.28k|    this->number_of_items++;
  473|  7.28k|    array[last_index] = i;
  474|  7.28k|    last_index++;
  475|  7.28k|    return i;
  476|  7.28k|}
_ZN9HugeArrayIP6DLItemIP5NLinkEEixEl:
   78|  14.5k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIP5NLinkEE3SetEl:
  323|  14.5k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  14.5k|    igraph_int_t data_size;
  325|  15.4k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 835, False: 14.5k]
  ------------------
  326|    835|        highest_field_index++;
  327|    835|        data_size = igraph_int_t(1) << highest_field_index;
  328|    835|        data = new DATA[data_size];
  329|  9.73k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 8.89k, False: 835]
  ------------------
  330|  8.89k|            data[i] = 0;
  331|  8.89k|        }
  332|    835|        size = size + data_size; //overflow noch abfangen
  333|    835|        fields[highest_field_index] = data;
  334|    835|    }
  335|  14.5k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  14.5k|    data = fields[h_index.field_index];
  337|  14.5k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 6.77k, False: 7.80k]
  ------------------
  338|  6.77k|        max_index = index;
  339|  6.77k|    }
  340|  14.5k|    return data[h_index.in_field_index];
  341|  14.5k|}
_ZNK9HugeArrayIP6DLItemIP5NLinkEE14get_huge_indexEl:
  301|  14.5k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  14.5k|    HUGE_INDEX h_index;
  303|  14.5k|    unsigned int shift_index = 0;
  304|  14.5k|    igraph_int_t help_index;
  305|  14.5k|    help_index = index;
  306|  14.5k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 1.89k, False: 12.6k]
  ------------------
  307|  1.89k|        h_index.field_index = 0;
  308|  1.89k|        h_index.in_field_index = index;
  309|  1.89k|        return h_index;
  310|  1.89k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|   350k|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 338k, False: 12.6k]
  ------------------
  313|   338k|        help_index <<= 1;
  314|   338k|        shift_index++;
  315|   338k|    }
  316|  12.6k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  12.6k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  12.6k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  12.6k|    return h_index;
  320|  14.5k|}
_ZN15DL_Indexed_ListIP5NLinkE7pDeleteEP6DLItemIS1_E:
  479|  7.28k|L_DATA DL_Indexed_List<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  480|  7.28k|    assert(this->number_of_items > 0);
  ------------------
  |  Branch (480:5): [True: 7.28k, False: 0]
  ------------------
  481|  7.28k|    L_DATA data = i->item;
  482|  7.28k|    i->previous->next = i->next;
  483|  7.28k|    i->next->previous = i->previous;
  484|  7.28k|    array[i->index] = 0;
  485|  7.28k|    last_index = i->index;
  486|  7.28k|    delete i;
  487|  7.28k|    this->number_of_items--;
  488|  7.28k|    return data;
  489|  7.28k|}
_ZN15DL_Indexed_ListIP5NLinkE4PushES1_:
  491|  7.28k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  7.28k|    DLItem<L_DATA> *tmp;
  493|  7.28k|    tmp = pInsert(data, this->tail);
  494|  7.28k|    return tmp->item;
  495|  7.28k|}
_ZN15DL_Indexed_ListIP5NLinkE3PopEv:
  498|  7.28k|L_DATA DL_Indexed_List<L_DATA>::Pop() {
  499|  7.28k|    return pDelete(this->tail->previous);
  500|  7.28k|}
_ZN15DL_Indexed_ListIP6DLListIP5NNodeEEC2Ev:
  139|    515|    DL_Indexed_List() = default;
_ZN6DLListIPS_IP5NNodeEEC2Ev:
  355|    515|DLList<L_DATA>::DLList() {
  356|    515|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|    515|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|    515|    head->next = tail;
  360|    515|    tail->previous = head;
  361|    515|}
_ZN6DLItemIP6DLListIP5NNodeEEC2ES4_l:
  347|  1.03k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN9HugeArrayIP6DLItemIP6DLListIP5NNodeEEEC2Ev:
  283|    515|HugeArray<DATA>::HugeArray() {
  284|    515|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    515|    data[0] = 0;
  286|    515|    data[1] = 0;
  287|  16.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 16.4k, False: 515]
  ------------------
  288|  16.4k|        field = nullptr;
  289|  16.4k|    }
  290|    515|    fields[highest_field_index] = data;
  291|    515|}
_ZN6DLListIPS_IP5NNodeEED2Ev:
  364|    515|DLList<L_DATA>::~DLList() {
  365|    515|    DLItem<L_DATA> *cur = head, *next;
  366|  1.54k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 1.03k, False: 515]
  ------------------
  367|  1.03k|        next = cur->next;
  368|  1.03k|        delete cur;
  369|  1.03k|        cur = next;
  370|  1.03k|    }
  371|    515|    number_of_items = 0;
  372|    515|}
_ZN9HugeArrayIP6DLItemIP6DLListIP5NNodeEEED2Ev:
  293|    515|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.03k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 515, False: 515]
  ------------------
  295|    515|        data = fields[i];
  296|    515|        delete [] data;
  297|    515|    }
  298|    515|}
_ZN9HugeArrayIP6DLItemIP5NLinkEED2Ev:
  293|    515|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.86k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 1.35k, False: 515]
  ------------------
  295|  1.35k|        data = fields[i];
  296|  1.35k|        delete [] data;
  297|  1.35k|    }
  298|    515|}
_ZN9HugeArrayIP6DLItemIP5NNodeEED2Ev:
  293|    515|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.89k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 1.38k, False: 515]
  ------------------
  295|  1.38k|        data = fields[i];
  296|  1.38k|        delete [] data;
  297|  1.38k|    }
  298|    515|}
_ZN7networkD2Ev:
  263|    515|    ~network() {
  264|    515|        ClusterList<NNode*> *cl_cur;
  265|       |
  266|  7.80k|        while (link_list.Size()) {
  ------------------
  |  Branch (266:16): [True: 7.28k, False: 515]
  ------------------
  267|  7.28k|            delete link_list.Pop();
  268|  7.28k|        }
  269|  5.65k|        while (node_list.Size()) {
  ------------------
  |  Branch (269:16): [True: 5.14k, False: 515]
  ------------------
  270|  5.14k|            delete node_list.Pop();
  271|  5.14k|        }
  272|    515|        while (cluster_list.Size()) {
  ------------------
  |  Branch (272:16): [True: 0, False: 515]
  ------------------
  273|      0|            cl_cur = cluster_list.Pop();
  274|      0|            while (cl_cur->Size()) {
  ------------------
  |  Branch (274:20): [True: 0, False: 0]
  ------------------
  275|      0|                cl_cur->Pop();
  276|      0|            }
  277|      0|            delete cl_cur;
  278|      0|        }
  279|    515|    }
_ZNK6DLListIP5NLinkE4SizeEv:
  120|  8.83k|    igraph_int_t Size() const {
  121|  8.83k|        return number_of_items;
  122|  8.83k|    }
_ZN5NLinkD2Ev:
  241|  7.28k|    ~NLink() { start->Disconnect_From(end); }
_ZN5NNodeD2Ev:
  185|  5.14k|    ~NNode() { Disconnect_From_All(); }
_ZNK6DLListIPS_IP5NNodeEE4SizeEv:
  120|    515|    igraph_int_t Size() const {
  121|    515|        return number_of_items;
  122|    515|    }
_ZN5NNodeC2EllP6DLListIP5NLinkEPKc:
  179|  5.14k|            index(ind), cluster_index(c_ind), global_link_list(ll)
  180|  5.14k|    {
  181|  5.14k|        strcpy(name, n);
  182|  5.14k|    }
_ZNK5NNode9Get_IndexEv:
  187|  5.14k|    igraph_int_t Get_Index() const {
  188|  5.14k|        return index;
  189|  5.14k|    }
_ZNK5NNode16Get_ClusterIndexEv:
  190|   898M|    igraph_int_t Get_ClusterIndex() const {
  191|   898M|        return cluster_index;
  192|   898M|    }
_ZN5NNode16Set_ClusterIndexEl:
  199|  54.1M|    void Set_ClusterIndex(igraph_int_t ci) {
  200|  54.1M|        cluster_index = ci;
  201|  54.1M|    }
_ZNK5NNode10Get_DegreeEv:
  202|  5.86k|    igraph_int_t Get_Degree() const {
  203|  5.86k|        return (neighbours.Size());
  204|  5.86k|    }
_ZNK5NNode10Get_WeightEv:
  211|   115M|    double Get_Weight() const {
  212|   115M|        return weight;
  213|   115M|    }
_ZN5NNode10Set_WeightEd:
  214|  10.2k|    void Set_Weight(double w) {
  215|  10.2k|        weight = w;
  216|  10.2k|    }
_ZNK5NNode14Get_NeighboursEv:
  218|  5.14k|    const DLList<NNode*> *Get_Neighbours() const {
  219|  5.14k|        return &neighbours;
  220|  5.14k|    }
_ZNK5NNode9Get_LinksEv:
  221|   169M|    const DLList<NLink*> *Get_Links() const {
  222|   169M|        return &n_links;
  223|   169M|    }
_ZN5NLinkC2EP5NNodeS1_d:
  238|  7.28k|    NLink(NNode *s, NNode *e, double w) : start(s), end(e), weight(w) { }
_ZN5NLink9Get_StartEv:
  243|   659M|    NNode *Get_Start() { return start; }
_ZN5NLink7Get_EndEv:
  244|   231M|    NNode *Get_End() { return end; }
_ZNK5NLink10Get_WeightEv:
  248|   445M|    double Get_Weight() const { return weight; }
_ZN6DLListIP5NNodeE10Is_In_ListES1_:
  450|  7.28k|igraph_int_t DLList<L_DATA>::Is_In_List(L_DATA data) {
  451|  7.28k|    DLItem<L_DATA> *cur = head, *next;
  452|  7.28k|    igraph_int_t pos = 0;
  453|  29.6k|    while (cur) {
  ------------------
  |  Branch (453:12): [True: 22.4k, False: 7.28k]
  ------------------
  454|  22.4k|        next = cur->next;
  455|  22.4k|        if (cur->item == data) {
  ------------------
  |  Branch (455:13): [True: 0, False: 22.4k]
  ------------------
  456|      0|            return pos ;
  457|      0|        }
  458|  22.4k|        cur = next;
  459|  22.4k|        pos++;
  460|  22.4k|    }
  461|  7.28k|    return 0;
  462|  7.28k|}
_ZN11DLList_IterIP5NLinkE5FirstEPK6DLListIS1_E:
  531|   169M|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   169M|    list = l;
  533|   169M|    current = list->head->next;
  534|   169M|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 169M]
  ------------------
  535|      0|        end_reached = true;
  536|   169M|    } else {
  537|   169M|        end_reached = false;
  538|   169M|    }
  539|   169M|    return (current->item);
  540|   169M|}
_ZNK11DLList_IterIP5NLinkE3EndEv:
  157|   614M|    bool End() const {
  158|   614M|        return end_reached;
  159|   614M|    }
_ZN11DLList_IterIP5NLinkE4NextEv:
  513|   445M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|   445M|    current = current->next;
  515|   445M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 169M, False: 275M]
  ------------------
  516|   169M|        end_reached = true;
  517|   169M|    }
  518|   445M|    return (current->item);
  519|   445M|}
_ZN6DLListIP5NNodeE7fDeleteES1_:
  409|  14.5k|int DLList<L_DATA>::fDelete(L_DATA data) {
  410|  14.5k|    if ((number_of_items == 0) || (!data)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 14.5k]
  |  Branch (410:35): [True: 0, False: 14.5k]
  ------------------
  411|      0|        return 0;
  412|      0|    }
  413|  14.5k|    DLItem<L_DATA> *cur;
  414|  14.5k|    cur = head->next;
  415|  68.8k|    while ((cur != tail) && (cur->item != data)) {
  ------------------
  |  Branch (415:12): [True: 68.8k, False: 0]
  |  Branch (415:29): [True: 54.3k, False: 14.5k]
  ------------------
  416|  54.3k|        cur = cur->next;
  417|  54.3k|    }
  418|  14.5k|    if (cur != tail) {
  ------------------
  |  Branch (418:9): [True: 14.5k, False: 0]
  ------------------
  419|  14.5k|        return (pDelete(cur) != 0);
  420|  14.5k|    }
  421|      0|    return 0;
  422|  14.5k|}
_ZN6DLListIP5NLinkE7fDeleteES1_:
  409|  14.5k|int DLList<L_DATA>::fDelete(L_DATA data) {
  410|  14.5k|    if ((number_of_items == 0) || (!data)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 14.5k]
  |  Branch (410:35): [True: 0, False: 14.5k]
  ------------------
  411|      0|        return 0;
  412|      0|    }
  413|  14.5k|    DLItem<L_DATA> *cur;
  414|  14.5k|    cur = head->next;
  415|  68.8k|    while ((cur != tail) && (cur->item != data)) {
  ------------------
  |  Branch (415:12): [True: 68.8k, False: 0]
  |  Branch (415:29): [True: 54.3k, False: 14.5k]
  ------------------
  416|  54.3k|        cur = cur->next;
  417|  54.3k|    }
  418|  14.5k|    if (cur != tail) {
  ------------------
  |  Branch (418:9): [True: 14.5k, False: 0]
  ------------------
  419|  14.5k|        return (pDelete(cur) != 0);
  420|  14.5k|    }
  421|      0|    return 0;
  422|  14.5k|}
_ZN15DL_Indexed_ListIPlEC2Ev:
  139|  1.03k|    DL_Indexed_List() = default;
_ZN6DLListIPlEC2Ev:
  355|  1.03k|DLList<L_DATA>::DLList() {
  356|  1.03k|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|  1.03k|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|  1.03k|    head->next = tail;
  360|  1.03k|    tail->previous = head;
  361|  1.03k|}
_ZN6DLItemIPlEC2ES0_l:
  347|  2.06k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLItemIPlEC2ES0_lPS1_S2_:
  351|  10.2k|    item(i), index(ind), previous(p), next(n) { }
_ZN9HugeArrayIP6DLItemIPlEEC2Ev:
  283|  1.03k|HugeArray<DATA>::HugeArray() {
  284|  1.03k|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|  1.03k|    data[0] = 0;
  286|  1.03k|    data[1] = 0;
  287|  32.9k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 32.9k, False: 1.03k]
  ------------------
  288|  32.9k|        field = nullptr;
  289|  32.9k|    }
  290|  1.03k|    fields[highest_field_index] = data;
  291|  1.03k|}
_ZN6DLListIPlED2Ev:
  364|  1.03k|DLList<L_DATA>::~DLList() {
  365|  1.03k|    DLItem<L_DATA> *cur = head, *next;
  366|  13.3k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 12.3k, False: 1.03k]
  ------------------
  367|  12.3k|        next = cur->next;
  368|  12.3k|        delete cur;
  369|  12.3k|        cur = next;
  370|  12.3k|    }
  371|  1.03k|    number_of_items = 0;
  372|  1.03k|}
_ZN15DL_Indexed_ListIPlE7pInsertES0_P6DLItemIS0_E:
  468|  10.2k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  10.2k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  10.2k|    pos->previous->next = i;
  471|  10.2k|    pos->previous = i;
  472|  10.2k|    this->number_of_items++;
  473|  10.2k|    array[last_index] = i;
  474|  10.2k|    last_index++;
  475|  10.2k|    return i;
  476|  10.2k|}
_ZN9HugeArrayIP6DLItemIPlEEixEl:
   78|  10.2k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIPlEE3SetEl:
  323|  10.2k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  10.2k|    igraph_int_t data_size;
  325|  12.0k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 1.73k, False: 10.2k]
  ------------------
  326|  1.73k|        highest_field_index++;
  327|  1.73k|        data_size = igraph_int_t(1) << highest_field_index;
  328|  1.73k|        data = new DATA[data_size];
  329|  11.9k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 10.1k, False: 1.73k]
  ------------------
  330|  10.1k|            data[i] = 0;
  331|  10.1k|        }
  332|  1.73k|        size = size + data_size; //overflow noch abfangen
  333|  1.73k|        fields[highest_field_index] = data;
  334|  1.73k|    }
  335|  10.2k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  10.2k|    data = fields[h_index.field_index];
  337|  10.2k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 9.25k, False: 1.03k]
  ------------------
  338|  9.25k|        max_index = index;
  339|  9.25k|    }
  340|  10.2k|    return data[h_index.in_field_index];
  341|  10.2k|}
_ZNK9HugeArrayIP6DLItemIPlEE14get_huge_indexEl:
  301|  10.2k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  10.2k|    HUGE_INDEX h_index;
  303|  10.2k|    unsigned int shift_index = 0;
  304|  10.2k|    igraph_int_t help_index;
  305|  10.2k|    help_index = index;
  306|  10.2k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 2.06k, False: 8.22k]
  ------------------
  307|  2.06k|        h_index.field_index = 0;
  308|  2.06k|        h_index.in_field_index = index;
  309|  2.06k|        return h_index;
  310|  2.06k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|   235k|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 227k, False: 8.22k]
  ------------------
  313|   227k|        help_index <<= 1;
  314|   227k|        shift_index++;
  315|   227k|    }
  316|  8.22k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  8.22k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  8.22k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  8.22k|    return h_index;
  320|  10.2k|}
_ZN9HugeArrayIP6DLItemIPlEED2Ev:
  293|  1.03k|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  3.79k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 2.76k, False: 1.03k]
  ------------------
  295|  2.76k|        data = fields[i];
  296|  2.76k|        delete [] data;
  297|  2.76k|    }
  298|  1.03k|}
_ZN9HugeArrayIPS_IdEEC2Ev:
  283|    515|HugeArray<DATA>::HugeArray() {
  284|    515|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    515|    data[0] = 0;
  286|    515|    data[1] = 0;
  287|  16.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 16.4k, False: 515]
  ------------------
  288|  16.4k|        field = nullptr;
  289|  16.4k|    }
  290|    515|    fields[highest_field_index] = data;
  291|    515|}
_ZN9HugeArrayIPS_IdEED2Ev:
  293|    515|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.03k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 515, False: 515]
  ------------------
  295|    515|        data = fields[i];
  296|    515|        delete [] data;
  297|    515|    }
  298|    515|}
_ZN11DLList_IterIP5NNodeE5FirstEPK6DLListIS1_E:
  531|   154k|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   154k|    list = l;
  533|   154k|    current = list->head->next;
  534|   154k|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 154k]
  ------------------
  535|      0|        end_reached = true;
  536|   154k|    } else {
  537|   154k|        end_reached = false;
  538|   154k|    }
  539|   154k|    return (current->item);
  540|   154k|}
_ZNK11DLList_IterIP5NNodeE3EndEv:
  157|  1.52M|    bool End() const {
  158|  1.52M|        return end_reached;
  159|  1.52M|    }
_ZN15DL_Indexed_ListIPlE4PushES0_:
  491|  10.2k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  10.2k|    DLItem<L_DATA> *tmp;
  493|  10.2k|    tmp = pInsert(data, this->tail);
  494|  10.2k|    return tmp->item;
  495|  10.2k|}
_ZN11DLList_IterIP5NNodeE4NextEv:
  513|  1.36M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|  1.36M|    current = current->next;
  515|  1.36M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 154k, False: 1.21M]
  ------------------
  516|   154k|        end_reached = true;
  517|   154k|    }
  518|  1.36M|    return (current->item);
  519|  1.36M|}
_ZN6DLListIPlE12delete_itemsEv:
  375|  1.03k|void DLList<L_DATA>::delete_items() {
  376|  1.03k|    DLItem<L_DATA> *cur, *next;
  377|  1.03k|    cur = this->head;
  378|  13.3k|    while (cur) {
  ------------------
  |  Branch (378:12): [True: 12.3k, False: 1.03k]
  ------------------
  379|  12.3k|        next = cur->next;
  380|  12.3k|        cur->del();
  381|  12.3k|        cur = next;
  382|  12.3k|    }
  383|  1.03k|    this->number_of_items = 0;
  384|  1.03k|}
_ZN6DLItemIPlE3delEv:
  101|  12.3k|    void del() {
  102|  12.3k|        delete item;
  103|  12.3k|    }
_ZN11DLList_IterIPlE5FirstEPK6DLListIS0_E:
  531|   206k|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   206k|    list = l;
  533|   206k|    current = list->head->next;
  534|   206k|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 206k]
  ------------------
  535|      0|        end_reached = true;
  536|   206k|    } else {
  537|   206k|        end_reached = false;
  538|   206k|    }
  539|   206k|    return (current->item);
  540|   206k|}
_ZN11DLList_IterIPlE4NextEv:
  513|  1.84M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|  1.84M|    current = current->next;
  515|  1.84M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 206k, False: 1.64M]
  ------------------
  516|   206k|        end_reached = true;
  517|   206k|    }
  518|  1.84M|    return (current->item);
  519|  1.84M|}
_ZN9HugeArrayIiEC2Ev:
  283|  1.54k|HugeArray<DATA>::HugeArray() {
  284|  1.54k|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|  1.54k|    data[0] = 0;
  286|  1.54k|    data[1] = 0;
  287|  49.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 49.4k, False: 1.54k]
  ------------------
  288|  49.4k|        field = nullptr;
  289|  49.4k|    }
  290|  1.54k|    fields[highest_field_index] = data;
  291|  1.54k|}
_ZN9HugeArrayIiED2Ev:
  293|  1.54k|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  7.72k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 6.18k, False: 1.54k]
  ------------------
  295|  6.18k|        data = fields[i];
  296|  6.18k|        delete [] data;
  297|  6.18k|    }
  298|  1.54k|}
_ZN9HugeArrayIiEixEl:
   78|  49.4k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIiE3SetEl:
  323|  49.4k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  49.4k|    igraph_int_t data_size;
  325|  54.0k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 4.63k, False: 49.4k]
  ------------------
  326|  4.63k|        highest_field_index++;
  327|  4.63k|        data_size = igraph_int_t(1) << highest_field_index;
  328|  4.63k|        data = new DATA[data_size];
  329|  26.2k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 21.6k, False: 4.63k]
  ------------------
  330|  21.6k|            data[i] = 0;
  331|  21.6k|        }
  332|  4.63k|        size = size + data_size; //overflow noch abfangen
  333|  4.63k|        fields[highest_field_index] = data;
  334|  4.63k|    }
  335|  49.4k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  49.4k|    data = fields[h_index.field_index];
  337|  49.4k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 15.4k, False: 33.9k]
  ------------------
  338|  15.4k|        max_index = index;
  339|  15.4k|    }
  340|  49.4k|    return data[h_index.in_field_index];
  341|  49.4k|}
_ZNK9HugeArrayIiE14get_huge_indexEl:
  301|  49.4k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  49.4k|    HUGE_INDEX h_index;
  303|  49.4k|    unsigned int shift_index = 0;
  304|  49.4k|    igraph_int_t help_index;
  305|  49.4k|    help_index = index;
  306|  49.4k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 5.40k, False: 44.0k]
  ------------------
  307|  5.40k|        h_index.field_index = 0;
  308|  5.40k|        h_index.in_field_index = index;
  309|  5.40k|        return h_index;
  310|  5.40k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|  1.31M|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 1.27M, False: 44.0k]
  ------------------
  313|  1.27M|        help_index <<= 1;
  314|  1.27M|        shift_index++;
  315|  1.27M|    }
  316|  44.0k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  44.0k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  44.0k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  44.0k|    return h_index;
  320|  49.4k|}

_Z31igraph_i_read_network_spinglassPK8igraph_tPK15igraph_vector_tP7networkb:
   51|    515|    network *net, igraph_bool_t use_weights) {
   52|       |
   53|    515|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   54|    515|    igraph_int_t no_of_edges = igraph_ecount(graph);
   55|    515|    double sum_weight;
   56|       |
   57|  5.65k|    for (igraph_int_t vid = 0; vid < no_of_nodes; vid++) {
  ------------------
  |  Branch (57:32): [True: 5.14k, False: 515]
  ------------------
   58|  5.14k|        char name[SPINGLASS_MAX_NAME_LEN];
   59|  5.14k|        snprintf(name, sizeof(name) / sizeof(name[0]), "%" IGRAPH_PRId "", vid+1);
   60|  5.14k|        net->node_list.Push(new NNode(vid, 0, &net->link_list, name));
   61|  5.14k|    }
   62|       |
   63|    515|    sum_weight = 0.0;
   64|  7.80k|    for (igraph_int_t eid = 0; eid < no_of_edges; eid++) {
  ------------------
  |  Branch (64:32): [True: 7.28k, False: 515]
  ------------------
   65|  7.28k|        igraph_int_t v1 = IGRAPH_FROM(graph, eid);
  ------------------
  |  |  115|  7.28k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  7.28k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   66|  7.28k|        igraph_int_t v2 = IGRAPH_TO(graph, eid);
  ------------------
  |  |  128|  7.28k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  7.28k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   67|  7.28k|        igraph_real_t w = use_weights ? VECTOR(*weights)[eid] : 1.0;
  ------------------
  |  |   60|  7.28k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (67:27): [True: 7.28k, False: 0]
  ------------------
   68|       |
   69|  7.28k|        NNode *node1 = net->node_list.Get(v1);
   70|  7.28k|        NNode *node2 = net->node_list.Get(v2);
   71|       |
   72|  7.28k|        node1->Connect_To(node2, w);
   73|       |
   74|  7.28k|        sum_weight += w;
   75|  7.28k|    }
   76|       |
   77|    515|    net->sum_weights = sum_weight;
   78|       |
   79|    515|    return IGRAPH_SUCCESS;
   80|    515|}

igraph_community_spinglass:
  184|    533|                               igraph_real_t gamma_minus) {
  185|       |
  186|    533|    IGRAPH_HANDLE_EXCEPTIONS(
  ------------------
  |  |   30|    533|    IGRAPH_HANDLE_EXCEPTIONS_BEGIN; \
  |  |  ------------------
  |  |  |  |   21|    533|    try {
  |  |  ------------------
  |  |   31|    533|    code; \
  |  |  ------------------
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 533]
  |  |  |  Branch (31:5): [True: 0, False: 533]
  |  |  |  Branch (31:5): [True: 533, False: 0]
  |  |  ------------------
  |  |   32|      0|    IGRAPH_HANDLE_EXCEPTIONS_END;
  |  |  ------------------
  |  |  |  |   23|      0|    } \
  |  |  |  |   24|    533|    catch (const std::bad_alloc &e) { IGRAPH_ERROR(e.what(), IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   25|    533|    catch (const std::range_error &e) { IGRAPH_ERROR(e.what(), IGRAPH_EOVERFLOW); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   26|    533|    catch (const std::exception &e) { IGRAPH_ERROR(e.what(), IGRAPH_FAILURE); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   27|    533|    catch (...) { IGRAPH_ERROR("Unknown exception caught.", IGRAPH_FAILURE); /* LCOV_EXCL_LINE */ }
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|      0|        switch (implementation) {
  188|      0|        case IGRAPH_SPINCOMM_IMP_ORIG:
  189|      0|            return igraph_i_community_spinglass_orig(graph, weights, modularity,
  190|      0|                    temperature, membership, csize,
  191|      0|                    spins, parupdate, starttemp,
  192|      0|                    stoptemp, coolfact, update_rule,
  193|      0|                    gamma);
  194|      0|            break;
  195|      0|        case IGRAPH_SPINCOMM_IMP_NEG:
  196|      0|            return igraph_i_community_spinglass_negative(graph, weights, modularity,
  197|      0|                    temperature, membership, csize,
  198|      0|                    spins, parupdate, starttemp,
  199|      0|                    stoptemp, coolfact,
  200|      0|                    update_rule, gamma,
  201|      0|                    gamma_minus);
  202|      0|            break;
  203|      0|        default:
  204|      0|            IGRAPH_ERROR("Unknown implementation in spinglass community detection.",
  205|      0|                         IGRAPH_EINVAL);
  206|      0|        }
  207|      0|    );
  208|      0|}
clustertool.cpp:_ZL33igraph_i_community_spinglass_origPK8igraph_tPK15igraph_vector_tPdS5_P19igraph_vector_int_tS7_lbddd24igraph_spincomm_update_td:
  223|    533|        igraph_real_t gamma) {
  224|       |
  225|    533|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  226|    533|    igraph_int_t changes, runs;
  227|    533|    igraph_bool_t use_weights = false;
  228|    533|    bool zeroT;
  229|    533|    double kT, acc, prob;
  230|       |
  231|       |    /* Check arguments */
  232|       |
  233|    533|    if (spins < 2) {
  ------------------
  |  Branch (233:9): [True: 0, False: 533]
  ------------------
  234|      0|        IGRAPH_ERROR("Number of spins must be at least 2.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  235|      0|    }
  236|    533|    if (update_rule != IGRAPH_SPINCOMM_UPDATE_SIMPLE &&
  ------------------
  |  Branch (236:9): [True: 533, False: 0]
  ------------------
  237|    533|        update_rule != IGRAPH_SPINCOMM_UPDATE_CONFIG) {
  ------------------
  |  Branch (237:9): [True: 0, False: 533]
  ------------------
  238|      0|        IGRAPH_ERROR("Invalid update rule for spinglass community detection.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  239|      0|    }
  240|    533|    if (weights) {
  ------------------
  |  Branch (240:9): [True: 533, False: 0]
  ------------------
  241|    533|        if (igraph_vector_size(weights) != igraph_ecount(graph)) {
  ------------------
  |  Branch (241:13): [True: 0, False: 533]
  ------------------
  242|      0|            IGRAPH_ERROR("Invalid weight vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  243|      0|        }
  244|    533|        use_weights = true;
  245|    533|        if (igraph_vector_size(weights) > 0 && igraph_vector_min(weights) < 0) {
  ------------------
  |  Branch (245:13): [True: 515, False: 18]
  |  Branch (245:48): [True: 0, False: 515]
  ------------------
  246|      0|            IGRAPH_ERROR(
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  247|      0|                "Weights must not be negative when using the original implementation of spinglass communities. "
  248|      0|                "Select the implementation meant for negative weights.",
  249|      0|                IGRAPH_EINVAL);
  250|      0|        }
  251|    533|    }
  252|    533|    if (coolfact < 0 || coolfact >= 1.0) {
  ------------------
  |  Branch (252:9): [True: 0, False: 533]
  |  Branch (252:25): [True: 0, False: 533]
  ------------------
  253|      0|        IGRAPH_ERROR("Cooling factor must be positive and strictly smaller than 1.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  254|      0|    }
  255|    533|    if (gamma < 0.0) {
  ------------------
  |  Branch (255:9): [True: 0, False: 533]
  ------------------
  256|      0|        IGRAPH_ERROR("Gamma value must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  257|      0|    }
  258|    533|    if ( !(starttemp == 0 && stoptemp == 0) ) {
  ------------------
  |  Branch (258:12): [True: 0, False: 533]
  |  Branch (258:30): [True: 0, False: 0]
  ------------------
  259|    533|        if (! (starttemp > 0 && stoptemp > 0)) {
  ------------------
  |  Branch (259:16): [True: 533, False: 0]
  |  Branch (259:33): [True: 533, False: 0]
  ------------------
  260|      0|            IGRAPH_ERROR("Starting and stopping temperatures must be both positive or both zero.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  261|      0|                         IGRAPH_EINVAL);
  262|      0|        }
  263|    533|        if (starttemp <= stoptemp) {
  ------------------
  |  Branch (263:13): [True: 0, False: 533]
  ------------------
  264|      0|            IGRAPH_ERROR("The starting temperature must be larger than the stopping temperature.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  265|      0|                         IGRAPH_EINVAL);
  266|      0|        }
  267|    533|    }
  268|       |
  269|       |    /* The spinglass algorithm does not handle the trivial cases of the
  270|       |       null and singleton graphs, so we catch them here. */
  271|    533|    if (no_of_nodes < 2) {
  ------------------
  |  Branch (271:9): [True: 18, False: 515]
  ------------------
  272|     18|        if (membership) {
  ------------------
  |  Branch (272:13): [True: 18, False: 0]
  ------------------
  273|     18|            IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|     18|    do { \
  |  |  657|     18|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|     18|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|     18|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|     18|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 18]
  |  |  ------------------
  ------------------
  274|     18|            igraph_vector_int_null(membership);
  275|     18|        }
  276|     18|        if (modularity) {
  ------------------
  |  Branch (276:13): [True: 18, False: 0]
  ------------------
  277|     18|            IGRAPH_CHECK(igraph_modularity(graph, membership, nullptr, 1, igraph_is_directed(graph), modularity));
  ------------------
  |  |  656|     18|    do { \
  |  |  657|     18|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|     18|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|     18|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|     18|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 18]
  |  |  ------------------
  ------------------
  278|     18|        }
  279|     18|        if (temperature) {
  ------------------
  |  Branch (279:13): [True: 0, False: 18]
  ------------------
  280|      0|            *temperature = stoptemp;
  281|      0|        }
  282|     18|        if (csize) {
  ------------------
  |  Branch (282:13): [True: 0, False: 18]
  ------------------
  283|       |            /* 0 clusters for 0 nodes, 1 cluster for 1 node */
  284|      0|            IGRAPH_CHECK(igraph_vector_int_resize(csize, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  285|      0|            igraph_vector_int_fill(csize, 1);
  286|      0|        }
  287|     18|        return IGRAPH_SUCCESS;
  288|     18|    }
  289|       |
  290|       |    /* Check whether we have a single component */
  291|    515|    igraph_bool_t conn;
  292|    515|    IGRAPH_CHECK(igraph_is_connected(graph, &conn, IGRAPH_WEAK));
  ------------------
  |  |  656|    515|    do { \
  |  |  657|    515|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    515|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    515|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 515]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    515|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 515]
  |  |  ------------------
  ------------------
  293|    515|    if (!conn) {
  ------------------
  |  Branch (293:9): [True: 0, False: 515]
  ------------------
  294|      0|        IGRAPH_ERROR("Cannot work with an unconnected graph.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  295|      0|    }
  296|       |
  297|    515|    network net;
  298|       |
  299|       |    /* Transform the igraph_t */
  300|    515|    IGRAPH_CHECK(igraph_i_read_network_spinglass(graph, weights,
  ------------------
  |  |  656|    515|    do { \
  |  |  657|    515|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    515|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    515|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 515]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    515|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 515]
  |  |  ------------------
  ------------------
  301|    515|                                       &net, use_weights));
  302|       |
  303|    515|    prob = 2.0 * net.sum_weights / double(net.node_list.Size())
  304|    515|           / double(net.node_list.Size() - 1);
  305|       |
  306|    515|    PottsModel pm(&net, spins, update_rule);
  307|       |
  308|    515|    if ((stoptemp == 0.0) && (starttemp == 0.0)) {
  ------------------
  |  Branch (308:9): [True: 0, False: 515]
  |  Branch (308:30): [True: 0, False: 0]
  ------------------
  309|      0|        zeroT = true;
  310|    515|    } else {
  311|    515|        zeroT = false;
  312|    515|    }
  313|    515|    if (!zeroT) {
  ------------------
  |  Branch (313:9): [True: 515, False: 0]
  ------------------
  314|    515|        kT = pm.FindStartTemp(gamma, prob, starttemp);
  315|    515|    } else {
  316|      0|        kT = stoptemp;
  317|      0|    }
  318|       |    /* assign random initial configuration */
  319|    515|    pm.assign_initial_conf(-1);
  320|    515|    runs = 0;
  321|    515|    changes = 1;
  322|       |
  323|   195k|    while (changes > 0 && (kT / stoptemp > 1.0 || (zeroT && runs < 150))) {
  ------------------
  |  Branch (323:12): [True: 195k, False: 294]
  |  Branch (323:28): [True: 195k, False: 221]
  |  Branch (323:52): [True: 0, False: 221]
  |  Branch (323:61): [True: 0, False: 0]
  ------------------
  324|       |
  325|   195k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   195k|    do { \
  |  |   47|   195k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 195k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   195k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 195k]
  |  |  ------------------
  ------------------
  326|       |
  327|   195k|        runs++;
  328|   195k|        if (!zeroT) {
  ------------------
  |  Branch (328:13): [True: 195k, False: 0]
  ------------------
  329|   195k|            kT *= coolfact;
  330|   195k|            if (parupdate) {
  ------------------
  |  Branch (330:17): [True: 0, False: 195k]
  ------------------
  331|      0|                changes = pm.HeatBathParallelLookup(gamma, prob, kT, 50);
  332|   195k|            } else {
  333|   195k|                acc = pm.HeatBathLookup(gamma, prob, kT, 50);
  334|   195k|                if (acc < (1.0 - 1.0 / double(spins)) * 0.01) {
  ------------------
  |  Branch (334:21): [True: 294, False: 194k]
  ------------------
  335|    294|                    changes = 0;
  336|   194k|                } else {
  337|   194k|                    changes = 1;
  338|   194k|                }
  339|   195k|            }
  340|   195k|        } else {
  341|      0|            if (parupdate) {
  ------------------
  |  Branch (341:17): [True: 0, False: 0]
  ------------------
  342|      0|                changes = pm.HeatBathParallelLookupZeroTemp(gamma, prob, 50);
  343|      0|            } else {
  344|      0|                acc = pm.HeatBathLookupZeroTemp(gamma, prob, 50);
  345|       |                /* less than 1 percent acceptance ratio */
  346|      0|                if (acc < (1.0 - 1.0 / double(spins)) * 0.01) {
  ------------------
  |  Branch (346:21): [True: 0, False: 0]
  ------------------
  347|      0|                    changes = 0;
  348|      0|                } else {
  349|      0|                    changes = 1;
  350|      0|                }
  351|      0|            }
  352|      0|        }
  353|   195k|    } /* while loop */
  354|       |
  355|    515|    pm.WriteClusters(modularity, temperature, csize, membership, kT, gamma);
  356|       |
  357|    515|    return IGRAPH_SUCCESS;
  358|    515|}

_ZN10PottsModelC2EP7networkli:
   56|    515|        net(n), q(qvalue), operation_mode(m), Qmatrix(qvalue+1)
   57|    515|{
   58|    515|    DLList_Iter<NNode*> iter;
   59|    515|    const NNode *n_cur;
   60|    515|    igraph_int_t *i_ptr;
   61|       |    //needed in calculating modularity
   62|    515|    Qa     = new double[q + 1];
   63|       |    //weights for each spin state needed in Monte Carlo process
   64|    515|    weights = new double[q + 1];
   65|       |    //bookkeeping of occupation numbers of spin states or the number of links in community
   66|    515|    color_field = new double[q + 1];
   67|    515|    neighbours = new double[q + 1];
   68|       |
   69|    515|    num_of_nodes = net->node_list.Size();
   70|    515|    num_of_links = net->link_list.Size();
   71|       |
   72|    515|    n_cur = iter.First(&net->node_list);
   73|  5.65k|    while (!iter.End()) {
  ------------------
  |  Branch (73:12): [True: 5.14k, False: 515]
  ------------------
   74|  5.14k|        if (k_max < n_cur->Get_Degree()) {
  ------------------
  |  Branch (74:13): [True: 725, False: 4.41k]
  ------------------
   75|    725|            k_max = n_cur->Get_Degree();
   76|    725|        }
   77|  5.14k|        i_ptr = new igraph_int_t;
   78|  5.14k|        *i_ptr = 0;
   79|  5.14k|        new_spins.Push(i_ptr);
   80|  5.14k|        i_ptr = new igraph_int_t;
   81|  5.14k|        *i_ptr = 0;
   82|  5.14k|        previous_spins.Push(i_ptr);
   83|  5.14k|        n_cur = iter.Next();
   84|  5.14k|    }
   85|    515|}
_ZN10PottsModelD2Ev:
   89|    515|PottsModel::~PottsModel() {
   90|       |    /* The DLItem destructor does not delete its item currently,
   91|       |       because of some bad design. As a workaround, we delete them here
   92|       |       by hand */
   93|    515|    new_spins.delete_items();
   94|    515|    previous_spins.delete_items();
   95|    515|    delete [] Qa;
   96|    515|    delete [] weights;
   97|    515|    delete [] color_field;
   98|    515|    delete [] neighbours;
   99|    515|}
_ZN10PottsModel19assign_initial_confEl:
  106|  1.03k|igraph_int_t PottsModel::assign_initial_conf(igraph_int_t spin) {
  107|  1.03k|    igraph_int_t s;
  108|  1.03k|    DLList_Iter<NNode*> iter;
  109|  1.03k|    DLList_Iter<NLink*> l_iter;
  110|  1.03k|    NNode *n_cur;
  111|  1.03k|    const NLink *l_cur;
  112|  1.03k|    double sum_weight;
  113|       |
  114|       |    // initialize colorfield
  115|  12.3k|    for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (115:30): [True: 11.3k, False: 1.03k]
  ------------------
  116|  11.3k|        color_field[i] = 0.0;
  117|  11.3k|    }
  118|       |    //
  119|  1.03k|    total_degree_sum = 0.0;
  120|  1.03k|    n_cur = iter.First(&net->node_list);
  121|  11.3k|    while (!iter.End()) {
  ------------------
  |  Branch (121:12): [True: 10.2k, False: 1.03k]
  ------------------
  122|  10.2k|        if (spin < 0) {
  ------------------
  |  Branch (122:13): [True: 10.2k, False: 0]
  ------------------
  123|  10.2k|            s = RNG_INTEGER(1, q);
  ------------------
  |  |  152|  10.2k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  124|  10.2k|        } else {
  125|      0|            s = spin;
  126|      0|        }
  127|  10.2k|        n_cur->Set_ClusterIndex(s);
  128|  10.2k|        l_cur = l_iter.First(n_cur->Get_Links());
  129|  10.2k|        sum_weight = 0;
  130|  39.4k|        while (!l_iter.End()) {
  ------------------
  |  Branch (130:16): [True: 29.1k, False: 10.2k]
  ------------------
  131|  29.1k|            sum_weight += l_cur->Get_Weight(); //weight should be one, in case we are not using it.
  132|  29.1k|            l_cur = l_iter.Next();
  133|  29.1k|        }
  134|       |        // we set the sum of the weights or the degree as the weight of the node, this way
  135|       |        // we do not have to calculate it again.
  136|  10.2k|        n_cur->Set_Weight(sum_weight);
  137|       |
  138|       |        // in case we want all links to be contribute equally - parameter gamm=fixed
  139|  10.2k|        if (operation_mode == 0) {
  ------------------
  |  Branch (139:13): [True: 0, False: 10.2k]
  ------------------
  140|      0|            color_field[s]++;
  141|  10.2k|        } else {
  142|  10.2k|            color_field[s] += sum_weight;
  143|  10.2k|        }
  144|       |        // or in case we want to use a weight of each link that is proportional to k_i\times k_j
  145|  10.2k|        total_degree_sum += sum_weight;
  146|  10.2k|        n_cur = iter.Next();
  147|  10.2k|    }
  148|       |
  149|  1.03k|    return net->node_list.Size();
  150|  1.03k|}
_ZN10PottsModel18initialize_QmatrixEv:
  159|    515|double PottsModel::initialize_Qmatrix() {
  160|    515|    DLList_Iter<NLink*> l_iter;
  161|    515|    NLink *l_cur;
  162|    515|    igraph_int_t i, j;
  163|       |    //initialize with zeros
  164|    515|    num_of_links = net->link_list.Size();
  165|  6.18k|    for (i = 0; i <= q; i++) {
  ------------------
  |  Branch (165:17): [True: 5.66k, False: 515]
  ------------------
  166|  5.66k|        Qa[i] = 0.0;
  167|  39.6k|        for (j = i; j <= q; j++) {
  ------------------
  |  Branch (167:21): [True: 33.9k, False: 5.66k]
  ------------------
  168|  33.9k|            Qmatrix[i][j] = 0.0;
  169|  33.9k|            Qmatrix[j][i] = 0.0;
  170|  33.9k|        }
  171|  5.66k|    }
  172|       |    //go over all links and make corresponding entries in Q matrix
  173|       |    //An edge connecting state i wiht state j will get an entry in Qij and Qji
  174|    515|    l_cur = l_iter.First(&net->link_list);
  175|  7.80k|    while (!l_iter.End()) {
  ------------------
  |  Branch (175:12): [True: 7.28k, False: 515]
  ------------------
  176|  7.28k|        i = l_cur->Get_Start()->Get_ClusterIndex();
  177|  7.28k|        j = l_cur->Get_End()->Get_ClusterIndex();
  178|  7.28k|        Qmatrix[i][j] += l_cur->Get_Weight();
  179|  7.28k|        Qmatrix[j][i] += l_cur->Get_Weight();
  180|       |
  181|  7.28k|        l_cur = l_iter.Next();
  182|  7.28k|    }
  183|       |    //Finally, calculate sum over rows and keep in Qa
  184|  6.18k|    for (i = 0; i <= q; i++) {
  ------------------
  |  Branch (184:17): [True: 5.66k, False: 515]
  ------------------
  185|  67.9k|        for (j = 0; j <= q; j++) {
  ------------------
  |  Branch (185:21): [True: 62.3k, False: 5.66k]
  ------------------
  186|  62.3k|            Qa[i] += Qmatrix[i][j];
  187|  62.3k|        }
  188|  5.66k|    }
  189|    515|    return calculate_Q();
  190|    515|}
_ZN10PottsModel11calculate_QEv:
  195|    515|double PottsModel::calculate_Q() {
  196|    515|    double Q = 0.0;
  197|  6.18k|    for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (197:30): [True: 5.66k, False: 515]
  ------------------
  198|  5.66k|        Q += Qmatrix[i][i] - Qa[i] * Qa[i] / double(2.0 * net->sum_weights);
  199|  5.66k|    }
  200|    515|    Q /= double(2.0 * net->sum_weights);
  201|    515|    return Q;
  202|    515|}
_ZN10PottsModel13FindStartTempEddd:
  209|    515|double PottsModel::FindStartTemp(double gamma, double prob, double ts) {
  210|    515|    double kT;
  211|    515|    kT = ts;
  212|       |    //assing random initial condition
  213|    515|    assign_initial_conf(-1);
  214|       |    //initialize Modularity matrix, from now on, it will be updated at every spin change
  215|    515|    initialize_Qmatrix();
  216|       |    // the factor 1-1/q is important, since even, at infinite temperature,
  217|       |    // only 1-1/q of all spins do change their state, since a randomly chooses new
  218|       |    // state is with prob. 1/q the old state.
  219|  2.28k|    while (acceptance < (1.0 - 1.0 / double(q)) * 0.95) { //want 95% acceptance
  ------------------
  |  Branch (219:12): [True: 1.77k, False: 515]
  ------------------
  220|  1.77k|        kT = kT * 1.1;
  221|  1.77k|        HeatBathParallelLookup(gamma, prob, kT, 50);
  222|  1.77k|    }
  223|    515|    kT *= 1.1; // just to be sure...
  224|    515|    return kT;
  225|    515|}
_ZN10PottsModel22HeatBathParallelLookupEdddj:
  471|  1.77k|igraph_int_t PottsModel::HeatBathParallelLookup(double gamma, double prob, double kT, unsigned int max_sweeps) {
  472|  1.77k|    DLList_Iter<NNode*> net_iter;
  473|  1.77k|    DLList_Iter<NLink*> l_iter;
  474|  1.77k|    DLList_Iter<igraph_int_t*> i_iter, i_iter2;
  475|  1.77k|    NNode *node, *n_cur;
  476|  1.77k|    NLink *l_cur;
  477|  1.77k|    igraph_int_t new_spin, spin_opt, old_spin;
  478|  1.77k|    igraph_int_t *SPIN, *P_SPIN;
  479|  1.77k|    unsigned int sweep;
  480|  1.77k|    igraph_int_t max_q;
  481|  1.77k|    igraph_int_t changes;
  482|  1.77k|    double h, delta = 0, norm, r, beta, minweight, prefac = 0, w, degree;
  483|  1.77k|    bool cyclic = false/*, found*/;
  484|  1.77k|    igraph_int_t number_of_nodes;
  485|       |
  486|  1.77k|    sweep = 0;
  487|  1.77k|    changes = 1;
  488|  1.77k|    number_of_nodes = net->node_list.Size();
  489|  70.7k|    while (sweep < max_sweeps && changes) {
  ------------------
  |  Branch (489:12): [True: 69.5k, False: 1.17k]
  |  Branch (489:34): [True: 68.9k, False: 597]
  ------------------
  490|  68.9k|        cyclic = true;
  491|  68.9k|        sweep++;
  492|  68.9k|        changes = 0;
  493|       |        //Loop over all nodes
  494|  68.9k|        node = net_iter.First(&net->node_list);
  495|  68.9k|        SPIN = i_iter.First(&new_spins);
  496|   685k|        while (!net_iter.End()) {
  ------------------
  |  Branch (496:16): [True: 616k, False: 68.9k]
  ------------------
  497|       |            // Initialize neighbours and weights
  498|  7.39M|            for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (498:38): [True: 6.78M, False: 616k]
  ------------------
  499|  6.78M|                neighbours[i] = 0;
  500|  6.78M|                weights[i] = 0;
  501|  6.78M|            }
  502|   616k|            norm = 0.0;
  503|   616k|            degree = node->Get_Weight();
  504|       |            //Loop over all links (=neighbours)
  505|   616k|            l_cur = l_iter.First(node->Get_Links());
  506|  2.31M|            while (!l_iter.End()) {
  ------------------
  |  Branch (506:20): [True: 1.69M, False: 616k]
  ------------------
  507|  1.69M|                w = l_cur->Get_Weight();
  508|  1.69M|                if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (508:21): [True: 846k, False: 846k]
  ------------------
  509|   846k|                    n_cur = l_cur->Get_End();
  510|   846k|                } else {
  511|   846k|                    n_cur = l_cur->Get_Start();
  512|   846k|                }
  513|  1.69M|                neighbours[n_cur->Get_ClusterIndex()] += w;
  514|  1.69M|                l_cur = l_iter.Next();
  515|  1.69M|            }
  516|       |            //Search optimal Spin
  517|   616k|            old_spin = node->Get_ClusterIndex();
  518|   616k|            switch (operation_mode) {
  519|      0|            case 0: {
  ------------------
  |  Branch (519:13): [True: 0, False: 616k]
  ------------------
  520|      0|                prefac = 1.0;
  521|      0|                delta = 1.0;
  522|      0|                break;
  523|      0|            }
  524|   616k|            case 1: { //newman modularity
  ------------------
  |  Branch (524:13): [True: 616k, False: 0]
  ------------------
  525|   616k|                prefac = 1.0;
  526|   616k|                prob = degree / total_degree_sum;
  527|   616k|                delta = degree;
  528|   616k|                break;
  529|      0|            }
  530|      0|            default:
  ------------------
  |  Branch (530:13): [True: 0, False: 616k]
  ------------------
  531|      0|                IGRAPH_FATAL("Must not reach here.");
  ------------------
  |  |  895|      0|    do { \
  |  |  896|      0|        igraph_fatal(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  897|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (897:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  532|   616k|            }
  533|   616k|            spin_opt = old_spin;
  534|   616k|            beta = 1.0 / kT * prefac;
  535|   616k|            minweight = 0.0;
  536|   616k|            weights[old_spin] = 0.0;
  537|  6.78M|            for (igraph_int_t spin = 1; spin <= q; spin++) { // loop over all possible new spins
  ------------------
  |  Branch (537:41): [True: 6.16M, False: 616k]
  ------------------
  538|  6.16M|                if (spin != old_spin) { // only if we have a different than old spin!
  ------------------
  |  Branch (538:21): [True: 5.54M, False: 616k]
  ------------------
  539|  5.54M|                    h = color_field[spin] + delta - color_field[old_spin];
  540|  5.54M|                    weights[spin] = double(neighbours[old_spin] - neighbours[spin]) + gamma * prob * double(h);
  541|  5.54M|                    if (weights[spin] < minweight) {
  ------------------
  |  Branch (541:25): [True: 914k, False: 4.63M]
  ------------------
  542|   914k|                        minweight = weights[spin];
  543|   914k|                    }
  544|  5.54M|                }
  545|  6.16M|            }   // for spin
  546|  6.78M|            for (igraph_int_t spin = 1; spin <= q; spin++) { // loop over all possibe spins
  ------------------
  |  Branch (546:41): [True: 6.16M, False: 616k]
  ------------------
  547|  6.16M|                weights[spin] -= minweight;       // subtract minweight
  548|       |                // to avoid numerical problems with large exponents
  549|  6.16M|                weights[spin] = exp(-beta * weights[spin]);
  550|  6.16M|                norm += weights[spin];
  551|  6.16M|            }   // for spin
  552|       |
  553|       |            //now choose a new spin
  554|   616k|            r = RNG_UNIF(0, norm);
  ------------------
  |  |  154|   616k|#define RNG_UNIF(l,h)    (igraph_rng_get_unif(igraph_rng_default(),(l),(h)))
  ------------------
  555|   616k|            new_spin = 1;
  556|  3.41M|            while (new_spin <= q) {
  ------------------
  |  Branch (556:20): [True: 3.41M, False: 0]
  ------------------
  557|  3.41M|                if (r <= weights[new_spin]) {
  ------------------
  |  Branch (557:21): [True: 616k, False: 2.79M]
  ------------------
  558|   616k|                    spin_opt = new_spin;
  559|   616k|                    break;
  560|  2.79M|                } else {
  561|  2.79M|                    r -= weights[new_spin];
  562|  2.79M|                }
  563|  2.79M|                new_spin++;
  564|  2.79M|            }
  565|       |            //Put new spin on list
  566|   616k|            *SPIN = spin_opt;
  567|       |
  568|   616k|            node = net_iter.Next();
  569|   616k|            SPIN = i_iter.Next();
  570|   616k|        } // while !net_iter.End()
  571|       |
  572|       |        //-------------------------------
  573|       |        //now update all spins
  574|  68.9k|        node = net_iter.First(&net->node_list);
  575|  68.9k|        SPIN = i_iter.First(&new_spins);
  576|  68.9k|        P_SPIN = i_iter2.First(&previous_spins);
  577|   685k|        while (!net_iter.End()) {
  ------------------
  |  Branch (577:16): [True: 616k, False: 68.9k]
  ------------------
  578|   616k|            old_spin = node->Get_ClusterIndex();
  579|   616k|            new_spin = *SPIN;
  580|   616k|            if (new_spin != old_spin) { // Did we really change something??
  ------------------
  |  Branch (580:17): [True: 505k, False: 110k]
  ------------------
  581|   505k|                changes++;
  582|   505k|                node->Set_ClusterIndex(new_spin);
  583|   505k|                if (new_spin != *P_SPIN) {
  ------------------
  |  Branch (583:21): [True: 425k, False: 80.0k]
  ------------------
  584|   425k|                    cyclic = false;
  585|   425k|                }
  586|   505k|                *P_SPIN = old_spin;
  587|   505k|                color_field[old_spin] -= delta;
  588|   505k|                color_field[new_spin] += delta;
  589|       |
  590|       |                //Qmatrix update
  591|       |                //iteration over all neighbours
  592|   505k|                l_cur = l_iter.First(node->Get_Links());
  593|  1.67M|                while (!l_iter.End()) {
  ------------------
  |  Branch (593:24): [True: 1.16M, False: 505k]
  ------------------
  594|  1.16M|                    w = l_cur->Get_Weight();
  595|  1.16M|                    if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (595:25): [True: 680k, False: 488k]
  ------------------
  596|   680k|                        n_cur = l_cur->Get_End();
  597|   680k|                    } else {
  598|   488k|                        n_cur = l_cur->Get_Start();
  599|   488k|                    }
  600|  1.16M|                    Qmatrix[old_spin][n_cur->Get_ClusterIndex()] -= w;
  601|  1.16M|                    Qmatrix[new_spin][n_cur->Get_ClusterIndex()] += w;
  602|  1.16M|                    Qmatrix[n_cur->Get_ClusterIndex()][old_spin] -= w;
  603|  1.16M|                    Qmatrix[n_cur->Get_ClusterIndex()][new_spin] += w;
  604|  1.16M|                    Qa[old_spin] -= w;
  605|  1.16M|                    Qa[new_spin] += w;
  606|  1.16M|                    l_cur = l_iter.Next();
  607|  1.16M|                }  // while l_iter
  608|   505k|            }
  609|   616k|            node = net_iter.Next();
  610|   616k|            SPIN = i_iter.Next();
  611|   616k|            P_SPIN = i_iter2.Next();
  612|   616k|        } // while (!net_iter.End())
  613|       |
  614|  68.9k|    }  // while markov
  615|  1.77k|    max_q = 0;
  616|  19.4k|    for (igraph_int_t i = 1; i <= q; i++) if (color_field[i] > max_q) {
  ------------------
  |  Branch (616:30): [True: 17.7k, False: 1.77k]
  |  Branch (616:47): [True: 4.75k, False: 12.9k]
  ------------------
  617|  4.75k|            max_q = igraph_int_t(color_field[i]);
  618|  4.75k|        }
  619|       |
  620|       |    //again, we would not like to end up in cyclic attractors
  621|  1.77k|    if (cyclic && changes)  {
  ------------------
  |  Branch (621:9): [True: 647, False: 1.12k]
  |  Branch (621:19): [True: 50, False: 597]
  ------------------
  622|     50|        acceptance = double(changes) / double(number_of_nodes);
  623|     50|        return 0;
  624|  1.72k|    } else {
  625|  1.72k|        acceptance = double(changes) / double(number_of_nodes);
  626|  1.72k|        return changes;
  627|  1.72k|    }
  628|  1.77k|}
_ZN10PottsModel14HeatBathLookupEdddj:
  633|   195k|double PottsModel::HeatBathLookup(double gamma, double prob, double kT, unsigned int max_sweeps) {
  634|   195k|    DLList_Iter<NLink*> l_iter;
  635|   195k|    NNode *node, *n_cur;
  636|   195k|    NLink *l_cur;
  637|   195k|    igraph_int_t new_spin, spin_opt, old_spin;
  638|   195k|    unsigned int sweep;
  639|   195k|    igraph_int_t max_q;
  640|   195k|    igraph_int_t rn;
  641|   195k|    igraph_int_t changes;
  642|   195k|    double degree, w, delta = 0, h;
  643|   195k|    double norm, r, beta, minweight, prefac = 0;
  644|   195k|    igraph_int_t number_of_nodes;
  645|   195k|    sweep = 0;
  646|   195k|    changes = 0;
  647|   195k|    number_of_nodes = net->node_list.Size();
  648|  9.94M|    while (sweep < max_sweeps) {
  ------------------
  |  Branch (648:12): [True: 9.75M, False: 195k]
  ------------------
  649|  9.75M|        sweep++;
  650|       |        //loop over all nodes in network
  651|   124M|        for (igraph_int_t n = 0; n < number_of_nodes; n++) {
  ------------------
  |  Branch (651:34): [True: 114M, False: 9.75M]
  ------------------
  652|   114M|            rn = RNG_INTEGER(0, number_of_nodes - 1);
  ------------------
  |  |  152|   114M|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  653|       |
  654|   114M|            node = net->node_list.Get(rn);
  655|       |            // initialize the neighbours and the weights
  656|  1.37G|            for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (656:38): [True: 1.25G, False: 114M]
  ------------------
  657|  1.25G|                neighbours[i] = 0.0;
  658|  1.25G|                weights[i] = 0.0;
  659|  1.25G|            }
  660|   114M|            norm = 0.0;
  661|   114M|            degree = node->Get_Weight();
  662|       |            //Loop over all links (=neighbours)
  663|   114M|            l_cur = l_iter.First(node->Get_Links());
  664|   445M|            while (!l_iter.End()) {
  ------------------
  |  Branch (664:20): [True: 330M, False: 114M]
  ------------------
  665|   330M|                w = l_cur->Get_Weight();
  666|   330M|                if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (666:21): [True: 165M, False: 165M]
  ------------------
  667|   165M|                    n_cur = l_cur->Get_End();
  668|   165M|                } else {
  669|   165M|                    n_cur = l_cur->Get_Start();
  670|   165M|                }
  671|   330M|                neighbours[n_cur->Get_ClusterIndex()] += w;
  672|   330M|                l_cur = l_iter.Next();
  673|   330M|            }
  674|       |
  675|       |            //Look for optimal spin
  676|       |
  677|   114M|            old_spin = node->Get_ClusterIndex();
  678|   114M|            switch (operation_mode) {
  679|      0|            case 0: {
  ------------------
  |  Branch (679:13): [True: 0, False: 114M]
  ------------------
  680|      0|                prefac = 1.0;
  681|      0|                delta = 1.0;
  682|      0|                break;
  683|      0|            }
  684|   114M|            case 1:  {//newman modularity
  ------------------
  |  Branch (684:13): [True: 114M, False: 0]
  ------------------
  685|   114M|                prefac = 1.0;
  686|   114M|                prob = degree / total_degree_sum;
  687|   114M|                delta = degree;
  688|   114M|                break;
  689|      0|            }
  690|      0|            default:
  ------------------
  |  Branch (690:13): [True: 0, False: 114M]
  ------------------
  691|      0|                IGRAPH_FATAL("Must not reach here.");
  ------------------
  |  |  895|      0|    do { \
  |  |  896|      0|        igraph_fatal(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  897|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (897:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  692|   114M|            }
  693|   114M|            spin_opt = old_spin;
  694|   114M|            beta = 1.0 / kT * prefac;
  695|   114M|            minweight = 0.0;
  696|   114M|            weights[old_spin] = 0.0;
  697|  1.25G|            for (igraph_int_t spin = 1; spin <= q; spin++) { // all possible new spins
  ------------------
  |  Branch (697:41): [True: 1.14G, False: 114M]
  ------------------
  698|  1.14G|                if (spin != old_spin) { // except the old one!
  ------------------
  |  Branch (698:21): [True: 1.03G, False: 114M]
  ------------------
  699|  1.03G|                    h = color_field[spin] - (color_field[old_spin] - delta);
  700|  1.03G|                    weights[spin] = neighbours[old_spin] - neighbours[spin] + gamma * prob * h;
  701|  1.03G|                    if (weights[spin] < minweight) {
  ------------------
  |  Branch (701:25): [True: 88.4M, False: 942M]
  ------------------
  702|  88.4M|                        minweight = weights[spin];
  703|  88.4M|                    }
  704|  1.03G|                }
  705|  1.14G|            }   // for spin
  706|  1.25G|            for (igraph_int_t spin = 1; spin <= q; spin++) { // all possible new spins
  ------------------
  |  Branch (706:41): [True: 1.14G, False: 114M]
  ------------------
  707|  1.14G|                weights[spin] -= minweight;       // subtract minweigt
  708|       |                // for numerical stability
  709|  1.14G|                weights[spin] = exp(-beta * weights[spin]);
  710|  1.14G|                norm += weights[spin];
  711|  1.14G|            }   // for spin
  712|       |
  713|       |
  714|       |            //choose a new spin
  715|   114M|            r = RNG_UNIF(0, norm);
  ------------------
  |  |  154|   114M|#define RNG_UNIF(l,h)    (igraph_rng_get_unif(igraph_rng_default(),(l),(h)))
  ------------------
  716|   114M|            new_spin = 1;
  717|   623M|            while (new_spin <= q) {
  ------------------
  |  Branch (717:20): [True: 623M, False: 0]
  ------------------
  718|   623M|                if (r <= weights[new_spin]) {
  ------------------
  |  Branch (718:21): [True: 114M, False: 508M]
  ------------------
  719|   114M|                    spin_opt = new_spin;
  720|   114M|                    break;
  721|   508M|                } else {
  722|   508M|                    r -= weights[new_spin];
  723|   508M|                }
  724|   508M|                new_spin++;
  725|   508M|            }
  726|       |            //-------------------------------
  727|       |            //now set the new spin
  728|   114M|            new_spin = spin_opt;
  729|   114M|            if (new_spin != old_spin) { // Did we really change something??
  ------------------
  |  Branch (729:17): [True: 53.6M, False: 60.9M]
  ------------------
  730|  53.6M|                changes++;
  731|  53.6M|                node->Set_ClusterIndex(new_spin);
  732|  53.6M|                color_field[old_spin] -= delta;
  733|  53.6M|                color_field[new_spin] += delta;
  734|       |
  735|       |                //Qmatrix update
  736|       |                //iteration over all neighbours
  737|  53.6M|                l_cur = l_iter.First(node->Get_Links());
  738|   165M|                while (!l_iter.End()) {
  ------------------
  |  Branch (738:24): [True: 111M, False: 53.6M]
  ------------------
  739|   111M|                    w = l_cur->Get_Weight();
  740|   111M|                    if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (740:25): [True: 64.0M, False: 47.3M]
  ------------------
  741|  64.0M|                        n_cur = l_cur->Get_End();
  742|  64.0M|                    } else {
  743|  47.3M|                        n_cur = l_cur->Get_Start();
  744|  47.3M|                    }
  745|   111M|                    Qmatrix[old_spin][n_cur->Get_ClusterIndex()] -= w;
  746|   111M|                    Qmatrix[new_spin][n_cur->Get_ClusterIndex()] += w;
  747|   111M|                    Qmatrix[n_cur->Get_ClusterIndex()][old_spin] -= w;
  748|   111M|                    Qmatrix[n_cur->Get_ClusterIndex()][new_spin] += w;
  749|   111M|                    Qa[old_spin] -= w;
  750|   111M|                    Qa[new_spin] += w;
  751|   111M|                    l_cur = l_iter.Next();
  752|   111M|                }  // while l_iter
  753|  53.6M|            }
  754|   114M|        } // for n
  755|  9.75M|    }  // while markov
  756|   195k|    max_q = 0;
  757|       |
  758|  2.14M|    for (igraph_int_t i = 1; i <= q; i++) if (color_field[i] > max_q) {
  ------------------
  |  Branch (758:30): [True: 1.95M, False: 195k]
  |  Branch (758:47): [True: 514k, False: 1.43M]
  ------------------
  759|   514k|            max_q = igraph_int_t(color_field[i] + 0.5);
  760|   514k|        }
  761|       |
  762|   195k|    acceptance = double(changes) / double(number_of_nodes) / double(sweep);
  763|   195k|    return acceptance;
  764|   195k|}
_ZNK10PottsModel13WriteClustersEPdS0_P19igraph_vector_int_tS2_dd:
  996|    515|                               double kT, double gamma) const {
  997|    515|    const NNode *n_cur, *n_cur2;
  998|    515|    DLList_Iter<NNode*> iter, iter2;
  999|    515|    HugeArray<int> inner_links;
 1000|    515|    HugeArray<int> outer_links;
 1001|    515|    HugeArray<int> nodes;
 1002|       |
 1003|    515|    if (temperature) {
  ------------------
  |  Branch (1003:9): [True: 0, False: 515]
  ------------------
 1004|      0|        *temperature = kT;
 1005|      0|    }
 1006|       |
 1007|    515|    if (csize || membership || modularity) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 515]
  |  Branch (1007:18): [True: 515, False: 0]
  |  Branch (1007:32): [True: 0, False: 0]
  ------------------
 1008|       |        // TODO: count the number of clusters
 1009|  5.66k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1009:37): [True: 5.15k, False: 515]
  ------------------
 1010|  5.15k|            inner_links[spin] = 0;
 1011|  5.15k|            outer_links[spin] = 0;
 1012|  5.15k|            nodes[spin] = 0;
 1013|  5.15k|            n_cur = iter.First(&net->node_list);
 1014|  56.5k|            while (!iter.End()) {
  ------------------
  |  Branch (1014:20): [True: 51.4k, False: 5.15k]
  ------------------
 1015|  51.4k|                if (n_cur->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1015:21): [True: 5.14k, False: 46.2k]
  ------------------
 1016|  5.14k|                    nodes[spin]++;
 1017|  5.14k|                    n_cur2 = iter2.First(n_cur->Get_Neighbours());
 1018|  19.7k|                    while (!iter2.End()) {
  ------------------
  |  Branch (1018:28): [True: 14.5k, False: 5.14k]
  ------------------
 1019|  14.5k|                        if (n_cur2->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1019:29): [True: 8.31k, False: 6.26k]
  ------------------
 1020|  8.31k|                            inner_links[spin]++;
 1021|  8.31k|                        } else {
 1022|  6.26k|                            outer_links[spin]++;
 1023|  6.26k|                        }
 1024|  14.5k|                        n_cur2 = iter2.Next();
 1025|  14.5k|                    }
 1026|  5.14k|                }
 1027|  51.4k|                n_cur = iter.Next();
 1028|  51.4k|            }
 1029|  5.15k|        }
 1030|    515|    }
 1031|    515|    if (modularity) {
  ------------------
  |  Branch (1031:9): [True: 515, False: 0]
  ------------------
 1032|    515|        *modularity = 0.0;
 1033|  5.66k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1033:37): [True: 5.15k, False: 515]
  ------------------
 1034|  5.15k|            if (nodes[spin] > 0) {
  ------------------
  |  Branch (1034:17): [True: 1.32k, False: 3.82k]
  ------------------
 1035|  1.32k|                double t1 = inner_links[spin] / net->sum_weights / 2.0;
 1036|  1.32k|                double t2 = (inner_links[spin] + outer_links[spin]) /
 1037|  1.32k|                            net->sum_weights / 2.0;
 1038|  1.32k|                *modularity += t1;
 1039|  1.32k|                *modularity -= gamma * t2 * t2;
 1040|  1.32k|            }
 1041|  5.15k|        }
 1042|    515|    }
 1043|    515|    if (csize) {
  ------------------
  |  Branch (1043:9): [True: 0, False: 515]
  ------------------
 1044|      0|        igraph_vector_int_clear(csize);
 1045|      0|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1045:37): [True: 0, False: 0]
  ------------------
 1046|      0|            if (nodes[spin] > 0) {
  ------------------
  |  Branch (1046:17): [True: 0, False: 0]
  ------------------
 1047|      0|                inner_links[spin] /= 2;
 1048|      0|                IGRAPH_CHECK(igraph_vector_int_push_back(csize, nodes[spin]));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1049|      0|            }
 1050|      0|        }
 1051|      0|    }
 1052|       |
 1053|       |    //die Elemente der Cluster
 1054|    515|    if (membership) {
  ------------------
  |  Branch (1054:9): [True: 515, False: 0]
  ------------------
 1055|    515|        igraph_int_t no = -1;
 1056|    515|        IGRAPH_CHECK(igraph_vector_int_resize(membership, num_of_nodes));
  ------------------
  |  |  656|    515|    do { \
  |  |  657|    515|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    515|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    515|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 515]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    515|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 515]
  |  |  ------------------
  ------------------
 1057|  5.66k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1057:37): [True: 5.15k, False: 515]
  ------------------
 1058|  5.15k|            if (nodes[spin] > 0) {
  ------------------
  |  Branch (1058:17): [True: 1.32k, False: 3.82k]
  ------------------
 1059|  1.32k|                no++;
 1060|  1.32k|            }
 1061|  5.15k|            n_cur = iter.First(&net->node_list);
 1062|  56.5k|            while (!iter.End()) {
  ------------------
  |  Branch (1062:20): [True: 51.4k, False: 5.15k]
  ------------------
 1063|  51.4k|                if (n_cur->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1063:21): [True: 5.14k, False: 46.2k]
  ------------------
 1064|  5.14k|                    VECTOR(*membership)[ n_cur->Get_Index() ] = no;
  ------------------
  |  |   60|  5.14k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1065|  5.14k|                }
 1066|  51.4k|                n_cur = iter.Next();
 1067|  51.4k|            }
 1068|  5.15k|        }
 1069|    515|    }
 1070|       |
 1071|    515|    return num_of_nodes;
 1072|    515|}

_ZN12SimpleMatrixC2Em:
   59|    515|    explicit SimpleMatrix(size_t n_) : n(n_) { data = new double[n*n]; }
_ZN12SimpleMatrixD2Ev:
   61|    515|    ~SimpleMatrix() { delete [] data; }
_ZN12SimpleMatrixixEm:
   65|   450M|    double *operator [] (size_t i) { return &(data[n*i]); }

igraph_community_voronoi:
  517|  3.54k|        igraph_neimode_t mode, igraph_real_t r) {
  518|       |
  519|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  520|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  521|  3.54k|    igraph_vector_t local_rel_dens;
  522|  3.54k|    igraph_vector_t lengths2; /* lengths2 = lengths / ecc */
  523|  3.54k|    igraph_vector_int_t imembership, igenerators;
  524|  3.54k|    igraph_vector_int_t *pmembership, *pgenerators;
  525|  3.54k|    igraph_bool_t simple;
  526|       |
  527|  3.54k|    if (! igraph_is_directed(graph)) {
  ------------------
  |  Branch (527:9): [True: 0, False: 3.54k]
  ------------------
  528|      0|        mode = IGRAPH_ALL;
  529|      0|    }
  530|       |
  531|  3.54k|    if (lengths && igraph_vector_size(lengths) != no_of_edges) {
  ------------------
  |  Branch (531:9): [True: 3.54k, False: 0]
  |  Branch (531:20): [True: 0, False: 3.54k]
  ------------------
  532|      0|        IGRAPH_ERROR("Edge length vector size does not match edge count.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  533|      0|    }
  534|       |
  535|  3.54k|    if (weights && igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (535:9): [True: 3.54k, False: 0]
  |  Branch (535:20): [True: 0, False: 3.54k]
  ------------------
  536|      0|        IGRAPH_ERROR("Edge weight vector size does not match edge count.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  537|      0|    }
  538|       |
  539|  3.54k|    IGRAPH_CHECK(igraph_is_simple(graph, &simple, mode == IGRAPH_ALL ? IGRAPH_UNDIRECTED : IGRAPH_DIRECTED));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  ------------------
  |  |  |  Branch (657:40): [True: 0, False: 3.54k]
  |  |  ------------------
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  540|  3.54k|    if (! simple) {
  ------------------
  |  Branch (540:9): [True: 0, False: 3.54k]
  ------------------
  541|      0|        IGRAPH_ERROR("The graph must be simple for Voronoi communities.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  542|      0|    }
  543|       |
  544|  3.54k|    if (no_of_edges == 0) {
  ------------------
  |  Branch (544:9): [True: 107, False: 3.43k]
  ------------------
  545|       |        /* Also handles no_of_nodes <= 1 */
  546|    107|        if (membership) {
  ------------------
  |  Branch (546:13): [True: 107, False: 0]
  ------------------
  547|    107|            IGRAPH_CHECK(igraph_vector_int_range(membership, 0, no_of_nodes));
  ------------------
  |  |  656|    107|    do { \
  |  |  657|    107|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    107|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  548|    107|        }
  549|    107|        if (generators) {
  ------------------
  |  Branch (549:13): [True: 107, False: 0]
  ------------------
  550|    107|            IGRAPH_CHECK(igraph_vector_int_range(generators, 0, no_of_nodes));
  ------------------
  |  |  656|    107|    do { \
  |  |  657|    107|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    107|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    107|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 107]
  |  |  ------------------
  ------------------
  551|    107|        }
  552|    107|        return IGRAPH_SUCCESS;
  553|    107|    }
  554|       |
  555|  3.43k|    if (! generators) {
  ------------------
  |  Branch (555:9): [True: 0, False: 3.43k]
  ------------------
  556|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&igenerators, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  557|      0|        pgenerators = &igenerators;
  558|  3.43k|    } else {
  559|  3.43k|        pgenerators = generators;
  560|  3.43k|    }
  561|       |
  562|  3.43k|    if (! membership) {
  ------------------
  |  Branch (562:9): [True: 0, False: 3.43k]
  ------------------
  563|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&imembership, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  564|      0|        pmembership = &imembership;
  565|  3.43k|    } else {
  566|  3.43k|        pmembership = membership;
  567|  3.43k|    }
  568|       |
  569|  3.43k|    if (lengths) {
  ------------------
  |  Branch (569:9): [True: 3.43k, False: 0]
  ------------------
  570|  3.43k|        igraph_real_t m = igraph_vector_min(lengths);
  571|  3.43k|        if (isnan(m)) {
  ------------------
  |  Branch (571:13): [True: 0, False: 3.43k]
  ------------------
  572|      0|            IGRAPH_ERROR("Edge lengths must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  573|      0|        }
  574|  3.43k|        if (m < 0) {
  ------------------
  |  Branch (574:13): [True: 0, False: 3.43k]
  ------------------
  575|      0|            IGRAPH_ERROR("Edge lengths must be non-negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  576|      0|        }
  577|  3.43k|    }
  578|       |
  579|  3.43k|    if (weights) {
  ------------------
  |  Branch (579:9): [True: 3.43k, False: 0]
  ------------------
  580|  3.43k|        igraph_real_t m = igraph_vector_min(weights);
  581|  3.43k|        if (isnan(m)) {
  ------------------
  |  Branch (581:13): [True: 0, False: 3.43k]
  ------------------
  582|      0|            IGRAPH_ERROR("Edge weights must not be NaN.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  583|      0|        }
  584|  3.43k|        if (m <= 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 3.43k]
  ------------------
  585|      0|            IGRAPH_ERROR("Edge weights must be positive.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  586|      0|        }
  587|  3.43k|    }
  588|       |
  589|  3.43k|    IGRAPH_VECTOR_INIT_FINALLY(&local_rel_dens, 0);
  ------------------
  |  |  104|  3.43k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.43k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  590|       |
  591|  3.43k|    IGRAPH_CHECK(weighted_local_density(graph, &local_rel_dens, weights));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  592|       |
  593|  3.43k|    IGRAPH_VECTOR_INIT_FINALLY(&lengths2, 0);
  ------------------
  |  |  104|  3.43k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.43k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  594|  3.43k|    IGRAPH_CHECK(igraph_ecc(graph, &lengths2, igraph_ess_all(IGRAPH_EDGEORDER_ID), 3, true, true));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  595|       |
  596|       |    /* Note: ECC is never NaN but it may be Inf */
  597|  60.8k|    for (igraph_int_t i=0; i < no_of_edges; i++) {
  ------------------
  |  Branch (597:28): [True: 57.3k, False: 3.43k]
  ------------------
  598|  57.3k|        VECTOR(lengths2)[i] = 1 / (VECTOR(lengths2)[i]);
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(lengths2)[i] = 1 / (VECTOR(lengths2)[i]);
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  599|  57.3k|    }
  600|  3.43k|    if (lengths) {
  ------------------
  |  Branch (600:9): [True: 3.43k, False: 0]
  ------------------
  601|  3.43k|        IGRAPH_CHECK(igraph_vector_mul(&lengths2, lengths));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  602|  3.43k|    }
  603|       |
  604|  3.43k|    if (r < 0) {
  ------------------
  |  Branch (604:9): [True: 0, False: 3.43k]
  ------------------
  605|      0|        igraph_real_t minr, maxr;
  606|       |
  607|      0|        IGRAPH_CHECK(estimate_minmax_r(graph, &local_rel_dens, &lengths2, mode, &minr, &maxr));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  608|       |
  609|      0|        get_modularity_work_t gm = {
  610|      0|                graph,
  611|      0|                &local_rel_dens,
  612|      0|                &lengths2,
  613|      0|                weights,
  614|      0|                mode,
  615|      0|                pgenerators,
  616|      0|                pmembership,
  617|      0|                /* modularity */ IGRAPH_NAN
  ------------------
  |  |  138|      0|#define IGRAPH_NAN ((double)NAN)
  ------------------
  618|      0|        };
  619|      0|        IGRAPH_CHECK(brent_opt(get_modularity, minr, maxr, &gm));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  620|      0|        if (modularity) {
  ------------------
  |  Branch (620:13): [True: 0, False: 0]
  ------------------
  621|      0|            *modularity = gm.modularity;
  622|      0|        }
  623|  3.43k|    } else {
  624|  3.43k|        IGRAPH_CHECK(choose_generators(graph, pgenerators, NULL, &local_rel_dens, &lengths2, mode, r));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  625|  3.43k|        IGRAPH_CHECK(igraph_voronoi(graph, membership, NULL, pgenerators, &lengths2, mode, IGRAPH_VORONOI_RANDOM));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  626|  3.43k|        if (modularity) {
  ------------------
  |  Branch (626:13): [True: 3.43k, False: 0]
  ------------------
  627|  3.43k|            IGRAPH_CHECK(igraph_modularity(graph, pmembership, weights, 1,
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  6.86k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  ------------------
  |  |  |  Branch (657:40): [True: 0, False: 3.43k]
  |  |  ------------------
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  628|  3.43k|                                           mode == IGRAPH_ALL ? IGRAPH_UNDIRECTED : IGRAPH_DIRECTED, modularity));
  629|  3.43k|        }
  630|  3.43k|    }
  631|       |
  632|  3.43k|    if (! generators) {
  ------------------
  |  Branch (632:9): [True: 0, False: 3.43k]
  ------------------
  633|      0|        igraph_vector_int_destroy(&igenerators);
  634|      0|        IGRAPH_FINALLY_CLEAN(1);
  635|      0|    }
  636|  3.43k|    if (! membership) {
  ------------------
  |  Branch (636:9): [True: 0, False: 3.43k]
  ------------------
  637|      0|        igraph_vector_int_destroy(&imembership);
  638|      0|        IGRAPH_FINALLY_CLEAN(1);
  639|      0|    }
  640|  3.43k|    igraph_vector_destroy(&local_rel_dens);
  641|  3.43k|    igraph_vector_destroy(&lengths2);
  642|  3.43k|    IGRAPH_FINALLY_CLEAN(2);
  643|       |
  644|  3.43k|    return IGRAPH_SUCCESS;
  645|  3.43k|}
voronoi.c:weighted_local_density:
  127|  3.43k|static igraph_error_t weighted_local_density(const igraph_t *graph, igraph_vector_t *res, const igraph_vector_t *weights) {
  128|  3.43k|    igraph_vector_t str;
  129|       |
  130|  3.43k|    IGRAPH_CHECK(igraph_i_local_relative_density(graph, res, igraph_vss_all()));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  131|       |
  132|  3.43k|    IGRAPH_VECTOR_INIT_FINALLY(&str, igraph_vcount(graph));
  ------------------
  |  |  104|  3.43k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.43k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  133|       |
  134|  3.43k|    IGRAPH_CHECK(igraph_strength(graph, &str, igraph_vss_all(), IGRAPH_ALL, IGRAPH_NO_LOOPS, weights));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  135|       |
  136|  3.43k|    IGRAPH_CHECK(igraph_vector_mul(res, &str));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  137|       |
  138|  3.43k|    igraph_vector_destroy(&str);
  139|  3.43k|    IGRAPH_FINALLY_CLEAN(1);
  140|       |
  141|  3.43k|    return IGRAPH_SUCCESS;
  142|  3.43k|}
voronoi.c:igraph_i_local_relative_density:
   45|  3.43k|static igraph_error_t igraph_i_local_relative_density(const igraph_t *graph, igraph_vector_t *res, igraph_vs_t vs) {
   46|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   47|  3.43k|    igraph_int_t vs_size;
   48|  3.43k|    igraph_vector_int_t nei_mask; /* which nodes are in the local neighbourhood? */
   49|  3.43k|    igraph_vector_int_t nei_done; /* which local nodes have already been processed? -- avoids duplicate processing in multigraphs */
   50|  3.43k|    igraph_lazy_adjlist_t al;
   51|  3.43k|    igraph_vit_t vit;
   52|       |
   53|  3.43k|    IGRAPH_CHECK(igraph_lazy_adjlist_init(graph, &al, IGRAPH_ALL, IGRAPH_LOOPS, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   54|  3.43k|    IGRAPH_FINALLY(igraph_lazy_adjlist_destroy, &al);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   55|       |
   56|  3.43k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nei_mask, no_of_nodes);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   57|  3.43k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nei_done, no_of_nodes);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   58|       |
   59|  3.43k|    IGRAPH_CHECK(igraph_vit_create(graph, vs, &vit));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   60|  3.43k|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   61|       |
   62|  3.43k|    vs_size = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|  3.43k|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
   63|       |
   64|  3.43k|    IGRAPH_CHECK(igraph_vector_resize(res, vs_size));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   65|       |
   66|   155k|    for (igraph_int_t i=0; ! IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  179|   155k|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
                  for (igraph_int_t i=0; ! IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|   151k|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
  |  Branch (66:28): [True: 151k, False: 3.43k]
  ------------------
   67|   151k|        igraph_int_t w = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|   151k|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 151k, False: 0]
  |  |  ------------------
  |  |  215|   151k|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   68|   151k|        igraph_int_t int_count = 0, ext_count = 0;
   69|       |
   70|   151k|        igraph_vector_int_t *w_neis = igraph_lazy_adjlist_get(&al, w);
  ------------------
  |  |  158|   151k|    (igraph_lazy_adjlist_has(al,no) ? ((al)->adjs[(igraph_int_t)(no)]) \
  |  |  ------------------
  |  |  |  |  133|   151k|#define igraph_lazy_adjlist_has(al,no) ((al)->adjs[(igraph_int_t)(no)] != NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:40): [True: 35.0k, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  159|   151k|                                    : (igraph_i_lazy_adjlist_get_real(al, no)))
  ------------------
   71|   151k|        IGRAPH_CHECK_OOM(w_neis, "Cannot calculate local relative density.");
  ------------------
  |  |  709|   151k|    do { \
  |  |  710|   151k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
   72|       |
   73|   151k|        igraph_int_t dw = igraph_vector_int_size(w_neis);
   74|       |
   75|       |        /* mark neighbours of w, as well as w itself */
   76|   266k|        for (igraph_int_t j=0; j < dw; ++j) {
  ------------------
  |  Branch (76:32): [True: 114k, False: 151k]
  ------------------
   77|   114k|            VECTOR(nei_mask)[ VECTOR(*w_neis)[j] ] = i + 1;
  ------------------
  |  |   60|   114k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(nei_mask)[ VECTOR(*w_neis)[j] ] = i + 1;
  ------------------
  |  |   60|   114k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   78|   114k|        }
   79|   151k|        VECTOR(nei_mask)[w] = i + 1;
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   80|       |
   81|       |        /* all incident edges of w are internal */
   82|   151k|        int_count += dw;
   83|   151k|        VECTOR(nei_done)[w] = i + 1;
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   84|       |
   85|   266k|        for (igraph_int_t j=0; j < dw; ++j) {
  ------------------
  |  Branch (85:32): [True: 114k, False: 151k]
  ------------------
   86|   114k|            igraph_int_t v = VECTOR(*w_neis)[j];
  ------------------
  |  |   60|   114k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   87|       |
   88|   114k|            if (VECTOR(nei_done)[v] == i + 1) {
  ------------------
  |  |   60|   114k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (88:17): [True: 3.09k, False: 111k]
  ------------------
   89|  3.09k|                continue;
   90|   111k|            } else {
   91|   111k|                VECTOR(nei_done)[v] = i + 1;
  ------------------
  |  |   60|   111k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   92|   111k|            }
   93|       |
   94|   111k|            igraph_vector_int_t *v_neis = igraph_lazy_adjlist_get(&al, v);
  ------------------
  |  |  158|   111k|    (igraph_lazy_adjlist_has(al,no) ? ((al)->adjs[(igraph_int_t)(no)]) \
  |  |  ------------------
  |  |  |  |  133|   111k|#define igraph_lazy_adjlist_has(al,no) ((al)->adjs[(igraph_int_t)(no)] != NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:40): [True: 76.6k, False: 35.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  159|   111k|                                    : (igraph_i_lazy_adjlist_get_real(al, no)))
  ------------------
   95|   111k|            IGRAPH_CHECK_OOM(v_neis, "Cannot calculate local relative density.");
  ------------------
  |  |  709|   111k|    do { \
  |  |  710|   111k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   111k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 111k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   111k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 111k]
  |  |  ------------------
  ------------------
   96|       |
   97|   111k|            igraph_int_t dv = igraph_vector_int_size(v_neis);
   98|       |
   99|   878k|            for (igraph_int_t k=0; k < dv; ++k) {
  ------------------
  |  Branch (99:36): [True: 767k, False: 111k]
  ------------------
  100|   767k|                igraph_int_t u = VECTOR(*v_neis)[k];
  ------------------
  |  |   60|   767k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  101|       |
  102|   767k|                if (VECTOR(nei_mask)[u] == i + 1) {
  ------------------
  |  |   60|   767k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (102:21): [True: 182k, False: 584k]
  ------------------
  103|   182k|                    int_count += 1;
  104|   584k|                } else {
  105|   584k|                    ext_count += 1;
  106|   584k|                }
  107|   767k|            }
  108|   111k|        }
  109|       |
  110|   151k|        IGRAPH_ASSERT(int_count % 2 == 0);
  ------------------
  |  |  924|   151k|    do { \
  |  |  925|   151k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  111|   151k|        int_count /= 2;
  112|       |
  113|   151k|        VECTOR(*res)[i] = int_count == 0 ? 0.0 : (igraph_real_t) int_count / (igraph_real_t) (int_count + ext_count);
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (113:27): [True: 102k, False: 48.9k]
  ------------------
  114|   151k|    }
  115|       |
  116|  3.43k|    igraph_vit_destroy(&vit);
  117|  3.43k|    igraph_vector_int_destroy(&nei_done);
  118|  3.43k|    igraph_vector_int_destroy(&nei_mask);
  119|  3.43k|    igraph_lazy_adjlist_destroy(&al);
  120|  3.43k|    IGRAPH_FINALLY_CLEAN(4);
  121|       |
  122|  3.43k|    return IGRAPH_SUCCESS;
  123|  3.43k|}
voronoi.c:choose_generators:
  161|  3.43k|        igraph_real_t r) {
  162|       |
  163|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  164|  3.43k|    igraph_vector_int_t ord;
  165|  3.43k|    igraph_bitset_t excluded;
  166|  3.43k|    igraph_int_t excluded_count;
  167|  3.43k|    igraph_inclist_t il;
  168|  3.43k|    igraph_2wheap_t q;
  169|  3.43k|    igraph_real_t radius_max;
  170|       |
  171|       |    /* ord[i] is the index of the ith largest element of local_rel_dens */
  172|  3.43k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&ord, 0);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  173|  3.43k|    IGRAPH_CHECK(igraph_vector_sort_ind(local_rel_dens, &ord, IGRAPH_DESCENDING));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  174|       |
  175|       |    /* If excluded[v] is true, then v is closer to some already chosen generator than r */
  176|  3.43k|    IGRAPH_BITSET_INIT_FINALLY(&excluded, no_of_nodes);
  ------------------
  |  |  259|  3.43k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  3.43k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  3.43k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  177|  3.43k|    excluded_count = 0;
  178|       |
  179|       |    /* The input graph is expected to be simple, but we still set IGRAPH_LOOPS,
  180|       |     * as inclist_init() performs better this way. */
  181|  3.43k|    IGRAPH_CHECK(igraph_inclist_init(graph, &il, mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  182|  3.43k|    IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  183|       |
  184|  3.43k|    IGRAPH_CHECK(igraph_2wheap_init(&q, no_of_nodes));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  185|  3.43k|    IGRAPH_FINALLY(igraph_2wheap_destroy, &q);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  186|       |
  187|  3.43k|    radius_max = -IGRAPH_INFINITY;
  ------------------
  |  |  137|  3.43k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  188|  3.43k|    igraph_vector_int_clear(generators);
  189|   151k|    for (igraph_int_t i=0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (189:28): [True: 151k, False: 0]
  ------------------
  190|   151k|        igraph_int_t g = VECTOR(ord)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  191|       |
  192|   151k|        if (IGRAPH_BIT_TEST(excluded, g)) continue;
  ------------------
  |  |  142|   151k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   151k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   151k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   151k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   151k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 19.7k, False: 131k]
  |  |  ------------------
  ------------------
  193|       |
  194|   131k|        IGRAPH_CHECK(igraph_vector_int_push_back(generators, g));
  ------------------
  |  |  656|   131k|    do { \
  |  |  657|   131k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   131k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   131k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 131k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   131k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 131k]
  |  |  ------------------
  ------------------
  195|       |
  196|   131k|        igraph_2wheap_clear(&q);
  197|   131k|        IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, g, -0.0));
  ------------------
  |  |  656|   131k|    do { \
  |  |  657|   131k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   131k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   131k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 131k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   131k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 131k]
  |  |  ------------------
  ------------------
  198|   412k|        while (!igraph_2wheap_empty(&q)) {
  ------------------
  |  Branch (198:16): [True: 281k, False: 131k]
  ------------------
  199|   281k|            igraph_int_t vid = igraph_2wheap_max_index(&q);
  200|   281k|            igraph_real_t mindist = -igraph_2wheap_deactivate_max(&q);
  201|       |
  202|       |            /* Exceeded cutoff distance, do not search further along this path. */
  203|   281k|            if (mindist > r) continue;
  ------------------
  |  Branch (203:17): [True: 36.2k, False: 245k]
  ------------------
  204|       |
  205|       |            /* Note: We cannot stop the search after hitting an excluded vertex
  206|       |             * because it is possible that another non-excluded one is reachable only
  207|       |             * through this one. */
  208|   245k|            if (! IGRAPH_BIT_TEST(excluded, vid)) {
  ------------------
  |  |  142|   245k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   245k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   245k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   245k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   245k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   245k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (208:17): [True: 151k, False: 93.4k]
  ------------------
  209|   151k|                IGRAPH_BIT_SET(excluded, vid);
  ------------------
  |  |  103|   151k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   151k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   151k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   151k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   151k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|   151k|                excluded_count++;
  211|   151k|            }
  212|       |
  213|   245k|            if (mindist > radius_max) {
  ------------------
  |  Branch (213:17): [True: 10.2k, False: 234k]
  ------------------
  214|  10.2k|                radius_max = mindist;
  215|  10.2k|            }
  216|       |
  217|   245k|            igraph_vector_int_t *inc_edges = igraph_inclist_get(&il, vid);
  ------------------
  |  |  102|   245k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  218|   245k|            igraph_int_t inc_count = igraph_vector_int_size(inc_edges);
  219|   417k|            for (igraph_int_t j=0; j < inc_count; j++) {
  ------------------
  |  Branch (219:36): [True: 172k, False: 245k]
  ------------------
  220|   172k|                igraph_int_t edge = VECTOR(*inc_edges)[j];
  ------------------
  |  |   60|   172k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  221|   172k|                igraph_real_t weight = VECTOR(*lengths)[edge];
  ------------------
  |  |   60|   172k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  222|       |
  223|       |                /* Optimization: do not follow infinite-length edges. */
  224|   172k|                if (weight == IGRAPH_INFINITY) {
  ------------------
  |  |  137|   172k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  |  Branch (224:21): [True: 0, False: 172k]
  ------------------
  225|      0|                    continue;
  226|      0|                }
  227|       |
  228|   172k|                igraph_int_t to = IGRAPH_OTHER(graph, edge, vid);
  ------------------
  |  |  146|   172k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   172k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   172k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   172k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   172k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 172k]
  |  |  ------------------
  ------------------
  229|   172k|                igraph_real_t altdist = mindist + weight;
  230|       |
  231|   172k|                if (!igraph_2wheap_has_elem(&q, to)) {
  ------------------
  |  Branch (231:21): [True: 149k, False: 22.5k]
  ------------------
  232|       |                    /* This is the first non-infinite distance */
  233|   149k|                    IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, to, -altdist));
  ------------------
  |  |  656|   149k|    do { \
  |  |  657|   149k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   149k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   149k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 149k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 149k]
  |  |  ------------------
  ------------------
  234|   149k|                } else if (igraph_2wheap_has_active(&q, to)) {
  ------------------
  |  Branch (234:28): [True: 9.73k, False: 12.8k]
  ------------------
  235|  9.73k|                    igraph_real_t curdist = -igraph_2wheap_get(&q, to);
  236|  9.73k|                    if (altdist < curdist) {
  ------------------
  |  Branch (236:25): [True: 2.13k, False: 7.60k]
  ------------------
  237|       |                        /* This is a shorter path */
  238|  2.13k|                        igraph_2wheap_modify(&q, to, -altdist);
  239|  2.13k|                    }
  240|  9.73k|                }
  241|   172k|            }
  242|   245k|        }
  243|       |
  244|       |        /* All vertices have been excluded, no need to search further. */
  245|   131k|        if (excluded_count == no_of_nodes) break;
  ------------------
  |  Branch (245:13): [True: 3.43k, False: 127k]
  ------------------
  246|   131k|    }
  247|       |
  248|  3.43k|    if (rmax) {
  ------------------
  |  Branch (248:9): [True: 0, False: 3.43k]
  ------------------
  249|      0|        *rmax = radius_max;
  250|      0|    }
  251|       |
  252|  3.43k|    igraph_2wheap_destroy(&q);
  253|  3.43k|    igraph_inclist_destroy(&il);
  254|  3.43k|    igraph_bitset_destroy(&excluded);
  255|  3.43k|    igraph_vector_int_destroy(&ord);
  256|  3.43k|    IGRAPH_FINALLY_CLEAN(4);
  257|       |
  258|  3.43k|    return IGRAPH_SUCCESS;
  259|  3.43k|}

igraph_community_walktrap:
  136|  3.54k|                              igraph_vector_int_t *membership) {
  137|       |
  138|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  139|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  140|  3.54k|    igraph_int_t comp_count;
  141|  3.54k|    igraph_matrix_int_t imerges, *pmerges = merges;
  142|  3.54k|    igraph_vector_t imodularity, *pmodularity = modularity;
  143|       |
  144|  3.54k|    if (steps <= 0) {
  ------------------
  |  Branch (144:9): [True: 0, False: 3.54k]
  ------------------
  145|      0|        IGRAPH_ERROR("Length of random walks must be positive for walktrap community detection.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  146|      0|    }
  147|       |
  148|  3.54k|    if (steps > INT_MAX) {
  ------------------
  |  Branch (148:9): [True: 0, False: 3.54k]
  ------------------
  149|      0|        IGRAPH_ERROR("Length of random walks too large for walktrap community detection.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  150|      0|    }
  151|       |
  152|  3.54k|    int length = steps;
  153|       |
  154|  3.54k|    if (weights) {
  ------------------
  |  Branch (154:9): [True: 3.54k, False: 0]
  ------------------
  155|  3.54k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.54k]
  ------------------
  156|      0|            IGRAPH_ERROR("Invalid weight vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  157|      0|        }
  158|       |
  159|  3.54k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (159:13): [True: 3.48k, False: 51]
  ------------------
  160|  3.48k|            igraph_real_t minweight = igraph_vector_min(weights);
  161|  3.48k|            if (minweight < 0) {
  ------------------
  |  Branch (161:17): [True: 0, False: 3.48k]
  ------------------
  162|      0|                IGRAPH_ERROR("Weight vector must be non-negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  163|  3.48k|            } else if (isnan(minweight)) {
  ------------------
  |  Branch (163:24): [True: 0, False: 3.48k]
  ------------------
  164|      0|                IGRAPH_ERROR("Weight vector must not contain NaN values.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  165|      0|            }
  166|  3.48k|        }
  167|  3.54k|    }
  168|       |
  169|  3.54k|    if (membership) {
  ------------------
  |  Branch (169:9): [True: 3.54k, False: 0]
  ------------------
  170|       |        /* We need both 'modularity' and 'merges' to compute 'membership'.
  171|       |         * If they were not provided by the called, we allocate these here. */
  172|       |
  173|  3.54k|        if (! modularity) {
  ------------------
  |  Branch (173:13): [True: 0, False: 3.54k]
  ------------------
  174|      0|            IGRAPH_VECTOR_INIT_FINALLY(&imodularity, 0);
  ------------------
  |  |  104|      0|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 0]
  |  |  ------------------
  ------------------
  175|      0|            pmodularity = &imodularity;
  176|      0|        }
  177|       |
  178|  3.54k|        if (! merges) {
  ------------------
  |  Branch (178:13): [True: 0, False: 3.54k]
  ------------------
  179|      0|            IGRAPH_MATRIX_INT_INIT_FINALLY(&imerges, 0, 0);
  ------------------
  |  |   67|      0|    do { IGRAPH_CHECK(igraph_matrix_int_init(m, nr, nc)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   68|      0|        IGRAPH_FINALLY(igraph_matrix_int_destroy, m); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (68:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  180|      0|            pmerges = &imerges;
  181|      0|        }
  182|  3.54k|    }
  183|       |
  184|  7.08k|    IGRAPH_HANDLE_EXCEPTIONS(
  ------------------
  |  |   30|  3.54k|    IGRAPH_HANDLE_EXCEPTIONS_BEGIN; \
  |  |  ------------------
  |  |  |  |   21|  3.54k|    try {
  |  |  ------------------
  |  |   31|   326k|    code; \
  |  |  ------------------
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.54k]
  |  |  |  Branch (31:5): [Folded, False: 3.54k]
  |  |  |  Branch (31:5): [True: 3.54k, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 0]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.54k]
  |  |  |  Branch (31:5): [Folded, False: 3.54k]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.54k]
  |  |  |  Branch (31:5): [Folded, False: 3.54k]
  |  |  |  Branch (31:5): [True: 3.54k, False: 0]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.54k]
  |  |  |  Branch (31:5): [Folded, False: 3.54k]
  |  |  |  Branch (31:5): [True: 3.54k, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 41.9k]
  |  |  |  Branch (31:5): [Folded, False: 41.9k]
  |  |  |  Branch (31:5): [True: 41.9k, False: 3.54k]
  |  |  ------------------
  |  |   32|  3.54k|    IGRAPH_HANDLE_EXCEPTIONS_END;
  |  |  ------------------
  |  |  |  |   23|  3.54k|    } \
  |  |  |  |   24|  3.54k|    catch (const std::bad_alloc &e) { IGRAPH_ERROR(e.what(), IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   25|  3.54k|    catch (const std::range_error &e) { IGRAPH_ERROR(e.what(), IGRAPH_EOVERFLOW); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   26|  3.54k|    catch (const std::exception &e) { IGRAPH_ERROR(e.what(), IGRAPH_FAILURE); /* LCOV_EXCL_LINE */ } \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   27|  3.54k|    catch (...) { IGRAPH_ERROR("Unknown exception caught.", IGRAPH_FAILURE); /* LCOV_EXCL_LINE */ }
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  7.08k|        Graph G;
  186|  7.08k|        IGRAPH_CHECK(G.convert_from_igraph(graph, weights));
  187|       |
  188|  7.08k|        if (pmerges || pmodularity) {
  189|  7.08k|            IGRAPH_CHECK(igraph_connected_components(graph, /*membership=*/ NULL, /*csize=*/ NULL,
  190|  7.08k|                                                     &comp_count, IGRAPH_WEAK));
  191|  7.08k|        }
  192|  7.08k|        if (pmerges) {
  193|  7.08k|            IGRAPH_CHECK(igraph_matrix_int_resize(pmerges, no_of_nodes - comp_count, 2));
  194|  7.08k|        }
  195|  7.08k|        if (pmodularity) {
  196|  7.08k|            IGRAPH_CHECK(igraph_vector_resize(pmodularity, no_of_nodes - comp_count + 1));
  197|  7.08k|            igraph_vector_null(pmodularity);
  198|  7.08k|        }
  199|  7.08k|        Communities C(&G, length, pmerges, pmodularity);
  200|       |
  201|  7.08k|        while (!C.H->is_empty()) {
  202|  7.08k|            IGRAPH_ALLOW_INTERRUPTION();
  203|  7.08k|            C.merge_nearest_communities();
  204|  7.08k|        }
  205|  7.08k|    );
  206|       |
  207|  7.08k|    if (membership) {
  ------------------
  |  Branch (207:9): [True: 3.54k, False: 0]
  ------------------
  208|  3.54k|        igraph_int_t m;
  209|  3.54k|        m = no_of_nodes > 0 ? igraph_vector_which_max(pmodularity) : 0;
  ------------------
  |  Branch (209:13): [True: 3.53k, False: 1]
  ------------------
  210|  3.54k|        IGRAPH_CHECK(igraph_community_to_membership(pmerges, no_of_nodes,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  211|  3.54k|                    /*steps=*/ m,
  212|  3.54k|                    membership,
  213|  3.54k|                    /*csize=*/ NULL));
  214|       |
  215|  3.54k|        if (! merges) {
  ------------------
  |  Branch (215:13): [True: 0, False: 3.54k]
  ------------------
  216|      0|            igraph_matrix_int_destroy(&imerges);
  217|      0|            IGRAPH_FINALLY_CLEAN(1);
  218|      0|        }
  219|  3.54k|        if (! modularity) {
  ------------------
  |  Branch (219:13): [True: 0, False: 3.54k]
  ------------------
  220|      0|            igraph_vector_destroy(&imodularity);
  221|      0|            IGRAPH_FINALLY_CLEAN(1);
  222|      0|        }
  223|  3.54k|    }
  224|       |
  225|       |    /* The walktrap implementation cannot work with NaN values internally,
  226|       |     * and produces 0 for the modularity of edgeless graphs. We correct
  227|       |     * this to NaN in the last step for consistency. */
  228|  3.54k|    if (modularity && no_of_edges == 0) {
  ------------------
  |  Branch (228:9): [True: 3.54k, False: 0]
  |  Branch (228:23): [True: 51, False: 3.48k]
  ------------------
  229|     51|        VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |   60|     51|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |  138|     51|#define IGRAPH_NAN ((double)NAN)
  ------------------
  230|     51|    }
  231|       |
  232|  3.54k|    return IGRAPH_SUCCESS;
  233|  7.08k|}

_ZN6igraph8walktrap8NeighborC2Ev:
   76|   295k|Neighbor::Neighbor() {
   77|   295k|    next_community1 = nullptr;
   78|   295k|    previous_community1 = nullptr;
   79|   295k|    next_community2 = nullptr;
   80|   295k|    previous_community2 = nullptr;
   81|   295k|    heap_index = -1;
   82|   295k|}
_ZN6igraph8walktrap13ProbabilitiesD2Ev:
   84|  90.8k|Probabilities::~Probabilities() {
   85|  90.8k|    delete[] P;
   86|  90.8k|    delete[] vertices;
   87|  90.8k|}
_ZN6igraph8walktrap13ProbabilitiesC2Ei:
   89|  48.9k|Probabilities::Probabilities(int community) {
   90|  48.9k|    Graph* G = C->G;
   91|  48.9k|    int nb_vertices1 = 0;
   92|  48.9k|    int nb_vertices2 = 0;
   93|       |
   94|  48.9k|    double initial_proba = 1. / static_cast<double>(C->communities[community].size);
   95|  48.9k|    int last =  C->members[C->communities[community].last_member];
   96|  97.8k|    for (int m = C->communities[community].first_member; m != last; m = C->members[m]) {
  ------------------
  |  Branch (96:58): [True: 48.9k, False: 48.9k]
  ------------------
   97|  48.9k|        tmp_vector1[m] = initial_proba;
   98|  48.9k|        vertices1[nb_vertices1++] = m;
   99|  48.9k|    }
  100|       |
  101|   195k|    for (int t = 0; t < length; t++) {
  ------------------
  |  Branch (101:21): [True: 146k, False: 48.9k]
  ------------------
  102|   146k|        current_id++;
  103|   146k|        if (nb_vertices1 > (G->nb_vertices / 2)) {
  ------------------
  |  Branch (103:13): [True: 10.0k, False: 136k]
  ------------------
  104|  10.0k|            nb_vertices2 = G->nb_vertices;
  105|   401k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (105:29): [True: 391k, False: 10.0k]
  ------------------
  106|   391k|                tmp_vector2[i] = 0.;
  107|   391k|            }
  108|  10.0k|            if (nb_vertices1 == G->nb_vertices) {
  ------------------
  |  Branch (108:17): [True: 2.73k, False: 7.28k]
  ------------------
  109|  38.0k|                for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (109:33): [True: 35.3k, False: 2.73k]
  ------------------
  110|  35.3k|                    double proba = tmp_vector1[i] / G->vertices[i].total_weight;
  111|   152k|                    for (int j = 0; j < G->vertices[i].degree; j++) {
  ------------------
  |  Branch (111:37): [True: 117k, False: 35.3k]
  ------------------
  112|   117k|                        tmp_vector2[G->vertices[i].edges[j].neighbor] += proba * G->vertices[i].edges[j].weight;
  113|   117k|                    }
  114|  35.3k|                }
  115|  7.28k|            } else {
  116|   255k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (116:33): [True: 248k, False: 7.28k]
  ------------------
  117|   248k|                    int v1 = vertices1[i];
  118|   248k|                    double proba = tmp_vector1[v1] / G->vertices[v1].total_weight;
  119|  1.42M|                    for (int j = 0; j < G->vertices[v1].degree; j++) {
  ------------------
  |  Branch (119:37): [True: 1.17M, False: 248k]
  ------------------
  120|  1.17M|                        tmp_vector2[G->vertices[v1].edges[j].neighbor] += proba * G->vertices[v1].edges[j].weight;
  121|  1.17M|                    }
  122|   248k|                }
  123|  7.28k|            }
  124|   136k|        } else {
  125|   136k|            nb_vertices2 = 0;
  126|   725k|            for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (126:29): [True: 589k, False: 136k]
  ------------------
  127|   589k|                int v1 = vertices1[i];
  128|   589k|                double proba = tmp_vector1[v1] / G->vertices[v1].total_weight;
  129|  3.33M|                for (int j = 0; j < G->vertices[v1].degree; j++) {
  ------------------
  |  Branch (129:33): [True: 2.74M, False: 589k]
  ------------------
  130|  2.74M|                    int v2 = G->vertices[v1].edges[j].neighbor;
  131|  2.74M|                    if (id[v2] == current_id) {
  ------------------
  |  Branch (131:25): [True: 1.33M, False: 1.40M]
  ------------------
  132|  1.33M|                        tmp_vector2[v2] += proba * G->vertices[v1].edges[j].weight;
  133|  1.40M|                    } else {
  134|  1.40M|                        tmp_vector2[v2] = proba * G->vertices[v1].edges[j].weight;
  135|  1.40M|                        id[v2] = current_id;
  136|  1.40M|                        vertices2[nb_vertices2++] = v2;
  137|  1.40M|                    }
  138|  2.74M|                }
  139|   589k|            }
  140|   136k|        }
  141|   146k|        double* tmp = tmp_vector2;
  142|   146k|        tmp_vector2 = tmp_vector1;
  143|   146k|        tmp_vector1 = tmp;
  144|       |
  145|   146k|        int* tmp2 = vertices2;
  146|   146k|        vertices2 = vertices1;
  147|   146k|        vertices1 = tmp2;
  148|       |
  149|   146k|        nb_vertices1 = nb_vertices2;
  150|   146k|    }
  151|       |
  152|  48.9k|    if (nb_vertices1 > (G->nb_vertices / 2)) {
  ------------------
  |  Branch (152:9): [True: 13.9k, False: 34.9k]
  ------------------
  153|  13.9k|        P = new double[G->nb_vertices];
  154|  13.9k|        size = G->nb_vertices;
  155|  13.9k|        vertices = nullptr;
  156|  13.9k|        if (nb_vertices1 == G->nb_vertices) {
  ------------------
  |  Branch (156:13): [True: 8.56k, False: 5.42k]
  ------------------
  157|   387k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (157:29): [True: 379k, False: 8.56k]
  ------------------
  158|   379k|                P[i] = tmp_vector1[i] / sqrt(G->vertices[i].total_weight);
  159|   379k|            }
  160|  8.56k|        } else {
  161|   322k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (161:29): [True: 316k, False: 5.42k]
  ------------------
  162|   316k|                P[i] = 0.;
  163|   316k|            }
  164|   215k|            for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (164:29): [True: 210k, False: 5.42k]
  ------------------
  165|   210k|                P[vertices1[i]] = tmp_vector1[vertices1[i]] / sqrt(G->vertices[vertices1[i]].total_weight);
  166|   210k|            }
  167|  5.42k|        }
  168|  34.9k|    } else {
  169|  34.9k|        P = new double[nb_vertices1];
  170|  34.9k|        size = nb_vertices1;
  171|  34.9k|        vertices = new int[nb_vertices1];
  172|  34.9k|        int j = 0;
  173|  2.05M|        for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (173:25): [True: 2.01M, False: 34.9k]
  ------------------
  174|  2.01M|            if (id[i] == current_id) {
  ------------------
  |  Branch (174:17): [True: 387k, False: 1.62M]
  ------------------
  175|   387k|                P[j] = tmp_vector1[i] / sqrt(G->vertices[i].total_weight);
  176|   387k|                vertices[j] = i;
  177|   387k|                j++;
  178|   387k|            }
  179|  2.01M|        }
  180|  34.9k|    }
  181|  48.9k|}
_ZN6igraph8walktrap13ProbabilitiesC2Eii:
  183|  41.9k|Probabilities::Probabilities(int community1, int community2) {
  184|       |    // The two following probability vectors must exist.
  185|       |    // Do not call this function if it is not the case.
  186|  41.9k|    Probabilities* P1 = C->communities[community1].P;
  187|  41.9k|    Probabilities* P2 = C->communities[community2].P;
  188|       |
  189|  41.9k|    double w1 = C->communities[community1].size / static_cast<double>(C->communities[community1].size + C->communities[community2].size);
  190|  41.9k|    double w2 = C->communities[community2].size / static_cast<double>(C->communities[community1].size + C->communities[community2].size);
  191|       |
  192|       |
  193|  41.9k|    if (P1->size == C->G->nb_vertices) {
  ------------------
  |  Branch (193:9): [True: 13.7k, False: 28.1k]
  ------------------
  194|  13.7k|        P = new double[C->G->nb_vertices];
  195|  13.7k|        size = C->G->nb_vertices;
  196|  13.7k|        vertices = nullptr;
  197|       |
  198|  13.7k|        if (P2->size == C->G->nb_vertices) { // two full vectors
  ------------------
  |  Branch (198:13): [True: 13.1k, False: 667]
  ------------------
  199|   692k|            for (int i = 0; i < C->G->nb_vertices; i++) {
  ------------------
  |  Branch (199:29): [True: 679k, False: 13.1k]
  ------------------
  200|   679k|                P[i] = P1->P[i] * w1 + P2->P[i] * w2;
  201|   679k|            }
  202|  13.1k|        } else { // P1 full vector, P2 partial vector
  203|    667|            int j = 0;
  204|  13.6k|            for (int i = 0; i < P2->size; i++) {
  ------------------
  |  Branch (204:29): [True: 12.9k, False: 667]
  ------------------
  205|  32.8k|                for (; j < P2->vertices[i]; j++) {
  ------------------
  |  Branch (205:24): [True: 19.9k, False: 12.9k]
  ------------------
  206|  19.9k|                    P[j] = P1->P[j] * w1;
  207|  19.9k|                }
  208|  12.9k|                P[j] = P1->P[j] * w1 + P2->P[i] * w2;
  209|  12.9k|                j++;
  210|  12.9k|            }
  211|  2.52k|            for (; j < C->G->nb_vertices; j++) {
  ------------------
  |  Branch (211:20): [True: 1.85k, False: 667]
  ------------------
  212|  1.85k|                P[j] = P1->P[j] * w1;
  213|  1.85k|            }
  214|    667|        }
  215|  28.1k|    } else {
  216|  28.1k|        if (P2->size == C->G->nb_vertices) { // P1 partial vector, P2 full vector
  ------------------
  |  Branch (216:13): [True: 3.09k, False: 25.0k]
  ------------------
  217|  3.09k|            P = new double[C->G->nb_vertices];
  218|  3.09k|            size = C->G->nb_vertices;
  219|  3.09k|            vertices = nullptr;
  220|       |
  221|  3.09k|            int j = 0;
  222|  67.6k|            for (int i = 0; i < P1->size; i++) {
  ------------------
  |  Branch (222:29): [True: 64.5k, False: 3.09k]
  ------------------
  223|   168k|                for (; j < P1->vertices[i]; j++) {
  ------------------
  |  Branch (223:24): [True: 103k, False: 64.5k]
  ------------------
  224|   103k|                    P[j] = P2->P[j] * w2;
  225|   103k|                }
  226|  64.5k|                P[j] = P1->P[i] * w1 + P2->P[j] * w2;
  227|  64.5k|                j++;
  228|  64.5k|            }
  229|  12.2k|            for (; j < C->G->nb_vertices; j++) {
  ------------------
  |  Branch (229:20): [True: 9.10k, False: 3.09k]
  ------------------
  230|  9.10k|                P[j] = P2->P[j] * w2;
  231|  9.10k|            }
  232|  25.0k|        } else { // two partial vectors
  233|  25.0k|            int i = 0;
  234|  25.0k|            int j = 0;
  235|  25.0k|            int nb_vertices1 = 0;
  236|   342k|            while ((i < P1->size) && (j < P2->size)) {
  ------------------
  |  Branch (236:20): [True: 318k, False: 24.1k]
  |  Branch (236:38): [True: 317k, False: 953]
  ------------------
  237|   317k|                if (P1->vertices[i] < P2->vertices[j]) {
  ------------------
  |  Branch (237:21): [True: 12.4k, False: 305k]
  ------------------
  238|  12.4k|                    tmp_vector1[P1->vertices[i]] = P1->P[i] * w1;
  239|  12.4k|                    vertices1[nb_vertices1++] = P1->vertices[i];
  240|  12.4k|                    i++;
  241|  12.4k|                    continue;
  242|  12.4k|                }
  243|   305k|                if (P1->vertices[i] > P2->vertices[j]) {
  ------------------
  |  Branch (243:21): [True: 29.9k, False: 275k]
  ------------------
  244|  29.9k|                    tmp_vector1[P2->vertices[j]] = P2->P[j] * w2;
  245|  29.9k|                    vertices1[nb_vertices1++] = P2->vertices[j];
  246|  29.9k|                    j++;
  247|  29.9k|                    continue;
  248|  29.9k|                }
  249|   275k|                tmp_vector1[P1->vertices[i]] = P1->P[i] * w1 + P2->P[j] * w2;
  250|   275k|                vertices1[nb_vertices1++] = P1->vertices[i];
  251|   275k|                i++;
  252|   275k|                j++;
  253|   275k|            }
  254|  25.0k|            if (i == P1->size) {
  ------------------
  |  Branch (254:17): [True: 24.1k, False: 953]
  ------------------
  255|  28.1k|                for (; j < P2->size; j++) {
  ------------------
  |  Branch (255:24): [True: 4.06k, False: 24.1k]
  ------------------
  256|  4.06k|                    tmp_vector1[P2->vertices[j]] = P2->P[j] * w2;
  257|  4.06k|                    vertices1[nb_vertices1++] = P2->vertices[j];
  258|  4.06k|                }
  259|  24.1k|            } else {
  260|  2.58k|                for (; i < P1->size; i++) {
  ------------------
  |  Branch (260:24): [True: 1.63k, False: 953]
  ------------------
  261|  1.63k|                    tmp_vector1[P1->vertices[i]] = P1->P[i] * w1;
  262|  1.63k|                    vertices1[nb_vertices1++] = P1->vertices[i];
  263|  1.63k|                }
  264|    953|            }
  265|       |
  266|  25.0k|            if (nb_vertices1 > (C->G->nb_vertices / 2)) {
  ------------------
  |  Branch (266:17): [True: 185, False: 24.8k]
  ------------------
  267|    185|                P = new double[C->G->nb_vertices];
  268|    185|                size = C->G->nb_vertices;
  269|    185|                vertices = nullptr;
  270|  11.1k|                for (int i = 0; i < C->G->nb_vertices; i++) {
  ------------------
  |  Branch (270:33): [True: 10.9k, False: 185]
  ------------------
  271|  10.9k|                    P[i] = 0.;
  272|  10.9k|                }
  273|  6.02k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (273:33): [True: 5.84k, False: 185]
  ------------------
  274|  5.84k|                    P[vertices1[i]] = tmp_vector1[vertices1[i]];
  275|  5.84k|                }
  276|  24.8k|            } else {
  277|  24.8k|                P = new double[nb_vertices1];
  278|  24.8k|                size = nb_vertices1;
  279|  24.8k|                vertices = new int[nb_vertices1];
  280|   342k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (280:33): [True: 317k, False: 24.8k]
  ------------------
  281|   317k|                    vertices[i] = vertices1[i];
  282|   317k|                    P[i] = tmp_vector1[vertices1[i]];
  283|   317k|                }
  284|  24.8k|            }
  285|  25.0k|        }
  286|  28.1k|    }
  287|  41.9k|}
_ZNK6igraph8walktrap13Probabilities16compute_distanceEPKS1_:
  289|   139k|double Probabilities::compute_distance(const Probabilities* P2) const {
  290|   139k|    double r = 0.0;
  291|   139k|    if (vertices) {
  ------------------
  |  Branch (291:9): [True: 78.0k, False: 61.6k]
  ------------------
  292|  78.0k|        if (P2->vertices) { // two partial vectors
  ------------------
  |  Branch (292:13): [True: 68.7k, False: 9.34k]
  ------------------
  293|  68.7k|            int i = 0;
  294|  68.7k|            int j = 0;
  295|  1.14M|            while ((i < size) && (j < P2->size)) {
  ------------------
  |  Branch (295:20): [True: 1.08M, False: 66.0k]
  |  Branch (295:34): [True: 1.07M, False: 2.70k]
  ------------------
  296|  1.07M|                if (vertices[i] < P2->vertices[j]) {
  ------------------
  |  Branch (296:21): [True: 36.9k, False: 1.04M]
  ------------------
  297|  36.9k|                    r += P[i] * P[i];
  298|  36.9k|                    i++;
  299|  36.9k|                    continue;
  300|  36.9k|                }
  301|  1.04M|                if (vertices[i] > P2->vertices[j]) {
  ------------------
  |  Branch (301:21): [True: 68.7k, False: 974k]
  ------------------
  302|  68.7k|                    r += P2->P[j] * P2->P[j];
  303|  68.7k|                    j++;
  304|  68.7k|                    continue;
  305|  68.7k|                }
  306|   974k|                r += (P[i] - P2->P[j]) * (P[i] - P2->P[j]);
  307|   974k|                i++;
  308|   974k|                j++;
  309|   974k|            }
  310|  68.7k|            if (i == size) {
  ------------------
  |  Branch (310:17): [True: 66.0k, False: 2.70k]
  ------------------
  311|  75.2k|                for (; j < P2->size; j++) {
  ------------------
  |  Branch (311:24): [True: 9.28k, False: 66.0k]
  ------------------
  312|  9.28k|                    r += P2->P[j] * P2->P[j];
  313|  9.28k|                }
  314|  66.0k|            } else {
  315|  7.09k|                for (; i < size; i++) {
  ------------------
  |  Branch (315:24): [True: 4.39k, False: 2.70k]
  ------------------
  316|  4.39k|                    r += P[i] * P[i];
  317|  4.39k|                }
  318|  2.70k|            }
  319|  68.7k|        } else { // P1 partial vector, P2 full vector
  320|       |
  321|  9.34k|            int i = 0;
  322|   220k|            for (int j = 0; j < size; j++) {
  ------------------
  |  Branch (322:29): [True: 211k, False: 9.34k]
  ------------------
  323|   523k|                for (; i < vertices[j]; i++) {
  ------------------
  |  Branch (323:24): [True: 312k, False: 211k]
  ------------------
  324|   312k|                    r += P2->P[i] * P2->P[i];
  325|   312k|                }
  326|   211k|                r += (P[j] - P2->P[i]) * (P[j] - P2->P[i]);
  327|   211k|                i++;
  328|   211k|            }
  329|  33.0k|            for (; i < P2->size; i++) {
  ------------------
  |  Branch (329:20): [True: 23.7k, False: 9.34k]
  ------------------
  330|  23.7k|                r += P2->P[i] * P2->P[i];
  331|  23.7k|            }
  332|  9.34k|        }
  333|  78.0k|    } else {
  334|  61.6k|        if (P2->vertices) { // P1 full vector, P2 partial vector
  ------------------
  |  Branch (334:13): [True: 2.85k, False: 58.7k]
  ------------------
  335|  2.85k|            int i = 0;
  336|  68.8k|            for (int j = 0; j < P2->size; j++) {
  ------------------
  |  Branch (336:29): [True: 65.9k, False: 2.85k]
  ------------------
  337|   152k|                for (; i < P2->vertices[j]; i++) {
  ------------------
  |  Branch (337:24): [True: 86.8k, False: 65.9k]
  ------------------
  338|  86.8k|                    r += P[i] * P[i];
  339|  86.8k|                }
  340|  65.9k|                r += (P[i] - P2->P[j]) * (P[i] - P2->P[j]);
  341|  65.9k|                i++;
  342|  65.9k|            }
  343|  9.69k|            for (; i < size; i++) {
  ------------------
  |  Branch (343:20): [True: 6.83k, False: 2.85k]
  ------------------
  344|  6.83k|                r += P[i] * P[i];
  345|  6.83k|            }
  346|  58.7k|        } else { // two full vectors
  347|  3.42M|            for (int i = 0; i < size; i++) {
  ------------------
  |  Branch (347:29): [True: 3.37M, False: 58.7k]
  ------------------
  348|  3.37M|                r += (P[i] - P2->P[i]) * (P[i] - P2->P[i]);
  349|  3.37M|            }
  350|  58.7k|        }
  351|  61.6k|    }
  352|   139k|    return r;
  353|   139k|}
_ZN6igraph8walktrap9CommunityC2Ev:
  355|   309k|Community::Community() {
  356|   309k|    P = nullptr;
  357|   309k|    first_neighbor = nullptr;
  358|   309k|    last_neighbor = nullptr;
  359|   309k|    sub_community_of = -1;
  360|   309k|    sub_communities[0] = -1;
  361|   309k|    sub_communities[1] = -1;
  362|   309k|    sigma = 0.;
  363|   309k|    internal_weight = 0.;
  364|   309k|    total_weight = 0.;
  365|   309k|}
_ZN6igraph8walktrap9CommunityD2Ev:
  367|   309k|Community::~Community() {
  368|   309k|    delete P;
  369|   309k|}
_ZN6igraph8walktrap11CommunitiesC2EPNS0_5GraphEiP19igraph_matrix_int_tP15igraph_vector_t:
  374|  3.54k|                         igraph_vector_t *pmodularity) {
  375|  3.54k|    G = graph;
  376|  3.54k|    merges = pmerges;
  377|  3.54k|    mergeidx = 0;
  378|  3.54k|    modularity = pmodularity;
  379|       |
  380|  3.54k|    Probabilities::C = this;
  381|  3.54k|    Probabilities::length = random_walks_length;
  382|  3.54k|    Probabilities::tmp_vector1 = new double[G->nb_vertices];
  383|  3.54k|    Probabilities::tmp_vector2 = new double[G->nb_vertices];
  384|  3.54k|    Probabilities::id = new int[G->nb_vertices];
  385|   158k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (385:21): [True: 154k, False: 3.54k]
  ------------------
  386|   154k|        Probabilities::id[i] = 0;
  387|   154k|    }
  388|  3.54k|    Probabilities::vertices1 = new int[G->nb_vertices];
  389|  3.54k|    Probabilities::vertices2 = new int[G->nb_vertices];
  390|  3.54k|    Probabilities::current_id = 0;
  391|       |
  392|  3.54k|    members = new int[G->nb_vertices];
  393|   158k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (393:21): [True: 154k, False: 3.54k]
  ------------------
  394|   154k|        members[i] = -1;
  395|   154k|    }
  396|       |
  397|  3.54k|    H = new Neighbor_heap(G->nb_edges);
  398|  3.54k|    IGRAPH_ASSUME(G->nb_vertices >= 0); // avoid false-positive GCC warnings
  ------------------
  |  |   56|  3.54k|#    define IGRAPH_ASSUME(expr) __builtin_assume(expr)
  ------------------
  399|  3.54k|    communities = new Community[2 * G->nb_vertices];
  400|       |
  401|       |    // init the n single vertex communities
  402|       |
  403|   158k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (403:21): [True: 154k, False: 3.54k]
  ------------------
  404|   154k|        communities[i].this_community = i;
  405|   154k|        communities[i].first_member = i;
  406|   154k|        communities[i].last_member = i;
  407|   154k|        communities[i].size = 1;
  408|   154k|        communities[i].sub_community_of = 0;
  409|   154k|    }
  410|       |
  411|  3.54k|    nb_communities = G->nb_vertices;
  412|  3.54k|    nb_active_communities = G->nb_vertices;
  413|       |
  414|   158k|    for (int i = 0; i < G->nb_vertices; i++)
  ------------------
  |  Branch (414:21): [True: 154k, False: 3.54k]
  ------------------
  415|   421k|        for (int j = 0; j < G->vertices[i].degree; j++)
  ------------------
  |  Branch (415:25): [True: 266k, False: 154k]
  ------------------
  416|   266k|            if (i < G->vertices[i].edges[j].neighbor) {
  ------------------
  |  Branch (416:17): [True: 55.8k, False: 210k]
  ------------------
  417|  55.8k|                communities[i].total_weight += G->vertices[i].edges[j].weight / 2.;
  418|  55.8k|                communities[G->vertices[i].edges[j].neighbor].total_weight += G->vertices[i].edges[j].weight / 2.;
  419|  55.8k|                Neighbor* N = new Neighbor;
  420|  55.8k|                N->community1 = i;
  421|  55.8k|                N->community2 = G->vertices[i].edges[j].neighbor;
  422|  55.8k|                N->delta_sigma = -1. / double(min(G->vertices[i].degree,  G->vertices[G->vertices[i].edges[j].neighbor].degree));
  423|  55.8k|                N->weight = G->vertices[i].edges[j].weight;
  424|  55.8k|                N->exact = false;
  425|  55.8k|                add_neighbor(N);
  426|  55.8k|            }
  427|       |
  428|       |    /*   int c = 0; */
  429|  3.54k|    Neighbor* N = H->get_first();
  430|  3.54k|    if (N == nullptr) {
  ------------------
  |  Branch (430:9): [True: 107, False: 3.43k]
  ------------------
  431|    107|        return;    /* this can happen if there are no edges */
  432|    107|    }
  433|  59.2k|    while (!N->exact) {
  ------------------
  |  Branch (433:12): [True: 55.8k, False: 3.43k]
  ------------------
  434|  55.8k|        update_neighbor(N, compute_delta_sigma(N->community1, N->community2));
  435|  55.8k|        N->exact = true;
  436|  55.8k|        N = H->get_first();
  437|       |        /* TODO: this could use igraph_progress */
  438|       |        /*     if(!silent) { */
  439|       |        /*       c++; */
  440|       |        /*       for(int k = (500*(c-1))/G->nb_edges + 1; k <= (500*c)/G->nb_edges; k++) { */
  441|       |        /*  if(k % 50 == 1) {cerr.width(2); cerr << endl << k/ 5 << "% ";} */
  442|       |        /*  cerr << "."; */
  443|       |        /*       } */
  444|       |        /*     } */
  445|  55.8k|    }
  446|       |
  447|  3.43k|    if (modularity) {
  ------------------
  |  Branch (447:9): [True: 3.43k, False: 0]
  ------------------
  448|  3.43k|        double Q = 0.0;
  449|   155k|        for (int i = 0; i < nb_communities; i++) {
  ------------------
  |  Branch (449:25): [True: 151k, False: 3.43k]
  ------------------
  450|   151k|            if (communities[i].sub_community_of == 0) {
  ------------------
  |  Branch (450:17): [True: 151k, False: 0]
  ------------------
  451|   151k|                Q += (communities[i].internal_weight - communities[i].total_weight * communities[i].total_weight / G->total_weight);
  452|   151k|            }
  453|   151k|        }
  454|  3.43k|        Q /= G->total_weight;
  455|  3.43k|        VECTOR(*modularity)[mergeidx] = Q;
  ------------------
  |  |   60|  3.43k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  456|  3.43k|    }
  457|  3.43k|}
_ZN6igraph8walktrap11CommunitiesD2Ev:
  459|  3.54k|Communities::~Communities() {
  460|  3.54k|    delete[] members;
  461|  3.54k|    delete[] communities;
  462|  3.54k|    delete H;
  463|       |
  464|  3.54k|    delete[] Probabilities::tmp_vector1;
  465|  3.54k|    delete[] Probabilities::tmp_vector2;
  466|  3.54k|    delete[] Probabilities::id;
  467|  3.54k|    delete[] Probabilities::vertices1;
  468|  3.54k|    delete[] Probabilities::vertices2;
  469|  3.54k|}
_ZN6igraph8walktrap9Community12add_neighborEPNS0_8NeighborE:
  471|   591k|void Community::add_neighbor(Neighbor* N) { // add a new neighbor at the end of the list
  472|   591k|    if (last_neighbor) {
  ------------------
  |  Branch (472:9): [True: 352k, False: 239k]
  ------------------
  473|   352k|        if (last_neighbor->community1 == this_community) {
  ------------------
  |  Branch (473:13): [True: 92.0k, False: 260k]
  ------------------
  474|  92.0k|            last_neighbor->next_community1 = N;
  475|   260k|        } else {
  476|   260k|            last_neighbor->next_community2 = N;
  477|   260k|        }
  478|       |
  479|   352k|        if (N->community1 == this_community) {
  ------------------
  |  Branch (479:13): [True: 126k, False: 225k]
  ------------------
  480|   126k|            N->previous_community1 = last_neighbor;
  481|   225k|        } else {
  482|   225k|            N->previous_community2 = last_neighbor;
  483|   225k|        }
  484|   352k|    } else {
  485|   239k|        first_neighbor = N;
  486|   239k|        if (N->community1 == this_community) {
  ------------------
  |  Branch (486:13): [True: 169k, False: 69.9k]
  ------------------
  487|   169k|            N->previous_community1 = nullptr;
  488|   169k|        } else {
  489|  69.9k|            N->previous_community2 = nullptr;
  490|  69.9k|        }
  491|   239k|    }
  492|   591k|    last_neighbor = N;
  493|   591k|}
_ZN6igraph8walktrap9Community15remove_neighborEPNS0_8NeighborE:
  495|   591k|void Community::remove_neighbor(Neighbor* N) {  // remove a neighbor from the list
  496|   591k|    if (N->community1 == this_community) {
  ------------------
  |  Branch (496:9): [True: 295k, False: 295k]
  ------------------
  497|   295k|        if (N->next_community1) {
  ------------------
  |  Branch (497:13): [True: 71.2k, False: 224k]
  ------------------
  498|       |//      if (N->next_community1->community1 == this_community)
  499|  71.2k|            N->next_community1->previous_community1 = N->previous_community1;
  500|       |//      else
  501|       |//  N->next_community1->previous_community2 = N->previous_community1;
  502|   224k|        } else {
  503|   224k|            last_neighbor = N->previous_community1;
  504|   224k|        }
  505|   295k|        if (N->previous_community1) {
  ------------------
  |  Branch (505:13): [True: 57.6k, False: 238k]
  ------------------
  506|  57.6k|            if (N->previous_community1->community1 == this_community) {
  ------------------
  |  Branch (506:17): [True: 36.4k, False: 21.1k]
  ------------------
  507|  36.4k|                N->previous_community1->next_community1 = N->next_community1;
  508|  36.4k|            } else {
  509|  21.1k|                N->previous_community1->next_community2 = N->next_community1;
  510|  21.1k|            }
  511|   238k|        } else {
  512|   238k|            first_neighbor = N->next_community1;
  513|   238k|        }
  514|   295k|    } else {
  515|   295k|        if (N->next_community2) {
  ------------------
  |  Branch (515:13): [True: 237k, False: 57.9k]
  ------------------
  516|   237k|            if (N->next_community2->community1 == this_community) {
  ------------------
  |  Branch (516:17): [True: 29.1k, False: 208k]
  ------------------
  517|  29.1k|                N->next_community2->previous_community1 = N->previous_community2;
  518|   208k|            } else {
  519|   208k|                N->next_community2->previous_community2 = N->previous_community2;
  520|   208k|            }
  521|   237k|        } else {
  522|  57.9k|            last_neighbor = N->previous_community2;
  523|  57.9k|        }
  524|   295k|        if (N->previous_community2) {
  ------------------
  |  Branch (524:13): [True: 49.4k, False: 246k]
  ------------------
  525|       |//      if (N->previous_community2->community1 == this_community)
  526|       |//  N->previous_community2->next_community1 = N->next_community2;
  527|       |//      else
  528|  49.4k|            N->previous_community2->next_community2 = N->next_community2;
  529|   246k|        } else {
  530|   246k|            first_neighbor = N->next_community2;
  531|   246k|        }
  532|   295k|    }
  533|   591k|}
_ZN6igraph8walktrap11Communities15remove_neighborEPNS0_8NeighborE:
  535|   295k|void Communities::remove_neighbor(Neighbor* N) {
  536|   295k|    communities[N->community1].remove_neighbor(N);
  537|   295k|    communities[N->community2].remove_neighbor(N);
  538|   295k|    H->remove(N);
  539|   295k|}
_ZN6igraph8walktrap11Communities12add_neighborEPNS0_8NeighborE:
  541|   295k|void Communities::add_neighbor(Neighbor* N) {
  542|   295k|    communities[N->community1].add_neighbor(N);
  543|   295k|    communities[N->community2].add_neighbor(N);
  544|   295k|    H->add(N);
  545|   295k|}
_ZN6igraph8walktrap11Communities15update_neighborEPNS0_8NeighborEd:
  547|   139k|void Communities::update_neighbor(Neighbor* N, double new_delta_sigma) {
  548|   139k|    N->delta_sigma = new_delta_sigma;
  549|   139k|    H->update(N);
  550|   139k|}
_ZN6igraph8walktrap11Communities17merge_communitiesEPNS0_8NeighborE:
  552|  41.9k|void Communities::merge_communities(Neighbor* merge_N) {
  553|  41.9k|    int c1 = merge_N->community1;
  554|  41.9k|    int c2 = merge_N->community2;
  555|       |
  556|  41.9k|    communities[nb_communities].first_member = communities[c1].first_member;  // merge the
  557|  41.9k|    communities[nb_communities].last_member = communities[c2].last_member;    // two lists
  558|  41.9k|    members[communities[c1].last_member] = communities[c2].first_member;      // of members
  559|       |
  560|  41.9k|    communities[nb_communities].size = communities[c1].size + communities[c2].size;
  561|  41.9k|    communities[nb_communities].this_community = nb_communities;
  562|  41.9k|    communities[nb_communities].sub_community_of = 0;
  563|  41.9k|    communities[nb_communities].sub_communities[0] = c1;
  564|  41.9k|    communities[nb_communities].sub_communities[1] = c2;
  565|  41.9k|    communities[nb_communities].total_weight = communities[c1].total_weight + communities[c2].total_weight;
  566|  41.9k|    communities[nb_communities].internal_weight = communities[c1].internal_weight + communities[c2].internal_weight + merge_N->weight;
  567|  41.9k|    communities[nb_communities].sigma = communities[c1].sigma + communities[c2].sigma + merge_N->delta_sigma;
  568|       |
  569|  41.9k|    communities[c1].sub_community_of = nb_communities;
  570|  41.9k|    communities[c2].sub_community_of = nb_communities;
  571|       |
  572|       |// update the new probability vector...
  573|       |
  574|  41.9k|    if (communities[c1].P && communities[c2].P) {
  ------------------
  |  Branch (574:9): [True: 41.9k, False: 0]
  |  Branch (574:30): [True: 41.9k, False: 0]
  ------------------
  575|  41.9k|        communities[nb_communities].P = new Probabilities(c1, c2);
  576|  41.9k|    }
  577|       |
  578|  41.9k|    if (communities[c1].P) {
  ------------------
  |  Branch (578:9): [True: 41.9k, False: 0]
  ------------------
  579|  41.9k|        delete communities[c1].P;
  580|  41.9k|        communities[c1].P = nullptr;
  581|  41.9k|    }
  582|  41.9k|    if (communities[c2].P) {
  ------------------
  |  Branch (582:9): [True: 41.9k, False: 0]
  ------------------
  583|  41.9k|        delete communities[c2].P;
  584|  41.9k|        communities[c2].P = nullptr;
  585|  41.9k|    }
  586|       |
  587|       |// update the new neighbors
  588|       |// by enumerating all the neighbors of c1 and c2
  589|       |
  590|  41.9k|    Neighbor* N1 = communities[c1].first_neighbor;
  591|  41.9k|    Neighbor* N2 = communities[c2].first_neighbor;
  592|       |
  593|   105k|    while (N1 && N2) {
  ------------------
  |  Branch (593:12): [True: 70.9k, False: 35.0k]
  |  Branch (593:18): [True: 64.0k, False: 6.94k]
  ------------------
  594|  64.0k|        int neighbor_community1;
  595|  64.0k|        int neighbor_community2;
  596|       |
  597|  64.0k|        if (N1->community1 == c1) {
  ------------------
  |  Branch (597:13): [True: 46.4k, False: 17.5k]
  ------------------
  598|  46.4k|            neighbor_community1 = N1->community2;
  599|  46.4k|        } else {
  600|  17.5k|            neighbor_community1 = N1->community1;
  601|  17.5k|        }
  602|  64.0k|        if (N2->community1 == c2) {
  ------------------
  |  Branch (602:13): [True: 21.0k, False: 43.0k]
  ------------------
  603|  21.0k|            neighbor_community2 = N2->community2;
  604|  43.0k|        } else {
  605|  43.0k|            neighbor_community2 = N2->community1;
  606|  43.0k|        }
  607|       |
  608|  64.0k|        if (neighbor_community1 < neighbor_community2) {
  ------------------
  |  Branch (608:13): [True: 17.9k, False: 46.1k]
  ------------------
  609|  17.9k|            Neighbor* tmp = N1;
  610|  17.9k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (610:17): [True: 11.3k, False: 6.59k]
  ------------------
  611|  11.3k|                N1 = N1->next_community1;
  612|  11.3k|            } else {
  613|  6.59k|                N1 = N1->next_community2;
  614|  6.59k|            }
  615|  17.9k|            remove_neighbor(tmp);
  616|  17.9k|            Neighbor* N = new Neighbor;
  617|  17.9k|            N->weight = tmp->weight;
  618|  17.9k|            N->community1 = neighbor_community1;
  619|  17.9k|            N->community2 = nb_communities;
  620|  17.9k|            N->delta_sigma = (double(communities[c1].size + communities[neighbor_community1].size) * tmp->delta_sigma + double(communities[c2].size) * merge_N->delta_sigma) / (double(communities[c1].size + communities[c2].size + communities[neighbor_community1].size)); //compute_delta_sigma(neighbor_community1, nb_communities);
  621|  17.9k|            N->exact = false;
  622|  17.9k|            delete tmp;
  623|  17.9k|            add_neighbor(N);
  624|  17.9k|        }
  625|       |
  626|  64.0k|        if (neighbor_community2 < neighbor_community1) {
  ------------------
  |  Branch (626:13): [True: 32.2k, False: 31.8k]
  ------------------
  627|  32.2k|            Neighbor* tmp = N2;
  628|  32.2k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (628:17): [True: 5.23k, False: 26.9k]
  ------------------
  629|  5.23k|                N2 = N2->next_community1;
  630|  26.9k|            } else {
  631|  26.9k|                N2 = N2->next_community2;
  632|  26.9k|            }
  633|  32.2k|            remove_neighbor(tmp);
  634|  32.2k|            Neighbor* N = new Neighbor;
  635|  32.2k|            N->weight = tmp->weight;
  636|  32.2k|            N->community1 = neighbor_community2;
  637|  32.2k|            N->community2 = nb_communities;
  638|  32.2k|            N->delta_sigma = (double(communities[c1].size) * merge_N->delta_sigma + double(communities[c2].size + communities[neighbor_community2].size) * tmp->delta_sigma) / (double(communities[c1].size + communities[c2].size + communities[neighbor_community2].size)); //compute_delta_sigma(neighbor_community2, nb_communities);
  639|  32.2k|            N->exact = false;
  640|  32.2k|            delete tmp;
  641|  32.2k|            add_neighbor(N);
  642|  32.2k|        }
  643|       |
  644|  64.0k|        if (neighbor_community1 == neighbor_community2) {
  ------------------
  |  Branch (644:13): [True: 13.8k, False: 50.1k]
  ------------------
  645|  13.8k|            Neighbor* tmp1 = N1;
  646|  13.8k|            Neighbor* tmp2 = N2;
  647|  13.8k|            bool exact = N1->exact && N2->exact;
  ------------------
  |  Branch (647:26): [True: 8.64k, False: 5.23k]
  |  Branch (647:39): [True: 5.32k, False: 3.31k]
  ------------------
  648|  13.8k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (648:17): [True: 10.2k, False: 3.65k]
  ------------------
  649|  10.2k|                N1 = N1->next_community1;
  650|  10.2k|            } else {
  651|  3.65k|                N1 = N1->next_community2;
  652|  3.65k|            }
  653|  13.8k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (653:17): [True: 6.17k, False: 7.71k]
  ------------------
  654|  6.17k|                N2 = N2->next_community1;
  655|  7.71k|            } else {
  656|  7.71k|                N2 = N2->next_community2;
  657|  7.71k|            }
  658|  13.8k|            remove_neighbor(tmp1);
  659|  13.8k|            remove_neighbor(tmp2);
  660|  13.8k|            Neighbor* N = new Neighbor;
  661|  13.8k|            N->weight = tmp1->weight + tmp2->weight;
  662|  13.8k|            N->community1 = neighbor_community1;
  663|  13.8k|            N->community2 = nb_communities;
  664|  13.8k|            N->delta_sigma = (double(communities[c1].size + communities[neighbor_community1].size) * tmp1->delta_sigma + double(communities[c2].size + communities[neighbor_community1].size) * tmp2->delta_sigma - double(communities[neighbor_community1].size) * merge_N->delta_sigma) / (double(communities[c1].size + communities[c2].size + communities[neighbor_community1].size));
  665|  13.8k|            N->exact = exact;
  666|  13.8k|            delete tmp1;
  667|  13.8k|            delete tmp2;
  668|  13.8k|            add_neighbor(N);
  669|  13.8k|        }
  670|  64.0k|    }
  671|       |
  672|       |
  673|  41.9k|    if (!N1) {
  ------------------
  |  Branch (673:9): [True: 35.0k, False: 6.94k]
  ------------------
  674|   190k|        while (N2) {
  ------------------
  |  Branch (674:16): [True: 155k, False: 35.0k]
  ------------------
  675|       |//      double delta_sigma2 = N2->delta_sigma;
  676|   155k|            int neighbor_community;
  677|   155k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (677:17): [True: 11.5k, False: 143k]
  ------------------
  678|  11.5k|                neighbor_community = N2->community2;
  679|   143k|            } else {
  680|   143k|                neighbor_community = N2->community1;
  681|   143k|            }
  682|   155k|            Neighbor* tmp = N2;
  683|   155k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (683:17): [True: 11.5k, False: 143k]
  ------------------
  684|  11.5k|                N2 = N2->next_community1;
  685|   143k|            } else {
  686|   143k|                N2 = N2->next_community2;
  687|   143k|            }
  688|   155k|            remove_neighbor(tmp);
  689|   155k|            Neighbor* N = new Neighbor;
  690|   155k|            N->weight = tmp->weight;
  691|   155k|            N->community1 = neighbor_community;
  692|   155k|            N->community2 = nb_communities;
  693|   155k|            N->delta_sigma = (double(communities[c1].size) * merge_N->delta_sigma + double(communities[c2].size + communities[neighbor_community].size) * tmp->delta_sigma) / (double(communities[c1].size + communities[c2].size + communities[neighbor_community].size)); //compute_delta_sigma(neighbor_community, nb_communities);
  694|   155k|            N->exact = false;
  695|   155k|            delete tmp;
  696|   155k|            add_neighbor(N);
  697|   155k|        }
  698|  35.0k|    }
  699|  41.9k|    if (!N2) {
  ------------------
  |  Branch (699:9): [True: 41.9k, False: 0]
  ------------------
  700|  62.3k|        while (N1) {
  ------------------
  |  Branch (700:16): [True: 20.3k, False: 41.9k]
  ------------------
  701|       |//      double delta_sigma1 = N1->delta_sigma;
  702|  20.3k|            int neighbor_community;
  703|  20.3k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (703:17): [True: 17.7k, False: 2.60k]
  ------------------
  704|  17.7k|                neighbor_community = N1->community2;
  705|  17.7k|            } else {
  706|  2.60k|                neighbor_community = N1->community1;
  707|  2.60k|            }
  708|  20.3k|            Neighbor* tmp = N1;
  709|  20.3k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (709:17): [True: 17.7k, False: 2.60k]
  ------------------
  710|  17.7k|                N1 = N1->next_community1;
  711|  17.7k|            } else {
  712|  2.60k|                N1 = N1->next_community2;
  713|  2.60k|            }
  714|  20.3k|            remove_neighbor(tmp);
  715|  20.3k|            Neighbor* N = new Neighbor;
  716|  20.3k|            N->weight = tmp->weight;
  717|  20.3k|            N->community1 = neighbor_community;
  718|  20.3k|            N->community2 = nb_communities;
  719|  20.3k|            N->delta_sigma = (double(communities[c1].size + communities[neighbor_community].size) * tmp->delta_sigma + double(communities[c2].size) * merge_N->delta_sigma) / (double(communities[c1].size + communities[c2].size + communities[neighbor_community].size)); //compute_delta_sigma(neighbor_community, nb_communities);
  720|  20.3k|            N->exact = false;
  721|  20.3k|            delete tmp;
  722|  20.3k|            add_neighbor(N);
  723|  20.3k|        }
  724|  41.9k|    }
  725|       |
  726|  41.9k|    nb_communities++;
  727|  41.9k|    nb_active_communities--;
  728|  41.9k|}
_ZN6igraph8walktrap11Communities25merge_nearest_communitiesEv:
  730|  41.9k|double Communities::merge_nearest_communities() {
  731|  41.9k|    Neighbor* N = H->get_first();
  732|   125k|    while (!N->exact) {
  ------------------
  |  Branch (732:12): [True: 83.8k, False: 41.9k]
  ------------------
  733|  83.8k|        update_neighbor(N, compute_delta_sigma(N->community1, N->community2));
  734|  83.8k|        N->exact = true;
  735|  83.8k|        N = H->get_first();
  736|  83.8k|    }
  737|       |
  738|  41.9k|    double d = N->delta_sigma;
  739|  41.9k|    remove_neighbor(N);
  740|       |
  741|  41.9k|    merge_communities(N);
  742|       |
  743|  41.9k|    if (merges) {
  ------------------
  |  Branch (743:9): [True: 41.9k, False: 0]
  ------------------
  744|  41.9k|        MATRIX(*merges, mergeidx, 0) = N->community1;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  745|  41.9k|        MATRIX(*merges, mergeidx, 1) = N->community2;
  ------------------
  |  |   83|  41.9k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  746|  41.9k|    }
  747|       |
  748|  41.9k|    mergeidx++;
  749|       |
  750|  41.9k|    if (modularity) {
  ------------------
  |  Branch (750:9): [True: 41.9k, False: 0]
  ------------------
  751|  41.9k|        double Q = 0.0;
  752|  3.00M|        for (int i = 0; i < nb_communities; i++) {
  ------------------
  |  Branch (752:25): [True: 2.96M, False: 41.9k]
  ------------------
  753|  2.96M|            if (communities[i].sub_community_of == 0) {
  ------------------
  |  Branch (753:17): [True: 1.73M, False: 1.22M]
  ------------------
  754|  1.73M|                Q += (communities[i].internal_weight - communities[i].total_weight * communities[i].total_weight / G->total_weight);
  755|  1.73M|            }
  756|  2.96M|        }
  757|  41.9k|        Q /= G->total_weight;
  758|  41.9k|        VECTOR(*modularity)[mergeidx] = Q;
  ------------------
  |  |   60|  41.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  759|  41.9k|    }
  760|       |
  761|  41.9k|    delete N;
  762|       |
  763|       |    /* This could use igraph_progress */
  764|       |    /*   if(!silent) { */
  765|       |    /*     for(int k = (500*(G->nb_vertices - nb_active_communities - 1))/(G->nb_vertices-1) + 1; k <= (500*(G->nb_vertices - nb_active_communities))/(G->nb_vertices-1); k++) { */
  766|       |    /*       if(k % 50 == 1) {cerr.width(2); cerr << endl << k/ 5 << "% ";} */
  767|       |    /*       cerr << "."; */
  768|       |    /*     } */
  769|       |    /*   } */
  770|  41.9k|    return d;
  771|  41.9k|}
_ZNK6igraph8walktrap11Communities19compute_delta_sigmaEii:
  773|   139k|double Communities::compute_delta_sigma(int community1, int community2) const {
  774|   139k|    if (!communities[community1].P) {
  ------------------
  |  Branch (774:9): [True: 18.6k, False: 121k]
  ------------------
  775|  18.6k|        communities[community1].P = new Probabilities(community1);
  776|  18.6k|    }
  777|   139k|    if (!communities[community2].P) {
  ------------------
  |  Branch (777:9): [True: 30.2k, False: 109k]
  ------------------
  778|  30.2k|        communities[community2].P = new Probabilities(community2);
  779|  30.2k|    }
  780|       |
  781|   139k|    return communities[community1].P->compute_distance(communities[community2].P) * double(communities[community1].size) * double(communities[community2].size) / double(communities[community1].size + communities[community2].size);
  782|   139k|}

_ZN6igraph8walktrapltERKNS0_4EdgeES3_:
   69|  1.12M|bool operator<(const Edge& E1, const Edge& E2) {
   70|  1.12M|    return (E1.neighbor < E2.neighbor);
   71|  1.12M|}
_ZN6igraph8walktrap6VertexC2Ev:
   74|   154k|Vertex::Vertex() {
   75|   154k|    degree = 0;
   76|   154k|    edges = nullptr;
   77|   154k|    total_weight = 0.;
   78|   154k|}
_ZN6igraph8walktrap6VertexD2Ev:
   80|   154k|Vertex::~Vertex() {
   81|   154k|    delete[] edges;
   82|   154k|}
_ZN6igraph8walktrap5GraphC2Ev:
   84|  3.54k|Graph::Graph() {
   85|  3.54k|    nb_vertices = 0;
   86|  3.54k|    nb_edges = 0;
   87|  3.54k|    vertices = nullptr;
   88|  3.54k|    total_weight = 0.;
   89|  3.54k|}
_ZN6igraph8walktrap5GraphD2Ev:
   91|  3.54k|Graph::~Graph () {
   92|  3.54k|    delete[] vertices;
   93|  3.54k|}
_ZN6igraph8walktrap9Edge_list3addEiid:
  120|  96.0k|void Edge_list::add(int v1, int v2, double w) {
  121|  96.0k|    if (size == size_max) {
  ------------------
  |  Branch (121:9): [True: 0, False: 96.0k]
  ------------------
  122|      0|        int* tmp1 = new int[2 * size_max];
  123|      0|        int* tmp2 = new int[2 * size_max];
  124|      0|        double* tmp3 = new double[2 * size_max];
  125|      0|        for (int i = 0; i < size_max; i++) {
  ------------------
  |  Branch (125:25): [True: 0, False: 0]
  ------------------
  126|      0|            tmp1[i] = V1[i];
  127|      0|            tmp2[i] = V2[i];
  128|      0|            tmp3[i] = W[i];
  129|      0|        }
  130|      0|        delete[] V1;
  131|      0|        delete[] V2;
  132|      0|        delete[] W;
  133|      0|        V1 = tmp1;
  134|      0|        V2 = tmp2;
  135|      0|        W = tmp3;
  136|      0|        size_max *= 2;
  137|      0|    }
  138|  96.0k|    V1[size] = v1;
  139|  96.0k|    V2[size] = v2;
  140|  96.0k|    W[size] = w;
  141|  96.0k|    size++;
  142|  96.0k|}
_ZN6igraph8walktrap5Graph19convert_from_igraphEPK8igraph_tPK15igraph_vector_t:
  145|  3.54k|                               const igraph_vector_t *weights) {
  146|  3.54k|    Graph &G = *this;
  147|       |
  148|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  149|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  150|       |
  151|       |    // Avoid warnings with GCC when compiling with LTO.
  152|  3.54k|    IGRAPH_ASSUME(no_of_nodes >= 0);
  ------------------
  |  |   56|  3.54k|#    define IGRAPH_ASSUME(expr) __builtin_assume(expr)
  ------------------
  153|  3.54k|    IGRAPH_ASSUME(no_of_edges >= 0);
  ------------------
  |  |   56|  3.54k|#    define IGRAPH_ASSUME(expr) __builtin_assume(expr)
  ------------------
  154|       |
  155|       |    // Refactoring the walktrap code to support larger graphs is pointless
  156|       |    // as running the algorithm on them would take an impractically long time.
  157|  3.54k|    if (no_of_nodes > INT_MAX || no_of_edges > INT_MAX) {
  ------------------
  |  Branch (157:9): [True: 0, False: 3.54k]
  |  Branch (157:34): [True: 0, False: 3.54k]
  ------------------
  158|      0|        IGRAPH_ERROR("Graph too large for walktrap community detection.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  159|      0|    }
  160|       |
  161|  3.54k|    Edge_list EL;
  162|       |
  163|  99.5k|    for (igraph_int_t i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (163:30): [True: 96.0k, False: 3.54k]
  ------------------
  164|  96.0k|        igraph_real_t w = weights ? VECTOR(*weights)[i] : 1.0;
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (164:27): [True: 96.0k, False: 0]
  ------------------
  165|  96.0k|        EL.add(IGRAPH_FROM(graph, i), IGRAPH_TO(graph, i), w);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      EL.add(IGRAPH_FROM(graph, i), IGRAPH_TO(graph, i), w);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  166|  96.0k|    }
  167|       |
  168|  3.54k|    G.nb_vertices = no_of_nodes;
  169|  3.54k|    G.vertices = new Vertex[G.nb_vertices];
  170|  3.54k|    G.nb_edges = 0;
  171|  3.54k|    G.total_weight = 0.0;
  172|       |
  173|  99.5k|    for (int i = 0; i < EL.size; i++) {
  ------------------
  |  Branch (173:21): [True: 96.0k, False: 3.54k]
  ------------------
  174|  96.0k|        G.vertices[EL.V1[i]].degree++;
  175|  96.0k|        G.vertices[EL.V2[i]].degree++;
  176|  96.0k|        G.vertices[EL.V1[i]].total_weight += EL.W[i];
  177|  96.0k|        G.vertices[EL.V2[i]].total_weight += EL.W[i];
  178|  96.0k|        G.nb_edges++;
  179|  96.0k|        G.total_weight += EL.W[i];
  180|  96.0k|    }
  181|       |
  182|   158k|    for (int i = 0; i < G.nb_vertices; i++) {
  ------------------
  |  Branch (182:21): [True: 154k, False: 3.54k]
  ------------------
  183|   154k|        int deg = G.vertices[i].degree;
  184|   154k|        double w = (deg == 0) ? 1.0 : (G.vertices[i].total_weight / double(deg));
  ------------------
  |  Branch (184:20): [True: 105k, False: 49.0k]
  ------------------
  185|   154k|        G.vertices[i].edges = new Edge[deg + 1];
  186|   154k|        G.vertices[i].edges[0].neighbor = i;
  187|   154k|        G.vertices[i].edges[0].weight = w;
  188|   154k|        G.vertices[i].total_weight += w;
  189|   154k|        G.vertices[i].degree = 1;
  190|   154k|    }
  191|       |
  192|  99.5k|    for (int i = 0; i < EL.size; i++) {
  ------------------
  |  Branch (192:21): [True: 96.0k, False: 3.54k]
  ------------------
  193|  96.0k|        G.vertices[EL.V1[i]].edges[G.vertices[EL.V1[i]].degree].neighbor = EL.V2[i];
  194|  96.0k|        G.vertices[EL.V1[i]].edges[G.vertices[EL.V1[i]].degree].weight = EL.W[i];
  195|  96.0k|        G.vertices[EL.V1[i]].degree++;
  196|  96.0k|        G.vertices[EL.V2[i]].edges[G.vertices[EL.V2[i]].degree].neighbor = EL.V1[i];
  197|  96.0k|        G.vertices[EL.V2[i]].edges[G.vertices[EL.V2[i]].degree].weight = EL.W[i];
  198|  96.0k|        G.vertices[EL.V2[i]].degree++;
  199|  96.0k|    }
  200|       |
  201|   158k|    for (int i = 0; i < G.nb_vertices; i++) {
  ------------------
  |  Branch (201:21): [True: 154k, False: 3.54k]
  ------------------
  202|       |        /* Check for zero strength, as it may lead to crashes the in walktrap algorithm.
  203|       |         * See https://github.com/igraph/igraph/pull/2043 */
  204|   154k|        if (G.vertices[i].total_weight == 0) {
  ------------------
  |  Branch (204:13): [True: 0, False: 154k]
  ------------------
  205|       |            /* G.vertices will be destroyed by Graph::~Graph() */
  206|      0|            IGRAPH_ERROR("Vertex with zero strength found: all vertices must have positive strength for walktrap.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  207|      0|                         IGRAPH_EINVAL);
  208|      0|        }
  209|   154k|        sort(G.vertices[i].edges, G.vertices[i].edges + G.vertices[i].degree);
  210|   154k|    }
  211|       |
  212|   158k|    for (int i = 0; i < G.nb_vertices; i++) { // merge multi edges
  ------------------
  |  Branch (212:21): [True: 154k, False: 3.54k]
  ------------------
  213|   154k|        int a = 0;
  214|   346k|        for (int b = 1; b < G.vertices[i].degree; b++) {
  ------------------
  |  Branch (214:25): [True: 192k, False: 154k]
  ------------------
  215|   192k|            if (G.vertices[i].edges[b].neighbor == G.vertices[i].edges[a].neighbor) {
  ------------------
  |  Branch (215:17): [True: 80.3k, False: 111k]
  ------------------
  216|  80.3k|                G.vertices[i].edges[a].weight += G.vertices[i].edges[b].weight;
  217|   111k|            } else {
  218|   111k|                G.vertices[i].edges[++a] = G.vertices[i].edges[b];
  219|   111k|            }
  220|   192k|        }
  221|   154k|        G.vertices[i].degree = a + 1;
  222|   154k|    }
  223|       |
  224|  3.54k|    return IGRAPH_SUCCESS;
  225|  3.54k|}
_ZN6igraph8walktrap9Edge_listC2Ev:
  105|  3.54k|    Edge_list() {
  106|  3.54k|        size = 0;
  107|  3.54k|        size_max = 1024;
  108|  3.54k|        V1 = new int[1024];
  109|  3.54k|        V2 = new int[1024];
  110|  3.54k|        W = new double[1024];
  111|  3.54k|    }
_ZN6igraph8walktrap9Edge_listD2Ev:
  113|  3.54k|    ~Edge_list() {
  114|  3.54k|        delete[] V1;
  115|  3.54k|        delete[] V2;
  116|  3.54k|        delete[] W;
  117|  3.54k|    }

_ZN6igraph8walktrap13Neighbor_heap7move_upEi:
   59|   731k|void Neighbor_heap::move_up(int index) {
   60|  1.01M|    while (H[index / 2]->delta_sigma > H[index]->delta_sigma) {
  ------------------
  |  Branch (60:12): [True: 283k, False: 731k]
  ------------------
   61|   283k|        Neighbor* tmp = H[index / 2];
   62|   283k|        H[index]->heap_index = index / 2;
   63|   283k|        H[index / 2] = H[index];
   64|   283k|        tmp->heap_index = index;
   65|   283k|        H[index] = tmp;
   66|   283k|        index = index / 2;
   67|   283k|    }
   68|   731k|}
_ZN6igraph8walktrap13Neighbor_heap9move_downEi:
   70|   435k|void Neighbor_heap::move_down(int index) {
   71|  1.22M|    while (true) {
  ------------------
  |  Branch (71:12): [True: 1.22M, Folded]
  ------------------
   72|  1.22M|        int min = index;
   73|  1.22M|        if ((2 * index < size) && (H[2 * index]->delta_sigma < H[min]->delta_sigma)) {
  ------------------
  |  Branch (73:13): [True: 956k, False: 265k]
  |  Branch (73:35): [True: 555k, False: 400k]
  ------------------
   74|   555k|            min = 2 * index;
   75|   555k|        }
   76|  1.22M|        if (2 * index + 1 < size && H[2 * index + 1]->delta_sigma < H[min]->delta_sigma) {
  ------------------
  |  Branch (76:13): [True: 905k, False: 316k]
  |  Branch (76:37): [True: 439k, False: 465k]
  ------------------
   77|   439k|            min = 2 * index + 1;
   78|   439k|        }
   79|  1.22M|        if (min != index) {
  ------------------
  |  Branch (79:13): [True: 786k, False: 435k]
  ------------------
   80|   786k|            Neighbor* tmp = H[min];
   81|   786k|            H[index]->heap_index = min;
   82|   786k|            H[min] = H[index];
   83|   786k|            tmp->heap_index = index;
   84|   786k|            H[index] = tmp;
   85|   786k|            index = min;
   86|   786k|        } else {
   87|   435k|            break;
   88|   435k|        }
   89|  1.22M|    }
   90|   435k|}
_ZN6igraph8walktrap13Neighbor_heap9get_firstEv:
   92|   185k|Neighbor* Neighbor_heap::get_first() {
   93|   185k|    if (size == 0) {
  ------------------
  |  Branch (93:9): [True: 107, False: 185k]
  ------------------
   94|    107|        return nullptr;
   95|   185k|    } else {
   96|   185k|        return H[0];
   97|   185k|    }
   98|   185k|}
_ZN6igraph8walktrap13Neighbor_heap6removeEPNS0_8NeighborE:
  100|   295k|void Neighbor_heap::remove(Neighbor* N) {
  101|   295k|    if (N->heap_index == -1 || size == 0) {
  ------------------
  |  Branch (101:9): [True: 0, False: 295k]
  |  Branch (101:32): [True: 0, False: 295k]
  ------------------
  102|      0|        return;
  103|      0|    }
  104|   295k|    Neighbor* last_N = H[--size];
  105|   295k|    H[N->heap_index] = last_N;
  106|   295k|    last_N->heap_index = N->heap_index;
  107|   295k|    move_up(last_N->heap_index);
  108|   295k|    move_down(last_N->heap_index);
  109|   295k|    N->heap_index = -1;
  110|   295k|}
_ZN6igraph8walktrap13Neighbor_heap3addEPNS0_8NeighborE:
  112|   295k|void Neighbor_heap::add(Neighbor* N) {
  113|   295k|    if (size >= max_size) {
  ------------------
  |  Branch (113:9): [True: 0, False: 295k]
  ------------------
  114|      0|        return;
  115|      0|    }
  116|   295k|    N->heap_index = size++;
  117|   295k|    H[N->heap_index] = N;
  118|   295k|    move_up(N->heap_index);
  119|   295k|}
_ZN6igraph8walktrap13Neighbor_heap6updateEPNS0_8NeighborE:
  121|   139k|void Neighbor_heap::update(Neighbor* N) {
  122|   139k|    if (N->heap_index == -1) {
  ------------------
  |  Branch (122:9): [True: 0, False: 139k]
  ------------------
  123|      0|        return;
  124|      0|    }
  125|   139k|    move_up(N->heap_index);
  126|   139k|    move_down(N->heap_index);
  127|   139k|}
_ZN6igraph8walktrap13Neighbor_heapC2Ei:
  129|  3.54k|Neighbor_heap::Neighbor_heap(int max_s) {
  130|  3.54k|    max_size = max_s;
  131|  3.54k|    size = 0;
  132|  3.54k|    H = new Neighbor*[max_s];
  133|  3.54k|}
_ZN6igraph8walktrap13Neighbor_heapD2Ev:
  135|  3.54k|Neighbor_heap::~Neighbor_heap() {
  136|  3.54k|    delete[] H;
  137|  3.54k|}
_ZNK6igraph8walktrap13Neighbor_heap8is_emptyEv:
  139|  45.4k|bool Neighbor_heap::is_empty() const {
  140|  45.4k|    return (size == 0);
  141|  45.4k|}

igraph_connected_components:
   87|  7.07k|) {
   88|  7.07k|    if (mode == IGRAPH_WEAK || !igraph_is_directed(graph)) {
  ------------------
  |  Branch (88:9): [True: 7.07k, False: 0]
  |  Branch (88:32): [True: 0, False: 0]
  ------------------
   89|  7.07k|        return igraph_i_connected_components_weak(graph, membership, csize, no);
   90|  7.07k|    } else if (mode == IGRAPH_STRONG) {
  ------------------
  |  Branch (90:16): [True: 0, False: 0]
  ------------------
   91|      0|        return igraph_i_connected_components_strong(graph, membership, csize, no);
   92|      0|    }
   93|       |
   94|      0|    IGRAPH_ERROR("Invalid connectedness mode.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   95|      0|}
igraph_is_connected:
  435|   307k|                        igraph_connectedness_t mode) {
  436|       |
  437|   307k|    igraph_cached_property_t prop;
  438|   307k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  439|   307k|    igraph_int_t no;
  440|       |
  441|   307k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (441:9): [True: 153k, False: 153k]
  ------------------
  442|   153k|        mode = IGRAPH_WEAK;
  443|   153k|    }
  444|       |
  445|   307k|    switch (mode) {
  446|   307k|        case IGRAPH_WEAK:
  ------------------
  |  Branch (446:9): [True: 307k, False: 0]
  ------------------
  447|   307k|            prop = IGRAPH_PROP_IS_WEAKLY_CONNECTED;
  448|   307k|            break;
  449|       |
  450|      0|        case IGRAPH_STRONG:
  ------------------
  |  Branch (450:9): [True: 0, False: 307k]
  ------------------
  451|      0|            prop = IGRAPH_PROP_IS_STRONGLY_CONNECTED;
  452|      0|            break;
  453|       |
  454|      0|        default:
  ------------------
  |  Branch (454:9): [True: 0, False: 307k]
  ------------------
  455|      0|            IGRAPH_ERROR("Invalid connectedness mode.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  456|   307k|    }
  457|       |
  458|   307k|    IGRAPH_RETURN_IF_CACHED_BOOL(graph, prop, res);
  ------------------
  |  |   97|   307k|    do { \
  |  |   98|   307k|        if (igraph_i_property_cache_has((graphptr), (prop))) { \
  |  |  ------------------
  |  |  |  Branch (98:13): [True: 515, False: 306k]
  |  |  ------------------
  |  |   99|    515|            *(resptr) = igraph_i_property_cache_get_bool((graphptr), (prop)); \
  |  |  100|    515|            return IGRAPH_SUCCESS; \
  |  |  101|    515|        } \
  |  |  102|   307k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 306k]
  |  |  ------------------
  ------------------
  459|       |
  460|   306k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (460:9): [True: 1, False: 306k]
  ------------------
  461|       |        /* Changed in igraph 0.9; see https://github.com/igraph/igraph/issues/1539
  462|       |         * for the reasoning behind the change */
  463|      1|        *res = false;
  464|   306k|    } else if (no_of_nodes == 1) {
  ------------------
  |  Branch (464:16): [True: 296k, False: 9.56k]
  ------------------
  465|   296k|        *res = true;
  466|   296k|    } else if (mode == IGRAPH_WEAK) {
  ------------------
  |  Branch (466:16): [True: 9.56k, False: 0]
  ------------------
  467|  9.56k|        IGRAPH_CHECK(igraph_i_is_connected_weak(graph, res));
  ------------------
  |  |  656|  9.56k|    do { \
  |  |  657|  9.56k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  9.56k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  9.56k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 9.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  9.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 9.56k]
  |  |  ------------------
  ------------------
  468|  9.56k|    } else {   /* mode == IGRAPH_STRONG */
  469|       |        /* A strongly connected graph has at least as many edges as vertices,
  470|       |         * except for the singleton graph, which is handled above. */
  471|      0|        if (igraph_ecount(graph) < no_of_nodes) {
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            *res = false;
  473|      0|        } else {
  474|      0|            IGRAPH_CHECK(igraph_i_connected_components_strong(graph, NULL, NULL, &no));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  475|      0|            *res = (no == 1);
  476|      0|        }
  477|      0|    }
  478|       |
  479|       |    /* Cache updates are done in igraph_i_connected_components_strong() and
  480|       |     * igraph_i_is_connected_weak() because those might be called from other
  481|       |     * places and we want to make use of the caching if so */
  482|       |
  483|   306k|    return IGRAPH_SUCCESS;
  484|   306k|}
components.c:igraph_i_connected_components_weak:
  100|  7.07k|) {
  101|       |
  102|  7.07k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  103|  7.07k|    igraph_int_t no_of_components;
  104|  7.07k|    igraph_bitset_t already_added;
  105|  7.07k|    igraph_dqueue_int_t q = IGRAPH_DQUEUE_NULL;
  ------------------
  |  |   56|  7.07k|#define IGRAPH_DQUEUE_NULL { 0,0,0,0 }
  ------------------
  106|  7.07k|    igraph_vector_int_t neis = IGRAPH_VECTOR_NULL;
  ------------------
  |  |   99|  7.07k|    #define IGRAPH_VECTOR_NULL { 0,0,0 }
  ------------------
  107|       |
  108|       |    /* Memory for result, csize is dynamically allocated */
  109|  7.07k|    if (membership) {
  ------------------
  |  Branch (109:9): [True: 0, False: 7.07k]
  ------------------
  110|      0|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  111|      0|    }
  112|  7.07k|    if (csize) {
  ------------------
  |  Branch (112:9): [True: 0, False: 7.07k]
  ------------------
  113|      0|        igraph_vector_int_clear(csize);
  114|      0|    }
  115|       |
  116|       |    /* Try to make use of cached information. */
  117|  7.07k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED) &&
  ------------------
  |  Branch (117:9): [True: 3.53k, False: 3.54k]
  ------------------
  118|  3.53k|        igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED)) {
  ------------------
  |  Branch (118:9): [True: 533, False: 3.00k]
  ------------------
  119|       |        /* If we know that the graph is weakly connected from the cache,
  120|       |         * we can return the result right away. We keep in mind that
  121|       |         * the null graph is considered disconnected, therefore any connected
  122|       |         * graph has precisely one component. */
  123|    533|        if (membership) {
  ------------------
  |  Branch (123:13): [True: 0, False: 533]
  ------------------
  124|       |            /* All vertices are members of the same component,
  125|       |             * component number 0. */
  126|      0|            igraph_vector_int_null(membership);
  127|      0|        }
  128|    533|        if (csize) {
  ------------------
  |  Branch (128:13): [True: 0, False: 533]
  ------------------
  129|       |            /* The size of the single component is the same as the vertex count. */
  130|      0|            IGRAPH_CHECK(igraph_vector_int_push_back(csize, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  131|      0|        }
  132|    533|        if (no) {
  ------------------
  |  Branch (132:13): [True: 533, False: 0]
  ------------------
  133|       |            /* There is one component. */
  134|    533|            *no = 1;
  135|    533|        }
  136|    533|        return IGRAPH_SUCCESS;
  137|    533|    }
  138|       |
  139|  6.54k|    IGRAPH_BITSET_INIT_FINALLY(&already_added, no_of_nodes);
  ------------------
  |  |  259|  6.54k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  6.54k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.54k|    do { \
  |  |  |  |  657|  6.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  6.54k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.54k|    do { \
  |  |  |  |  604|  6.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 6.54k]
  |  |  ------------------
  ------------------
  140|  6.54k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, no_of_nodes > 100000 ? 10000 : no_of_nodes / 10);
  ------------------
  |  |   61|  6.54k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  6.54k|    do { \
  |  |  |  |  657|  13.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (657:40): [True: 0, False: 6.54k]
  |  |  |  |  ------------------
  |  |  |  |  658|  6.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  6.54k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.54k|    do { \
  |  |  |  |  604|  6.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 6.54k]
  |  |  ------------------
  ------------------
  141|  6.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  6.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.54k|    do { \
  |  |  |  |  657|  6.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.54k|    do { \
  |  |  |  |  604|  6.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.54k]
  |  |  ------------------
  ------------------
  142|       |
  143|       |    /* The algorithm */
  144|       |
  145|  6.54k|    no_of_components = 0;
  146|   311k|    for (igraph_int_t first_node = 0; first_node < no_of_nodes; ++first_node) {
  ------------------
  |  Branch (146:39): [True: 304k, False: 6.54k]
  ------------------
  147|   304k|        igraph_int_t act_component_size;
  148|       |
  149|   304k|        if (IGRAPH_BIT_TEST(already_added, first_node)) {
  ------------------
  |  |  142|   304k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   304k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   304k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   304k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   304k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 79.2k, False: 225k]
  |  |  ------------------
  ------------------
  150|  79.2k|            continue;
  151|  79.2k|        }
  152|   225k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   225k|    do { \
  |  |   47|   225k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 225k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   225k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 225k]
  |  |  ------------------
  ------------------
  153|       |
  154|   225k|        IGRAPH_BIT_SET(already_added, first_node);
  ------------------
  |  |  103|   225k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   225k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   225k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   225k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   225k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   225k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|   225k|        act_component_size = 1;
  156|   225k|        if (membership) {
  ------------------
  |  Branch (156:13): [True: 0, False: 225k]
  ------------------
  157|      0|            VECTOR(*membership)[first_node] = no_of_components;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|      0|        }
  159|   225k|        IGRAPH_CHECK(igraph_dqueue_int_push(&q, first_node));
  ------------------
  |  |  656|   225k|    do { \
  |  |  657|   225k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   225k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   225k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 225k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   225k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 225k]
  |  |  ------------------
  ------------------
  160|       |
  161|   530k|        while ( !igraph_dqueue_int_empty(&q) ) {
  ------------------
  |  Branch (161:17): [True: 304k, False: 225k]
  ------------------
  162|   304k|            igraph_int_t act_node = igraph_dqueue_int_pop(&q);
  163|   304k|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|   304k|    do { \
  |  |  657|   304k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   304k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   304k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 304k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   304k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 304k]
  |  |  ------------------
  ------------------
  164|   304k|                graph, &neis, act_node, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_MULTIPLE
  165|   304k|            ));
  166|   304k|            igraph_int_t nei_count = igraph_vector_int_size(&neis);
  167|   574k|            for (igraph_int_t i = 0; i < nei_count; i++) {
  ------------------
  |  Branch (167:38): [True: 269k, False: 304k]
  ------------------
  168|   269k|                igraph_int_t neighbor = VECTOR(neis)[i];
  ------------------
  |  |   60|   269k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  169|   269k|                if (IGRAPH_BIT_TEST(already_added, neighbor)) {
  ------------------
  |  |  142|   269k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   269k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   269k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   269k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   269k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   269k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 190k, False: 79.2k]
  |  |  ------------------
  ------------------
  170|   190k|                    continue;
  171|   190k|                }
  172|  79.2k|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|  79.2k|    do { \
  |  |  657|  79.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  79.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  79.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 79.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  79.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 79.2k]
  |  |  ------------------
  ------------------
  173|  79.2k|                IGRAPH_BIT_SET(already_added, neighbor);
  ------------------
  |  |  103|  79.2k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  79.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  79.2k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  79.2k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  79.2k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  79.2k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  79.2k|                act_component_size++;
  175|  79.2k|                if (membership) {
  ------------------
  |  Branch (175:21): [True: 0, False: 79.2k]
  ------------------
  176|      0|                    VECTOR(*membership)[neighbor] = no_of_components;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  177|      0|                }
  178|  79.2k|            }
  179|   304k|        }
  180|       |
  181|   225k|        no_of_components++;
  182|   225k|        if (csize) {
  ------------------
  |  Branch (182:13): [True: 0, False: 225k]
  ------------------
  183|      0|            IGRAPH_CHECK(igraph_vector_int_push_back(csize, act_component_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  184|      0|        }
  185|   225k|    }
  186|       |
  187|       |    /* Cleaning up */
  188|       |
  189|  6.54k|    if (no) {
  ------------------
  |  Branch (189:9): [True: 6.54k, False: 0]
  ------------------
  190|  6.54k|        *no = no_of_components;
  191|  6.54k|    }
  192|       |
  193|       |    /* Clean up */
  194|  6.54k|    igraph_bitset_destroy(&already_added);
  195|  6.54k|    igraph_dqueue_int_destroy(&q);
  196|  6.54k|    igraph_vector_int_destroy(&neis);
  197|  6.54k|    IGRAPH_FINALLY_CLEAN(3);
  198|       |
  199|       |    /* Update cache */
  200|  6.54k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED, no_of_components == 1);
  201|       |
  202|  6.54k|    return IGRAPH_SUCCESS;
  203|  6.54k|}
components.c:igraph_i_is_connected_weak:
  486|  9.56k|static igraph_error_t igraph_i_is_connected_weak(const igraph_t *graph, igraph_bool_t *res) {
  487|  9.56k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  488|  9.56k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  489|  9.56k|    igraph_int_t added_count;
  490|  9.56k|    igraph_bitset_t already_added;
  491|  9.56k|    igraph_vector_int_t neis;
  492|  9.56k|    igraph_dqueue_int_t q;
  493|       |
  494|       |    /* By convention, the null graph is not considered connected.
  495|       |     * See https://github.com/igraph/igraph/issues/1538 */
  496|  9.56k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (496:9): [True: 0, False: 9.56k]
  ------------------
  497|      0|        *res = false;
  498|      0|        goto exit;
  499|      0|    }
  500|       |
  501|       |    /* A connected graph has at least |V| - 1 edges. */
  502|  9.56k|    if (no_of_edges < no_of_nodes - 1) {
  ------------------
  |  Branch (502:9): [True: 2.80k, False: 6.75k]
  ------------------
  503|  2.80k|        *res = false;
  504|  2.80k|        goto exit;
  505|  2.80k|    }
  506|       |
  507|  6.75k|    IGRAPH_BITSET_INIT_FINALLY(&already_added, no_of_nodes);
  ------------------
  |  |  259|  6.75k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  6.75k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.75k|    do { \
  |  |  |  |  657|  6.75k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.75k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.75k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.75k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  6.75k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.75k|    do { \
  |  |  |  |  604|  6.75k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.75k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.75k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.75k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.75k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
  508|  6.75k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, 10);
  ------------------
  |  |   61|  6.75k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  6.75k|    do { \
  |  |  |  |  657|  6.75k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.75k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.75k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.75k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  6.75k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.75k|    do { \
  |  |  |  |  604|  6.75k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.75k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.75k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.75k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.75k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
  509|  6.75k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  6.75k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.75k|    do { \
  |  |  |  |  657|  6.75k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.75k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.75k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.75k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.75k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.75k|    do { \
  |  |  |  |  604|  6.75k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.75k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.75k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.75k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.75k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.75k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
  510|       |
  511|       |    /* Try to find at least two components */
  512|  6.75k|    IGRAPH_BIT_SET(already_added, 0);
  ------------------
  |  |  103|  6.75k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  6.75k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  6.75k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.75k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  6.75k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.75k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  6.75k|    IGRAPH_CHECK(igraph_dqueue_int_push(&q, 0));
  ------------------
  |  |  656|  6.75k|    do { \
  |  |  657|  6.75k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.75k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.75k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.75k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
  514|       |
  515|  6.75k|    added_count = 1;
  516|  17.4k|    while (! igraph_dqueue_int_empty(&q)) {
  ------------------
  |  Branch (516:12): [True: 17.2k, False: 199]
  ------------------
  517|  17.2k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  17.2k|    do { \
  |  |   47|  17.2k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  17.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  518|       |
  519|  17.2k|        const igraph_int_t actnode = igraph_dqueue_int_pop(&q);
  520|       |
  521|  17.2k|        IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|  17.2k|    do { \
  |  |  657|  17.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  522|  17.2k|            graph, &neis, actnode, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_MULTIPLE
  523|  17.2k|        ));
  524|  17.2k|        const igraph_int_t nei_count = igraph_vector_int_size(&neis);
  525|       |
  526|  62.2k|        for (igraph_int_t i = 0; i < nei_count; i++) {
  ------------------
  |  Branch (526:34): [True: 51.5k, False: 10.7k]
  ------------------
  527|  51.5k|            const igraph_int_t neighbor = VECTOR(neis)[i];
  ------------------
  |  |   60|  51.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  528|  51.5k|            if (IGRAPH_BIT_TEST(already_added, neighbor)) {
  ------------------
  |  |  142|  51.5k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  51.5k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  51.5k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  51.5k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  51.5k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  51.5k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 32.4k, False: 19.1k]
  |  |  ------------------
  ------------------
  529|  32.4k|                continue;
  530|  32.4k|            }
  531|       |
  532|  19.1k|            IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|  19.1k|    do { \
  |  |  657|  19.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  19.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  19.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  19.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 19.1k]
  |  |  ------------------
  ------------------
  533|  19.1k|            added_count++;
  534|  19.1k|            IGRAPH_BIT_SET(already_added, neighbor);
  ------------------
  |  |  103|  19.1k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  19.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  19.1k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  19.1k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  19.1k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  19.1k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|       |
  536|  19.1k|            if (added_count == no_of_nodes) {
  ------------------
  |  Branch (536:17): [True: 6.55k, False: 12.5k]
  ------------------
  537|       |                /* We have already reached all nodes: the graph is connected.
  538|       |                 * We can stop the traversal now. */
  539|  6.55k|                goto done;
  540|  6.55k|            }
  541|  19.1k|        }
  542|  17.2k|    }
  543|       |
  544|  6.75k|done:
  545|       |    /* Connected? */
  546|  6.75k|    *res = (added_count == no_of_nodes);
  547|       |
  548|  6.75k|    igraph_bitset_destroy(&already_added);
  549|  6.75k|    igraph_dqueue_int_destroy(&q);
  550|  6.75k|    igraph_vector_int_destroy(&neis);
  551|  6.75k|    IGRAPH_FINALLY_CLEAN(3);
  552|       |
  553|  9.56k|exit:
  554|  9.56k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED, *res);
  555|  9.56k|    if (igraph_is_directed(graph) && !(*res)) {
  ------------------
  |  Branch (555:9): [True: 1.19k, False: 8.36k]
  |  Branch (555:38): [True: 0, False: 1.19k]
  ------------------
  556|       |        /* If the graph is not weakly connected, it is not strongly connected
  557|       |         * either so we can also cache that */
  558|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_IS_STRONGLY_CONNECTED, *res);
  559|      0|    }
  560|       |
  561|  9.56k|    return IGRAPH_SUCCESS;
  562|  6.75k|}

igraph_create:
   54|   338k|                             igraph_int_t n, igraph_bool_t directed) {
   55|   338k|    igraph_bool_t has_edges = igraph_vector_int_size(edges) > 0;
   56|   338k|    igraph_int_t max;
   57|       |
   58|   338k|    if (igraph_vector_int_size(edges) % 2 != 0) {
  ------------------
  |  Branch (58:9): [True: 0, False: 338k]
  ------------------
   59|      0|        IGRAPH_ERROR("Invalid (odd) edges vector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   60|      0|    }
   61|   338k|    if (!igraph_vector_int_isininterval(edges, 0, IGRAPH_VCOUNT_MAX-1)) {
  ------------------
  |  |  100|   338k|#define IGRAPH_VCOUNT_MAX (IGRAPH_INTEGER_MAX-1)
  |  |  ------------------
  |  |  |  |   72|   338k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (61:9): [True: 0, False: 338k]
  ------------------
   62|      0|        IGRAPH_ERROR("Invalid (negative or too large) vertex ID.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   63|      0|    }
   64|       |
   65|       |    /* The + 1 here cannot overflow as above we have already
   66|       |     * checked that vertex IDs are within range. */
   67|   338k|    max = has_edges ? igraph_vector_int_max(edges) + 1 : 0;
  ------------------
  |  Branch (67:11): [True: 41.7k, False: 297k]
  ------------------
   68|       |
   69|   338k|    IGRAPH_CHECK(igraph_empty(graph, n, directed));
  ------------------
  |  |  656|   338k|    do { \
  |  |  657|   338k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   338k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   338k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 338k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   338k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 338k]
  |  |  ------------------
  ------------------
   70|   338k|    IGRAPH_FINALLY(igraph_destroy, graph);
  ------------------
  |  |  603|   338k|    do { \
  |  |  604|   338k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   338k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   338k|         * incorrect destructor function with the pointer */ \
  |  |  607|   338k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 338k]
  |  |  ------------------
  |  |  608|   338k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   338k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 338k]
  |  |  ------------------
  ------------------
   71|   338k|    if (has_edges) {
  ------------------
  |  Branch (71:9): [True: 41.7k, False: 297k]
  ------------------
   72|  41.7k|        n = igraph_vcount(graph);
   73|  41.7k|        if (n < max) {
  ------------------
  |  Branch (73:13): [True: 3.05k, False: 38.6k]
  ------------------
   74|  3.05k|            IGRAPH_CHECK(igraph_add_vertices(graph, (max - n), 0));
  ------------------
  |  |  656|  3.05k|    do { \
  |  |  657|  3.05k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.05k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.05k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.05k]
  |  |  ------------------
  ------------------
   75|  3.05k|        }
   76|  41.7k|        IGRAPH_CHECK(igraph_add_edges(graph, edges, 0));
  ------------------
  |  |  656|  41.7k|    do { \
  |  |  657|  41.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
   77|  41.7k|    }
   78|       |
   79|   338k|    IGRAPH_FINALLY_CLEAN(1);
   80|   338k|    return IGRAPH_SUCCESS;
   81|   338k|}

igraph_bitset_init:
  173|   585k|igraph_error_t igraph_bitset_init(igraph_bitset_t *bitset, igraph_int_t size) {
  174|   585k|    igraph_int_t alloc_size = IGRAPH_BIT_NSLOTS(size);
  ------------------
  |  |  161|   585k|#define IGRAPH_BIT_NSLOTS(nbits) ((nbits + IGRAPH_INTEGER_SIZE - (igraph_int_t)(1)) / IGRAPH_INTEGER_SIZE)
  |  |  ------------------
  |  |  |  |   32|   585k|#define IGRAPH_INTEGER_SIZE 64
  |  |  ------------------
  |  |               #define IGRAPH_BIT_NSLOTS(nbits) ((nbits + IGRAPH_INTEGER_SIZE - (igraph_int_t)(1)) / IGRAPH_INTEGER_SIZE)
  |  |  ------------------
  |  |  |  |   32|   585k|#define IGRAPH_INTEGER_SIZE 64
  |  |  ------------------
  ------------------
  175|   585k|    bitset->stor_begin = IGRAPH_CALLOC(alloc_size, igraph_uint_t);
  ------------------
  |  |   33|   585k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  1.17M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 585k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 585k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 585k, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|   585k|    IGRAPH_CHECK_OOM(bitset->stor_begin, "Cannot initialize bitset.");
  ------------------
  |  |  709|   585k|    do { \
  |  |  710|   585k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   585k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 585k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   585k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 585k]
  |  |  ------------------
  ------------------
  177|   585k|    bitset->size = size;
  178|   585k|    bitset->stor_end = bitset->stor_begin + alloc_size;
  179|   585k|    return IGRAPH_SUCCESS;
  180|   585k|}
igraph_bitset_destroy:
  198|   585k|void igraph_bitset_destroy(igraph_bitset_t *bitset) {
  199|   585k|    IGRAPH_ASSERT(bitset != NULL);
  ------------------
  |  |  924|   585k|    do { \
  |  |  925|   585k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   585k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 585k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   585k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 585k]
  |  |  ------------------
  ------------------
  200|   585k|    IGRAPH_FREE(bitset->stor_begin);
  ------------------
  |  |   36|   585k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  201|   585k|    bitset->size = 0;
  202|   585k|}
igraph_bitset_countr_one:
  543|  96.0k|igraph_int_t igraph_bitset_countr_one(const igraph_bitset_t *bitset) {
  544|  96.0k|    const igraph_int_t final_block_size = bitset->size % IGRAPH_INTEGER_SIZE ? bitset->size % IGRAPH_INTEGER_SIZE : IGRAPH_INTEGER_SIZE;
  ------------------
  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
                  const igraph_int_t final_block_size = bitset->size % IGRAPH_INTEGER_SIZE ? bitset->size % IGRAPH_INTEGER_SIZE : IGRAPH_INTEGER_SIZE;
  ------------------
  |  |   32|  91.6k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
                  const igraph_int_t final_block_size = bitset->size % IGRAPH_INTEGER_SIZE ? bitset->size % IGRAPH_INTEGER_SIZE : IGRAPH_INTEGER_SIZE;
  ------------------
  |  |   32|  4.35k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
  |  Branch (544:43): [True: 91.6k, False: 4.35k]
  ------------------
  545|  96.0k|    const igraph_int_t slots = IGRAPH_BIT_NSLOTS(bitset->size);
  ------------------
  |  |  161|  96.0k|#define IGRAPH_BIT_NSLOTS(nbits) ((nbits + IGRAPH_INTEGER_SIZE - (igraph_int_t)(1)) / IGRAPH_INTEGER_SIZE)
  |  |  ------------------
  |  |  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  ------------------
  |  |               #define IGRAPH_BIT_NSLOTS(nbits) ((nbits + IGRAPH_INTEGER_SIZE - (igraph_int_t)(1)) / IGRAPH_INTEGER_SIZE)
  |  |  ------------------
  |  |  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  |  |  ------------------
  ------------------
  546|  96.0k|    const igraph_uint_t one = 1, zero = 0; /* to avoid the need to cast 1 and 0 to igraph_uint_t below */
  547|  96.0k|    const igraph_uint_t mask = final_block_size == IGRAPH_INTEGER_SIZE ? zero : ~((one << final_block_size) - one);
  ------------------
  |  |   32|  96.0k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
  |  Branch (547:32): [True: 4.35k, False: 91.6k]
  ------------------
  548|       |
  549|   104k|    for (igraph_int_t i = 0; i + 1 < slots; ++i) {
  ------------------
  |  Branch (549:30): [True: 56.2k, False: 48.2k]
  ------------------
  550|  56.2k|        if (VECTOR(*bitset)[i] != ~zero) {
  ------------------
  |  |   60|  56.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (550:13): [True: 47.7k, False: 8.52k]
  ------------------
  551|  47.7k|            return IGRAPH_INTEGER_SIZE * i + IGRAPH_CTO(VECTOR(*bitset)[i]);
  ------------------
  |  |   32|  47.7k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
                          return IGRAPH_INTEGER_SIZE * i + IGRAPH_CTO(VECTOR(*bitset)[i]);
  ------------------
  |  |  225|  47.7k|#define IGRAPH_CTO(x) IGRAPH_CTZ(~(x))
  |  |  ------------------
  |  |  |  |  219|  47.7k|    #define IGRAPH_CTZ IGRAPH_I_CTZ64
  |  |  |  |  ------------------
  |  |  |  |  |  |  174|  47.7k|    #define IGRAPH_I_CTZ64(x) (x ? __builtin_ctzll(x) : 64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (174:32): [True: 47.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|  47.7k|        }
  553|  56.2k|    }
  554|  48.2k|    if (bitset->size && (mask | VECTOR(*bitset)[slots - 1]) != ~zero) {
  ------------------
  |  |   60|  48.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (554:9): [True: 48.2k, False: 0]
  |  Branch (554:25): [True: 48.2k, False: 0]
  ------------------
  555|  48.2k|        return IGRAPH_INTEGER_SIZE * (slots - 1) + IGRAPH_CTO(mask | VECTOR(*bitset)[slots - 1]);
  ------------------
  |  |   32|  48.2k|#define IGRAPH_INTEGER_SIZE 64
  ------------------
                      return IGRAPH_INTEGER_SIZE * (slots - 1) + IGRAPH_CTO(mask | VECTOR(*bitset)[slots - 1]);
  ------------------
  |  |  225|  48.2k|#define IGRAPH_CTO(x) IGRAPH_CTZ(~(x))
  |  |  ------------------
  |  |  |  |  219|  48.2k|    #define IGRAPH_CTZ IGRAPH_I_CTZ64
  |  |  |  |  ------------------
  |  |  |  |  |  |  174|  48.2k|    #define IGRAPH_I_CTZ64(x) (x ? __builtin_ctzll(x) : 64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (174:32): [True: 48.2k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|  48.2k|    }
  557|       |
  558|      0|    return bitset->size;
  559|  48.2k|}

igraph_dqueue_int_init:
   75|  40.8k|igraph_error_t FUNCTION(igraph_dqueue, init)(TYPE(igraph_dqueue)* q, igraph_int_t capacity) {
   76|  40.8k|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  40.8k|    do { \
  |  |  925|  40.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
   77|  40.8k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  40.8k|    do { \
  |  |  925|  40.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
   78|       |
   79|  40.8k|    if (capacity == 0) capacity = 1;
  ------------------
  |  Branch (79:9): [True: 787, False: 40.1k]
  ------------------
   80|       |
   81|  40.8k|    q->stor_begin = IGRAPH_CALLOC(capacity, BASE);
  ------------------
  |  |   33|  40.8k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  81.7k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 40.8k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 40.8k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 40.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|  40.8k|    IGRAPH_CHECK_OOM(q->stor_begin, "Cannot initialize dqueue.");
  ------------------
  |  |  709|  40.8k|    do { \
  |  |  710|  40.8k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
   83|  40.8k|    q->stor_end = q->stor_begin + capacity;
   84|  40.8k|    q->begin = q->stor_begin;
   85|  40.8k|    q->end = NULL;
   86|       |
   87|  40.8k|    return IGRAPH_SUCCESS;
   88|  40.8k|}
igraph_dqueue_int_destroy:
  100|  40.8k|void FUNCTION(igraph_dqueue, destroy)(TYPE(igraph_dqueue)* q) {
  101|  40.8k|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  40.8k|    do { \
  |  |  925|  40.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  102|  40.8k|    IGRAPH_FREE(q->stor_begin); /* sets to NULL */
  ------------------
  |  |   36|  40.8k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  103|  40.8k|}
igraph_dqueue_int_empty:
  117|  22.7M|igraph_bool_t FUNCTION(igraph_dqueue, empty)(const TYPE(igraph_dqueue)* q) {
  118|  22.7M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  22.7M|    do { \
  |  |  925|  22.7M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.7M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.7M]
  |  |  ------------------
  ------------------
  119|  22.7M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  22.7M|    do { \
  |  |  925|  22.7M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.7M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.7M]
  |  |  ------------------
  ------------------
  120|  22.7M|    return q->end == NULL;
  121|  22.7M|}
igraph_dqueue_int_pop:
  240|  17.5M|BASE FUNCTION(igraph_dqueue, pop)(TYPE(igraph_dqueue)* q) {
  241|  17.5M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  17.5M|    do { \
  |  |  925|  17.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.5M]
  |  |  ------------------
  ------------------
  242|  17.5M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  17.5M|    do { \
  |  |  925|  17.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.5M]
  |  |  ------------------
  ------------------
  243|  17.5M|    IGRAPH_ASSERT(q->stor_end != NULL); /* queue is not empty */
  ------------------
  |  |  924|  17.5M|    do { \
  |  |  925|  17.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.5M]
  |  |  ------------------
  ------------------
  244|  17.5M|    BASE tmp = *(q->begin);
  ------------------
  |  |   66|  17.5M|    #define BASE igraph_int_t
  ------------------
  245|  17.5M|    (q->begin)++;
  246|  17.5M|    if (q->begin == q->stor_end) {
  ------------------
  |  Branch (246:9): [True: 227k, False: 17.2M]
  ------------------
  247|   227k|        q->begin = q->stor_begin;
  248|   227k|    }
  249|  17.5M|    if (q->begin == q->end) {
  ------------------
  |  Branch (249:9): [True: 6.75M, False: 10.7M]
  ------------------
  250|  6.75M|        q->end = NULL;
  251|  6.75M|    }
  252|       |
  253|  17.5M|    return tmp;
  254|  17.5M|}
igraph_dqueue_int_push:
  307|  17.5M|igraph_error_t FUNCTION(igraph_dqueue, push)(TYPE(igraph_dqueue)* q, BASE elem) {
  308|  17.5M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  17.5M|    do { \
  |  |  925|  17.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.5M]
  |  |  ------------------
  ------------------
  309|  17.5M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  17.5M|    do { \
  |  |  925|  17.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.5M]
  |  |  ------------------
  ------------------
  310|  17.5M|    if (q->begin != q->end) {
  ------------------
  |  Branch (310:9): [True: 17.5M, False: 6.05k]
  ------------------
  311|       |        /* not full */
  312|  17.5M|        if (q->end == NULL) {
  ------------------
  |  Branch (312:13): [True: 6.75M, False: 10.7M]
  ------------------
  313|  6.75M|            q->end = q->begin;
  314|  6.75M|        }
  315|  17.5M|        *(q->end) = elem;
  316|  17.5M|        (q->end)++;
  317|  17.5M|        if (q->end == q->stor_end) {
  ------------------
  |  Branch (317:13): [True: 233k, False: 17.2M]
  ------------------
  318|   233k|            q->end = q->stor_begin;
  319|   233k|        }
  320|  17.5M|    } else {
  321|       |        /* full, allocate more storage */
  322|       |
  323|  6.05k|        BASE *bigger = NULL, *old = q->stor_begin;
  ------------------
  |  |   66|  6.05k|    #define BASE igraph_int_t
  ------------------
  324|  6.05k|        igraph_int_t old_size = q->stor_end - q->stor_begin;
  325|  6.05k|        igraph_int_t new_capacity = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  6.05k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_capacity = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  6.05k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (325:37): [True: 6.05k, False: 0]
  ------------------
  326|       |
  327|  6.05k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  6.05k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (327:13): [True: 0, False: 6.05k]
  ------------------
  328|      0|            IGRAPH_ERROR("Cannot push to dqueue, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  329|      0|        }
  330|  6.05k|        if (new_capacity == 0) {
  ------------------
  |  Branch (330:13): [True: 0, False: 6.05k]
  ------------------
  331|      0|            new_capacity = 1;
  332|      0|        }
  333|       |
  334|  6.05k|        bigger = IGRAPH_CALLOC(new_capacity, BASE);
  ------------------
  |  |   33|  6.05k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  12.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 6.05k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 6.05k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 6.05k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  335|  6.05k|        IGRAPH_CHECK_OOM(bigger, "Cannot push to dqueue.");
  ------------------
  |  |  709|  6.05k|    do { \
  |  |  710|  6.05k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  6.05k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  6.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 6.05k]
  |  |  ------------------
  ------------------
  336|       |
  337|  6.05k|        if (q->stor_end - q->begin > 0) {
  ------------------
  |  Branch (337:13): [True: 6.05k, False: 0]
  ------------------
  338|  6.05k|            memcpy(bigger, q->begin,
  339|  6.05k|                   (size_t)(q->stor_end - q->begin) * sizeof(BASE));
  340|  6.05k|        }
  341|  6.05k|        if (q->end - q->stor_begin > 0) {
  ------------------
  |  Branch (341:13): [True: 2.95k, False: 3.10k]
  ------------------
  342|  2.95k|            memcpy(bigger + (q->stor_end - q->begin), q->stor_begin,
  343|  2.95k|                   (size_t)(q->end - q->stor_begin) * sizeof(BASE));
  344|  2.95k|        }
  345|       |
  346|  6.05k|        q->end        = bigger + old_size;
  347|  6.05k|        q->stor_end   = bigger + new_capacity;
  348|  6.05k|        q->stor_begin = bigger;
  349|  6.05k|        q->begin      = bigger;
  350|       |
  351|  6.05k|        *(q->end) = elem;
  352|  6.05k|        (q->end)++;
  353|  6.05k|        if (q->end == q->stor_end) {
  ------------------
  |  Branch (353:13): [True: 778, False: 5.27k]
  ------------------
  354|    778|            q->end = q->stor_begin;
  355|    778|        }
  356|       |
  357|  6.05k|        IGRAPH_FREE(old);
  ------------------
  |  |   36|  6.05k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  358|  6.05k|    }
  359|       |
  360|  17.5M|    return IGRAPH_SUCCESS;
  361|  17.5M|}

IGRAPH_FINALLY_REAL:
  320|  16.6M|void IGRAPH_FINALLY_REAL(void (*func)(void*), void* ptr) {
  321|  16.6M|    int no = igraph_i_finally_stack_size;
  322|  16.6M|    if (no < 0) {
  ------------------
  |  Branch (322:9): [True: 0, False: 16.6M]
  ------------------
  323|       |        /* Reset finally stack in case fatal error handler does a longjmp instead of terminating the process: */
  324|      0|        igraph_i_reset_finally_stack();
  325|      0|        IGRAPH_FATALF("Corrupt finally stack: it contains %d elements.", no);
  ------------------
  |  |  875|      0|    do { \
  |  |  876|      0|        igraph_fatalf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  877|      0|                      __VA_ARGS__); \
  |  |  878|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (878:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  326|      0|    }
  327|  16.6M|    if (no >= (int) (sizeof(igraph_i_finally_stack) / sizeof(igraph_i_finally_stack[0]))) {
  ------------------
  |  Branch (327:9): [True: 0, False: 16.6M]
  ------------------
  328|       |        /* Reset finally stack in case fatal error handler does a longjmp instead of terminating the process: */
  329|      0|        igraph_i_reset_finally_stack();
  330|      0|        IGRAPH_FATALF("Finally stack too large: it contains %d elements.", no);
  ------------------
  |  |  875|      0|    do { \
  |  |  876|      0|        igraph_fatalf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  877|      0|                      __VA_ARGS__); \
  |  |  878|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (878:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  331|      0|    }
  332|  16.6M|    igraph_i_finally_stack[no].ptr = ptr;
  333|  16.6M|    igraph_i_finally_stack[no].func = func;
  334|  16.6M|    igraph_i_finally_stack[no].level = igraph_i_finally_stack_level;
  335|  16.6M|    igraph_i_finally_stack_size++;
  336|  16.6M|}
IGRAPH_FINALLY_CLEAN:
  338|  8.12M|void IGRAPH_FINALLY_CLEAN(int minus) {
  339|  8.12M|    igraph_i_finally_stack_size -= minus;
  340|  8.12M|    if (igraph_i_finally_stack_size < 0) {
  ------------------
  |  Branch (340:9): [True: 0, False: 8.12M]
  ------------------
  341|      0|        int left = igraph_i_finally_stack_size + minus;
  342|       |        /* Reset finally stack in case fatal error handler does a longjmp instead of terminating the process: */
  343|      0|        igraph_i_reset_finally_stack();
  344|      0|        IGRAPH_FATALF("Corrupt finally stack: trying to pop %d element(s) when only %d left.", minus, left);
  ------------------
  |  |  875|      0|    do { \
  |  |  876|      0|        igraph_fatalf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  877|      0|                      __VA_ARGS__); \
  |  |  878|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (878:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  345|      0|    }
  346|  8.12M|}
IGRAPH_FINALLY_STACK_SIZE:
  359|  3.56k|int IGRAPH_FINALLY_STACK_SIZE(void) {
  360|  3.56k|    return igraph_i_finally_stack_size;
  361|  3.56k|}
IGRAPH_FINALLY_ENTER:
  377|   397k|void IGRAPH_FINALLY_ENTER(void) {
  378|   397k|    int no = igraph_i_finally_stack_size;
  379|       |    /* Level indices must always be in increasing order in the finally stack */
  380|   397k|    if (no > 0 && igraph_i_finally_stack[no-1].level > igraph_i_finally_stack_level) {
  ------------------
  |  Branch (380:9): [True: 397k, False: 0]
  |  Branch (380:19): [True: 0, False: 397k]
  ------------------
  381|       |        /* Reset finally stack in case fatal error handler does a longjmp instead of terminating the process: */
  382|      0|        igraph_i_reset_finally_stack();
  383|      0|        IGRAPH_FATAL("Corrupt finally stack: cannot create new finally stack level before last one is freed.");
  ------------------
  |  |  895|      0|    do { \
  |  |  896|      0|        igraph_fatal(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  897|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (897:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  384|      0|    }
  385|   397k|    igraph_i_finally_stack_level++;
  386|   397k|}
IGRAPH_FINALLY_EXIT:
  399|   397k|void IGRAPH_FINALLY_EXIT(void) {
  400|   397k|    igraph_i_finally_stack_level--;
  401|   397k|    if (igraph_i_finally_stack_level < 0) {
  ------------------
  |  Branch (401:9): [True: 0, False: 397k]
  ------------------
  402|       |        /* Reset finally stack in case fatal error handler does a longjmp instead of terminating the process: */
  403|      0|        igraph_i_reset_finally_stack();
  404|      0|        IGRAPH_FATAL("Corrupt finally stack: trying to exit outermost finally stack level.");
  ------------------
  |  |  895|      0|    do { \
  |  |  896|      0|        igraph_fatal(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  897|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (897:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  405|      0|    }
  406|   397k|}
igraph_set_warning_handler:
  514|  3.58k|igraph_warning_handler_t *igraph_set_warning_handler(igraph_warning_handler_t *new_handler) {
  515|  3.58k|    igraph_warning_handler_t *previous_handler = igraph_i_warning_handler;
  516|  3.58k|    igraph_i_warning_handler = new_handler;
  517|  3.58k|    return previous_handler;
  518|  3.58k|}

igraph_fixed_vectorlist_destroy:
   25|  7.08k|void igraph_fixed_vectorlist_destroy(igraph_fixed_vectorlist_t *l) {
   26|  7.08k|    igraph_vector_int_list_destroy(&l->vecs);
   27|  7.08k|}
igraph_fixed_vectorlist_convert:
   32|  7.08k|) {
   33|  7.08k|    igraph_vector_int_t sizes;
   34|  7.08k|    igraph_int_t i, no = igraph_vector_int_size(from), to;
   35|       |
   36|  7.08k|    IGRAPH_VECTOR_INT_LIST_INIT_FINALLY(&l->vecs, size);
  ------------------
  |  |   58|  7.08k|    do { IGRAPH_CHECK(igraph_vector_int_list_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_list_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (59:69): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   37|  7.08k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&sizes, size);
  ------------------
  |  |  119|  7.08k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.08k|    do { \
  |  |  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.08k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.08k|    do { \
  |  |  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   38|       |
   39|   160k|    for (i = 0; i < no; i++) {
  ------------------
  |  Branch (39:17): [True: 153k, False: 7.08k]
  ------------------
   40|   153k|        to = VECTOR(*from)[i];
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   41|   153k|        if (to >= 0) {
  ------------------
  |  Branch (41:13): [True: 129k, False: 24.2k]
  ------------------
   42|   129k|            VECTOR(sizes)[to] += 1;
  ------------------
  |  |   60|   129k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   43|   129k|        }
   44|   153k|    }
   45|       |
   46|   160k|    for (i = 0; i < no; i++) {
  ------------------
  |  Branch (46:17): [True: 153k, False: 7.08k]
  ------------------
   47|   153k|        to = VECTOR(*from)[i];
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   48|   153k|        if (to >= 0) {
  ------------------
  |  Branch (48:13): [True: 129k, False: 24.2k]
  ------------------
   49|   129k|            igraph_vector_int_t *v = igraph_vector_int_list_get_ptr(&l->vecs, to);
   50|   129k|            IGRAPH_CHECK(igraph_vector_int_push_back(v, i));
  ------------------
  |  |  656|   129k|    do { \
  |  |  657|   129k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   129k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   129k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 129k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   129k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 129k]
  |  |  ------------------
  ------------------
   51|   129k|        }
   52|   153k|    }
   53|       |
   54|  7.08k|    igraph_vector_int_destroy(&sizes);
   55|  7.08k|    IGRAPH_FINALLY_CLEAN(2);  /* + l->vecs */
   56|       |
   57|  7.08k|    return IGRAPH_SUCCESS;
   58|  7.08k|}

igraph_2wheap_init:
  800|  6.86k|igraph_error_t igraph_2wheap_init(igraph_2wheap_t *h, igraph_int_t max_size) {
  801|  6.86k|    h->max_size = max_size;
  802|       |    /* We start with the biggest */
  803|  6.86k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&h->index2, max_size);
  ------------------
  |  |  119|  6.86k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.86k|    do { \
  |  |  |  |  657|  6.86k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.86k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.86k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.86k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.86k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.86k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.86k|    do { \
  |  |  |  |  604|  6.86k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.86k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.86k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.86k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.86k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.86k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.86k]
  |  |  ------------------
  ------------------
  804|  6.86k|    IGRAPH_VECTOR_INIT_FINALLY(&h->data, 0);
  ------------------
  |  |  104|  6.86k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.86k|    do { \
  |  |  |  |  657|  6.86k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.86k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.86k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.86k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  6.86k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  6.86k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.86k|    do { \
  |  |  |  |  604|  6.86k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.86k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.86k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.86k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.86k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.86k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 6.86k]
  |  |  ------------------
  ------------------
  805|  6.86k|    IGRAPH_CHECK(igraph_vector_int_init(&h->index, 0));
  ------------------
  |  |  656|  6.86k|    do { \
  |  |  657|  6.86k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.86k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.86k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  6.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.86k]
  |  |  ------------------
  ------------------
  806|       |    /* IGRAPH_FINALLY(igraph_vector_int_destroy, &h->index); */
  807|       |
  808|  6.86k|    IGRAPH_FINALLY_CLEAN(2);
  809|  6.86k|    return IGRAPH_SUCCESS;
  810|  6.86k|}
igraph_2wheap_destroy:
  815|  6.86k|void igraph_2wheap_destroy(igraph_2wheap_t *h) {
  816|  6.86k|    igraph_vector_destroy(&h->data);
  817|  6.86k|    igraph_vector_int_destroy(&h->index);
  818|  6.86k|    igraph_vector_int_destroy(&h->index2);
  819|  6.86k|}
igraph_2wheap_clear:
  824|   262k|void igraph_2wheap_clear(igraph_2wheap_t *h) {
  825|   262k|    igraph_vector_clear(&h->data);
  826|   262k|    igraph_vector_int_clear(&h->index);
  827|   262k|    igraph_vector_int_null(&h->index2);
  828|   262k|}
igraph_2wheap_empty:
  833|   812k|igraph_bool_t igraph_2wheap_empty(const igraph_2wheap_t *h) {
  834|   812k|    return igraph_vector_empty(&h->data);
  835|   812k|}
igraph_2wheap_push_with_index:
  844|   550k|                                  igraph_int_t idx, igraph_real_t elem) {
  845|       |
  846|       |    /*   printf("-> %.2g [%li]\n", elem, idx); */
  847|       |
  848|   550k|    igraph_int_t size = igraph_vector_size(&h->data);
  849|       |
  850|   550k|    if (size > IGRAPH_INTEGER_MAX - 2) {
  ------------------
  |  |   72|   550k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (850:9): [True: 0, False: 550k]
  ------------------
  851|       |        /* to allow size+2 below */
  852|      0|        IGRAPH_ERROR("Cannot push to 2wheap, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  853|      0|    }
  854|       |
  855|   550k|    IGRAPH_CHECK(igraph_vector_push_back(&h->data, elem));
  ------------------
  |  |  656|   550k|    do { \
  |  |  657|   550k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   550k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  856|   550k|    IGRAPH_CHECK(igraph_vector_int_push_back(&h->index, idx));
  ------------------
  |  |  656|   550k|    do { \
  |  |  657|   550k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   550k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  857|   550k|    VECTOR(h->index2)[idx] = size + 2;
  ------------------
  |  |   60|   550k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  858|       |
  859|       |    /* maintain heap */
  860|   550k|    igraph_i_2wheap_shift_up(h, size);
  861|   550k|    return IGRAPH_SUCCESS;
  862|   550k|}
igraph_2wheap_size:
  867|  1.29M|igraph_int_t igraph_2wheap_size(const igraph_2wheap_t *h) {
  868|  1.29M|    return igraph_vector_size(&h->data);
  869|  1.29M|}
igraph_2wheap_max_index:
  891|   550k|igraph_int_t igraph_2wheap_max_index(const igraph_2wheap_t *h) {
  892|   550k|    return VECTOR(h->index)[0];
  ------------------
  |  |   60|   550k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  893|   550k|}
igraph_2wheap_has_elem:
  899|   337k|igraph_bool_t igraph_2wheap_has_elem(const igraph_2wheap_t *h, igraph_int_t idx) {
  900|   337k|    return (VECTOR(h->index2)[idx] != 0);
  ------------------
  |  |   60|   337k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  901|   337k|}
igraph_2wheap_has_active:
  907|  49.9k|igraph_bool_t igraph_2wheap_has_active(const igraph_2wheap_t *h, igraph_int_t idx) {
  908|  49.9k|    return VECTOR(h->index2)[idx] > 1;
  ------------------
  |  |   60|  49.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  909|  49.9k|}
igraph_2wheap_get:
  914|  18.5k|igraph_real_t igraph_2wheap_get(const igraph_2wheap_t *h, igraph_int_t idx) {
  915|  18.5k|    igraph_int_t i = VECTOR(h->index2)[idx] - 2;
  ------------------
  |  |   60|  18.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  916|  18.5k|    return VECTOR(h->data)[i];
  ------------------
  |  |   60|  18.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  917|  18.5k|}
igraph_2wheap_deactivate_max:
  946|   550k|igraph_real_t igraph_2wheap_deactivate_max(igraph_2wheap_t *h) {
  947|       |
  948|   550k|    igraph_real_t tmp = VECTOR(h->data)[0];
  ------------------
  |  |   60|   550k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  949|   550k|    igraph_int_t tmpidx = VECTOR(h->index)[0];
  ------------------
  |  |   60|   550k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  950|   550k|    igraph_i_2wheap_switch(h, 0, igraph_2wheap_size(h) - 1);
  951|   550k|    igraph_vector_pop_back(&h->data);
  952|   550k|    igraph_vector_int_pop_back(&h->index);
  953|   550k|    VECTOR(h->index2)[tmpidx] = 1;
  ------------------
  |  |   60|   550k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  954|   550k|    igraph_i_2wheap_sink(h, 0);
  955|       |
  956|   550k|    return tmp;
  957|   550k|}
igraph_2wheap_modify:
  985|  4.06k|void igraph_2wheap_modify(igraph_2wheap_t *h, igraph_int_t idx, igraph_real_t elem) {
  986|       |
  987|  4.06k|    igraph_int_t pos = VECTOR(h->index2)[idx] - 2;
  ------------------
  |  |   60|  4.06k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  988|       |
  989|       |    /*   printf("-- %.2g -> %.2g\n", VECTOR(h->data)[pos], elem); */
  990|       |
  991|  4.06k|    VECTOR(h->data)[pos] = elem;
  ------------------
  |  |   60|  4.06k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  992|  4.06k|    igraph_i_2wheap_sink(h, pos);
  993|  4.06k|    igraph_i_2wheap_shift_up(h, pos);
  994|  4.06k|}
indheap.c:igraph_i_2wheap_shift_up:
  762|   855k|                                     igraph_int_t elem) {
  763|   855k|    if (elem == 0 || VECTOR(h->data)[elem] < VECTOR(h->data)[PARENT(elem)]) {
  ------------------
  |  |   60|   389k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                  if (elem == 0 || VECTOR(h->data)[elem] < VECTOR(h->data)[PARENT(elem)]) {
  ------------------
  |  |   60|   389k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                  if (elem == 0 || VECTOR(h->data)[elem] < VECTOR(h->data)[PARENT(elem)]) {
  ------------------
  |  |  733|   389k|#define PARENT(x)     (((x)+1)/2-1)
  ------------------
  |  Branch (763:9): [True: 466k, False: 389k]
  |  Branch (763:22): [True: 87.8k, False: 301k]
  ------------------
  764|       |        /* at the top */
  765|   554k|    } else {
  766|   301k|        igraph_i_2wheap_switch(h, elem, PARENT(elem));
  ------------------
  |  |  733|   301k|#define PARENT(x)     (((x)+1)/2-1)
  ------------------
  767|   301k|        igraph_i_2wheap_shift_up(h, PARENT(elem));
  ------------------
  |  |  733|   301k|#define PARENT(x)     (((x)+1)/2-1)
  ------------------
  768|   301k|    }
  769|   855k|}
indheap.c:igraph_i_2wheap_switch:
  743|  1.03M|                                   igraph_int_t e1, igraph_int_t e2) {
  744|  1.03M|    if (e1 != e2) {
  ------------------
  |  Branch (744:9): [True: 697k, False: 341k]
  ------------------
  745|   697k|        igraph_int_t tmp1, tmp2;
  746|   697k|        igraph_real_t tmp3 = VECTOR(h->data)[e1];
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  747|   697k|        VECTOR(h->data)[e1] = VECTOR(h->data)[e2];
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(h->data)[e1] = VECTOR(h->data)[e2];
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  748|   697k|        VECTOR(h->data)[e2] = tmp3;
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  749|       |
  750|   697k|        tmp1 = VECTOR(h->index)[e1];
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  751|   697k|        tmp2 = VECTOR(h->index)[e2];
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  752|       |
  753|   697k|        VECTOR(h->index2)[tmp1] = e2 + 2;
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  754|   697k|        VECTOR(h->index2)[tmp2] = e1 + 2;
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  755|       |
  756|   697k|        VECTOR(h->index)[e1] = tmp2;
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  757|   697k|        VECTOR(h->index)[e2] = tmp1;
  ------------------
  |  |   60|   697k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  758|   697k|    }
  759|  1.03M|}
indheap.c:igraph_i_2wheap_sink:
  772|   741k|                                 igraph_int_t head) {
  773|   741k|    igraph_int_t size = igraph_2wheap_size(h);
  774|   741k|    if (LEFTCHILD(head) >= size) {
  ------------------
  |  |  734|   741k|#define LEFTCHILD(x)  (((x)+1)*2-1)
  ------------------
  |  Branch (774:9): [True: 468k, False: 273k]
  ------------------
  775|       |        /* no subtrees */
  776|   468k|    } else if (RIGHTCHILD(head) == size ||
  ------------------
  |  |  735|   273k|#define RIGHTCHILD(x) (((x)+1)*2)
  ------------------
  |  Branch (776:16): [True: 43.0k, False: 230k]
  ------------------
  777|   230k|               VECTOR(h->data)[LEFTCHILD(head)] >= VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |   60|   230k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                             VECTOR(h->data)[LEFTCHILD(head)] >= VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |  734|   230k|#define LEFTCHILD(x)  (((x)+1)*2-1)
  ------------------
                             VECTOR(h->data)[LEFTCHILD(head)] >= VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |   60|   230k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                             VECTOR(h->data)[LEFTCHILD(head)] >= VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |  735|   230k|#define RIGHTCHILD(x) (((x)+1)*2)
  ------------------
  |  Branch (777:16): [True: 162k, False: 67.6k]
  ------------------
  778|       |        /* sink to the left if needed */
  779|   205k|        if (VECTOR(h->data)[head] < VECTOR(h->data)[LEFTCHILD(head)]) {
  ------------------
  |  |   60|   205k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(h->data)[head] < VECTOR(h->data)[LEFTCHILD(head)]) {
  ------------------
  |  |   60|   205k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(h->data)[head] < VECTOR(h->data)[LEFTCHILD(head)]) {
  ------------------
  |  |  734|   205k|#define LEFTCHILD(x)  (((x)+1)*2-1)
  ------------------
  |  Branch (779:13): [True: 124k, False: 81.6k]
  ------------------
  780|   124k|            igraph_i_2wheap_switch(h, head, LEFTCHILD(head));
  ------------------
  |  |  734|   124k|#define LEFTCHILD(x)  (((x)+1)*2-1)
  ------------------
  781|   124k|            igraph_i_2wheap_sink(h, LEFTCHILD(head));
  ------------------
  |  |  734|   124k|#define LEFTCHILD(x)  (((x)+1)*2-1)
  ------------------
  782|   124k|        }
  783|   205k|    } else {
  784|       |        /* sink to the right */
  785|  67.6k|        if (VECTOR(h->data)[head] < VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |   60|  67.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(h->data)[head] < VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |   60|  67.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(h->data)[head] < VECTOR(h->data)[RIGHTCHILD(head)]) {
  ------------------
  |  |  735|  67.6k|#define RIGHTCHILD(x) (((x)+1)*2)
  ------------------
  |  Branch (785:13): [True: 63.2k, False: 4.46k]
  ------------------
  786|  63.2k|            igraph_i_2wheap_switch(h, head, RIGHTCHILD(head));
  ------------------
  |  |  735|  63.2k|#define RIGHTCHILD(x) (((x)+1)*2)
  ------------------
  787|  63.2k|            igraph_i_2wheap_sink(h, RIGHTCHILD(head));
  ------------------
  |  |  735|  63.2k|#define RIGHTCHILD(x) (((x)+1)*2)
  ------------------
  788|  63.2k|        }
  789|  67.6k|    }
  790|   741k|}

igraph_matrix_init:
   64|  3.54k|        TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
   65|  3.54k|    igraph_int_t size;
   66|  3.54k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  3.54k|    do { \
  |  |  925|  3.54k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  Branch (612:52): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 3.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
   67|  3.54k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  3.54k|    do { \
  |  |   58|  3.54k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  3.54k|        igraph_int_t _safe_prod; \
  |  |   60|  3.54k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 3.54k]
  |  |  ------------------
  |  |   61|      0|            IGRAPH_ERRORF("Overflow when multiplying %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|        } \
  |  |   63|  3.54k|        *(res) = _safe_prod; \
  |  |   64|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
   68|  3.54k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(&m->data, size));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
   69|  3.54k|    m->nrow = nrow;
   70|  3.54k|    m->ncol = ncol;
   71|  3.54k|    return IGRAPH_SUCCESS;
   72|  3.54k|}
igraph_matrix_destroy:
  176|  3.54k|void FUNCTION(igraph_matrix, destroy)(TYPE(igraph_matrix) *m) {
  177|  3.54k|    FUNCTION(igraph_vector, destroy)(&m->data);
  ------------------
  |  |  170|  3.54k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.54k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.54k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  3.54k|}
igraph_matrix_resize:
  229|  3.54k|igraph_error_t FUNCTION(igraph_matrix, resize)(TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
  230|  3.54k|    igraph_int_t size;
  231|  3.54k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  3.54k|    do { \
  |  |  925|  3.54k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  Branch (612:52): [True: 3.54k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 3.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  232|  3.54k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  3.54k|    do { \
  |  |   58|  3.54k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  3.54k|        igraph_int_t _safe_prod; \
  |  |   60|  3.54k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 3.54k]
  |  |  ------------------
  |  |   61|      0|            IGRAPH_ERRORF("Overflow when multiplying %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|        } \
  |  |   63|  3.54k|        *(res) = _safe_prod; \
  |  |   64|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  233|  3.54k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, size));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  234|  3.54k|    m->nrow = nrow;
  235|  3.54k|    m->ncol = ncol;
  236|  3.54k|    return IGRAPH_SUCCESS;
  237|  3.54k|}
igraph_matrix_null:
  380|  3.54k|void FUNCTION(igraph_matrix, null)(TYPE(igraph_matrix) *m) {
  381|  3.54k|    FUNCTION(igraph_vector, null)(&m->data);
  ------------------
  |  |  170|  3.54k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.54k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.54k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  3.54k|}
igraph_matrix_int_init:
   64|  7.08k|        TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
   65|  7.08k|    igraph_int_t size;
   66|  7.08k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  7.08k|    do { \
  |  |  925|  7.08k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  |  Branch (612:52): [True: 7.08k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 7.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   67|  7.08k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  7.08k|    do { \
  |  |   58|  7.08k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  7.08k|        igraph_int_t _safe_prod; \
  |  |   60|  7.08k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 7.08k]
  |  |  ------------------
  |  |   61|      0|            IGRAPH_ERRORF("Overflow when multiplying %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|        } \
  |  |   63|  7.08k|        *(res) = _safe_prod; \
  |  |   64|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   68|  7.08k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(&m->data, size));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
   69|  7.08k|    m->nrow = nrow;
   70|  7.08k|    m->ncol = ncol;
   71|  7.08k|    return IGRAPH_SUCCESS;
   72|  7.08k|}
igraph_matrix_int_destroy:
  176|  7.08k|void FUNCTION(igraph_matrix, destroy)(TYPE(igraph_matrix) *m) {
  177|  7.08k|    FUNCTION(igraph_vector, destroy)(&m->data);
  ------------------
  |  |  178|  7.08k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.08k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.08k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  7.08k|}
igraph_matrix_int_resize:
  229|  17.1k|igraph_error_t FUNCTION(igraph_matrix, resize)(TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
  230|  17.1k|    igraph_int_t size;
  231|  17.1k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  17.1k|    do { \
  |  |  925|  17.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  34.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (612:52): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 17.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
  232|  17.1k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  17.1k|    do { \
  |  |   58|  17.1k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  17.1k|        igraph_int_t _safe_prod; \
  |  |   60|  17.1k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 17.1k]
  |  |  ------------------
  |  |   61|      0|            IGRAPH_ERRORF("Overflow when multiplying %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|        } \
  |  |   63|  17.1k|        *(res) = _safe_prod; \
  |  |   64|  17.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
  233|  17.1k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, size));
  ------------------
  |  |  656|  17.1k|    do { \
  |  |  657|  17.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  17.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
  234|  17.1k|    m->nrow = nrow;
  235|  17.1k|    m->ncol = ncol;
  236|  17.1k|    return IGRAPH_SUCCESS;
  237|  17.1k|}
igraph_matrix_int_nrow:
  285|  10.0k|igraph_int_t FUNCTION(igraph_matrix, nrow)(const TYPE(igraph_matrix) *m) {
  286|  10.0k|    return m->nrow;
  287|  10.0k|}
igraph_matrix_int_ncol:
  300|  7.08k|igraph_int_t FUNCTION(igraph_matrix, ncol)(const TYPE(igraph_matrix) *m) {
  301|  7.08k|    return m->ncol;
  302|  7.08k|}
igraph_matrix_int_null:
  380|  3.54k|void FUNCTION(igraph_matrix, null)(TYPE(igraph_matrix) *m) {
  381|  3.54k|    FUNCTION(igraph_vector, null)(&m->data);
  ------------------
  |  |  178|  3.54k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  3.54k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  3.54k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  3.54k|}
igraph_matrix_int_add_rows:
  417|  4.27k|igraph_error_t FUNCTION(igraph_matrix, add_rows)(TYPE(igraph_matrix) *m, igraph_int_t n) {
  418|  4.27k|    igraph_int_t new_nrow, new_size;
  419|  4.27k|    IGRAPH_SAFE_ADD(m->nrow, n, &new_nrow);
  ------------------
  |  |   47|  4.27k|    do { \
  |  |   48|  4.27k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  4.27k|        igraph_int_t _safe_sum; \
  |  |   50|  4.27k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 4.27k]
  |  |  ------------------
  |  |   51|      0|            IGRAPH_ERRORF("Overflow when adding %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|        } \
  |  |   53|  4.27k|        *(res) = _safe_sum; \
  |  |   54|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  420|  4.27k|    IGRAPH_SAFE_MULT(m->ncol, new_nrow, &new_size);
  ------------------
  |  |   57|  4.27k|    do { \
  |  |   58|  4.27k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  4.27k|        igraph_int_t _safe_prod; \
  |  |   60|  4.27k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 4.27k]
  |  |  ------------------
  |  |   61|      0|            IGRAPH_ERRORF("Overflow when multiplying %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|        } \
  |  |   63|  4.27k|        *(res) = _safe_prod; \
  |  |   64|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  421|  4.27k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, new_size));
  ------------------
  |  |  656|  4.27k|    do { \
  |  |  657|  4.27k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.27k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.27k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  422|   202k|    for (igraph_int_t i = m->ncol - 1; i >= 0; i--) {
  ------------------
  |  Branch (422:40): [True: 198k, False: 4.27k]
  ------------------
  423|   198k|        FUNCTION(igraph_vector, move_interval)(&m->data, (m->nrow)*i, (m->nrow) * (i + 1),
  ------------------
  |  |  178|   198k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   198k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   198k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|   198k|                                                new_nrow * i);
  425|   198k|    }
  426|  4.27k|    m->nrow = new_nrow;
  427|  4.27k|    return IGRAPH_SUCCESS;
  428|  4.27k|}
igraph_matrix_int_permdelete_rows:
  459|  3.00k|        TYPE(igraph_matrix) *m, igraph_int_t *index, igraph_int_t nremove) {
  460|  3.00k|    igraph_int_t i, j;
  461|   149k|    for (j = 0; j < m->nrow; j++) {
  ------------------
  |  Branch (461:17): [True: 146k, False: 3.00k]
  ------------------
  462|   146k|        if (index[j] != 0) {
  ------------------
  |  Branch (462:13): [True: 37.3k, False: 109k]
  ------------------
  463|   111k|            for (i = 0; i < m->ncol; i++) {
  ------------------
  |  Branch (463:25): [True: 74.6k, False: 37.3k]
  ------------------
  464|  74.6k|                MATRIX(*m, index[j] - 1, i) = MATRIX(*m, j, i);
  ------------------
  |  |   83|  74.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                              MATRIX(*m, index[j] - 1, i) = MATRIX(*m, j, i);
  ------------------
  |  |   83|  74.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  465|  74.6k|            }
  466|  37.3k|        }
  467|   146k|    }
  468|       |    /* Remove unnecessary elements from the end of each column */
  469|  9.01k|    for (i = 0; i < m->ncol; i++)
  ------------------
  |  Branch (469:17): [True: 6.01k, False: 3.00k]
  ------------------
  470|  6.01k|        FUNCTION(igraph_vector, remove_section)(&m->data,
  ------------------
  |  |  178|  6.01k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.01k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.01k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|  6.01k|                                                (i + 1) * (m->nrow - nremove), (i + 1) * (m->nrow - nremove) + nremove);
  472|  3.00k|    IGRAPH_CHECK(FUNCTION(igraph_matrix, resize)(m, m->nrow - nremove, m->ncol));
  ------------------
  |  |  656|  3.00k|    do { \
  |  |  657|  3.00k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.00k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.00k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.00k]
  |  |  ------------------
  ------------------
  473|       |
  474|  3.00k|    return IGRAPH_SUCCESS;
  475|  3.00k|}
igraph_matrix_int_set_row:
 1144|  4.27k|                                     const TYPE(igraph_vector) *v, igraph_int_t index) {
 1145|  4.27k|    const igraph_int_t rows = m->nrow, cols = m->ncol;
 1146|       |
 1147|  4.27k|    if (index >= rows) {
  ------------------
  |  Branch (1147:9): [True: 0, False: 4.27k]
  ------------------
 1148|      0|        IGRAPH_ERROR("Index out of range for selecting matrix row.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1149|      0|    }
 1150|  4.27k|    if (FUNCTION(igraph_vector, size)(v) != cols) {
  ------------------
  |  |  178|  4.27k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  4.27k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  4.27k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1150:9): [True: 0, False: 4.27k]
  ------------------
 1151|      0|        IGRAPH_ERROR("Cannot set matrix row, invalid vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1152|      0|    }
 1153|   202k|    for (igraph_int_t i = index, j = 0; j < cols; i += rows, j++) {
  ------------------
  |  Branch (1153:41): [True: 198k, False: 4.27k]
  ------------------
 1154|   198k|        VECTOR(m->data)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(m->data)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1155|   198k|    }
 1156|  4.27k|    return IGRAPH_SUCCESS;
 1157|  4.27k|}

igraph_free:
   62|  2.30M|void igraph_free(void *ptr) {
   63|       |    IGRAPH_FREE(ptr);
  ------------------
  |  |   36|  2.30M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
   64|  2.30M|}

igraph_progress:
   53|   148k|igraph_error_t igraph_progress(const char *message, igraph_real_t percent, void *data) {
   54|   148k|    if (igraph_i_progress_handler) {
  ------------------
  |  Branch (54:9): [True: 0, False: 148k]
  ------------------
   55|      0|        return igraph_i_progress_handler(message, percent, data);
   56|      0|    }
   57|   148k|    return IGRAPH_SUCCESS;
   58|   148k|}

igraph_sparsemat_init:
  109|  17.6k|        igraph_int_t cols, igraph_int_t nzmax) {
  110|  17.6k|    IGRAPH_STATIC_ASSERT(sizeof(igraph_int_t) == sizeof(CS_INT));
  ------------------
  |  |   68|  17.6k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
  111|  17.6k|    IGRAPH_STATIC_ASSERT(sizeof(igraph_real_t) == sizeof(CS_ENTRY));
  ------------------
  |  |   68|  17.6k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
  112|       |
  113|  17.6k|    if (rows < 0) {
  ------------------
  |  Branch (113:9): [True: 0, False: 17.6k]
  ------------------
  114|      0|        IGRAPH_ERROR("Negative number of rows", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  115|      0|    }
  116|  17.6k|    if (cols < 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 17.6k]
  ------------------
  117|      0|        IGRAPH_ERROR("Negative number of columns", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  118|      0|    }
  119|       |
  120|  17.6k|    A->cs = cs_spalloc( rows, cols, nzmax, /*values=*/ 1,
  ------------------
  |  |  250|  17.6k|#define cs_spalloc CS_NAME (_spalloc)
  |  |  ------------------
  |  |  |  |  213|  17.6k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  121|  17.6k|                        /*triplet=*/ 1);
  122|  17.6k|    if (!A->cs) {
  ------------------
  |  Branch (122:9): [True: 0, False: 17.6k]
  ------------------
  123|      0|        IGRAPH_ERROR("Cannot allocate memory for sparse matrix", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  124|      0|    }
  125|       |
  126|  17.6k|    return IGRAPH_SUCCESS;
  127|  17.6k|}
igraph_sparsemat_destroy:
  181|  35.3k|void igraph_sparsemat_destroy(igraph_sparsemat_t *A) {
  182|  35.3k|    cs_spfree(A->cs);
  ------------------
  |  |  251|  35.3k|#define cs_spfree CS_NAME (_spfree)
  |  |  ------------------
  |  |  |  |  213|  35.3k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  183|  35.3k|}
igraph_sparsemat_realloc:
  201|  10.5k|igraph_error_t igraph_sparsemat_realloc(igraph_sparsemat_t *A, igraph_int_t nzmax) {
  202|  10.5k|    if (!cs_sprealloc(A->cs, nzmax)) {
  ------------------
  |  |  252|  10.5k|#define cs_sprealloc CS_NAME (_sprealloc)
  |  |  ------------------
  |  |  |  |  213|  10.5k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (202:9): [True: 0, False: 10.5k]
  ------------------
  203|      0|        IGRAPH_ERROR("Could not allocate more memory for sparse matrix.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  204|      0|    }
  205|  10.5k|    return IGRAPH_SUCCESS;
  206|  10.5k|}
igraph_sparsemat_nrow:
  218|  10.5k|igraph_int_t igraph_sparsemat_nrow(const igraph_sparsemat_t *A) {
  219|  10.5k|    return A->cs->m;
  220|  10.5k|}
igraph_sparsemat_ncol:
  232|  10.5k|igraph_int_t igraph_sparsemat_ncol(const igraph_sparsemat_t *A) {
  233|  10.5k|    return A->cs->n;
  234|  10.5k|}
igraph_sparsemat_is_triplet:
  265|  1.28M|igraph_bool_t igraph_sparsemat_is_triplet(const igraph_sparsemat_t *A) {
  266|  1.28M|    return A->cs->nz >= 0;
  267|  1.28M|}
igraph_sparsemat_is_cc:
  281|  28.2k|igraph_bool_t igraph_sparsemat_is_cc(const igraph_sparsemat_t *A) {
  282|  28.2k|    return A->cs->nz < 0;
  283|  28.2k|}
igraph_sparsemat_entry:
  540|   774k|        igraph_int_t row, igraph_int_t col, igraph_real_t elem) {
  541|   774k|    if (!igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (541:9): [True: 0, False: 774k]
  ------------------
  542|      0|        IGRAPH_ERROR("Entries can only be added to sparse matrices that are in triplet format.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  543|      0|                     IGRAPH_EINVAL);
  544|      0|    }
  545|       |
  546|   774k|    if (!cs_entry(A->cs, row, col, elem)) {
  ------------------
  |  |  235|   774k|#define cs_entry CS_NAME (_entry)
  |  |  ------------------
  |  |  |  |  213|   774k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (546:9): [True: 0, False: 774k]
  ------------------
  547|      0|        IGRAPH_ERROR("Cannot add entry to sparse matrix.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  548|      0|                     IGRAPH_FAILURE);
  549|      0|    }
  550|       |
  551|   774k|    return IGRAPH_SUCCESS;
  552|   774k|}
igraph_sparsemat_compress:
  571|  17.6k|                              igraph_sparsemat_t *res) {
  572|       |
  573|  17.6k|    if (! igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (573:9): [True: 0, False: 17.6k]
  ------------------
  574|      0|        IGRAPH_ERROR("Sparse matrix to compress is not in triplet format.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  575|      0|    }
  576|  17.6k|    res->cs = cs_compress(A->cs);
  ------------------
  |  |  241|  17.6k|#define cs_compress CS_NAME (_compress)
  |  |  ------------------
  |  |  |  |  213|  17.6k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  577|  17.6k|    if (!res->cs) {
  ------------------
  |  Branch (577:9): [True: 0, False: 17.6k]
  ------------------
  578|      0|        IGRAPH_ERROR("Cannot compress sparse matrix", IGRAPH_FAILURE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  579|      0|    }
  580|       |
  581|  17.6k|    return IGRAPH_SUCCESS;
  582|  17.6k|}
igraph_sparsemat_dupl:
  763|  17.6k|igraph_error_t igraph_sparsemat_dupl(igraph_sparsemat_t *A) {
  764|       |
  765|  17.6k|    if (! igraph_sparsemat_is_cc(A)) {
  ------------------
  |  Branch (765:9): [True: 0, False: 17.6k]
  ------------------
  766|      0|        IGRAPH_ERROR("Sparse matrix must be in compressed format in order to remove duplicates.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  767|      0|    }
  768|       |
  769|  17.6k|    if (!cs_dupl(A->cs)) {
  ------------------
  |  |  234|  17.6k|#define cs_dupl CS_NAME (_dupl)
  |  |  ------------------
  |  |  |  |  213|  17.6k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (769:9): [True: 0, False: 17.6k]
  ------------------
  770|      0|        IGRAPH_ERROR("Cannot remove duplicates from sparse matrix.", IGRAPH_FAILURE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  771|      0|    }
  772|       |
  773|  17.6k|    return IGRAPH_SUCCESS;
  774|  17.6k|}
igraph_sparsemat_rowsums:
 2190|  7.04k|                             igraph_vector_t *res) {
 2191|  7.04k|    if (igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (2191:9): [True: 7.04k, False: 0]
  ------------------
 2192|  7.04k|        return igraph_i_sparsemat_rowsums_triplet(A, res);
 2193|  7.04k|    } else {
 2194|      0|        return igraph_i_sparsemat_rowsums_cc(A, res);
 2195|      0|    }
 2196|  7.04k|}
igraph_sparsemat_colsums:
 2595|  7.04k|                             igraph_vector_t *res) {
 2596|  7.04k|    if (igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (2596:9): [True: 7.04k, False: 0]
  ------------------
 2597|  7.04k|        return igraph_i_sparsemat_colsums_triplet(A, res);
 2598|  7.04k|    } else {
 2599|      0|        return igraph_i_sparsemat_colsums_cc(A, res);
 2600|      0|    }
 2601|  7.04k|}
igraph_sparsemat_resize:
 2697|  10.5k|                            igraph_int_t ncol, igraph_int_t nzmax) {
 2698|       |
 2699|  10.5k|    if (igraph_sparsemat_is_cc(A)) {
  ------------------
  |  Branch (2699:9): [True: 0, False: 10.5k]
  ------------------
 2700|      0|        igraph_sparsemat_t tmp;
 2701|      0|        IGRAPH_CHECK(igraph_sparsemat_init(&tmp, nrow, ncol, nzmax));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2702|      0|        igraph_sparsemat_destroy(A);
 2703|      0|        *A = tmp;
 2704|  10.5k|    } else {
 2705|  10.5k|        IGRAPH_CHECK(igraph_sparsemat_realloc(A, nzmax));
  ------------------
  |  |  656|  10.5k|    do { \
  |  |  657|  10.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
 2706|  10.5k|        A->cs->m = nrow;
 2707|  10.5k|        A->cs->n = ncol;
 2708|  10.5k|        A->cs->nz = 0;
 2709|  10.5k|    }
 2710|  10.5k|    return IGRAPH_SUCCESS;
 2711|  10.5k|}
igraph_sparsemat_iterator_init:
 3126|  17.6k|) {
 3127|       |
 3128|  17.6k|    it->mat = sparsemat;
 3129|  17.6k|    igraph_sparsemat_iterator_reset(it);
 3130|  17.6k|    return IGRAPH_SUCCESS;
 3131|  17.6k|}
igraph_sparsemat_iterator_reset:
 3143|  17.6k|igraph_error_t igraph_sparsemat_iterator_reset(igraph_sparsemat_iterator_t *it) {
 3144|  17.6k|    it->pos = 0;
 3145|  17.6k|    it->col = 0;
 3146|  17.6k|    if (!igraph_sparsemat_is_triplet(it->mat)) {
  ------------------
  |  Branch (3146:9): [True: 17.6k, False: 0]
  ------------------
 3147|  17.6k|        while (it->col < it->mat->cs->n &&
  ------------------
  |  Branch (3147:16): [True: 17.6k, False: 0]
  ------------------
 3148|  17.6k|               it->mat->cs->p[it->col + 1] == it->pos) {
  ------------------
  |  Branch (3148:16): [True: 0, False: 17.6k]
  ------------------
 3149|      0|            it->col ++;
 3150|      0|        }
 3151|  17.6k|    }
 3152|  17.6k|    return IGRAPH_SUCCESS;
 3153|  17.6k|}
igraph_sparsemat_iterator_end:
 3167|   785k|igraph_sparsemat_iterator_end(const igraph_sparsemat_iterator_t *it) {
 3168|   785k|    CS_INT nz = it->mat->cs->nz == -1 ? it->mat->cs->p[it->mat->cs->n] :
  ------------------
  |  |  209|   785k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|   785k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
  |  Branch (3168:17): [True: 785k, False: 0]
  ------------------
 3169|   785k|                it->mat->cs->nz;
 3170|   785k|    return it->pos >= nz;
 3171|   785k|}
igraph_sparsemat_iterator_row:
 3183|   460k|igraph_int_t igraph_sparsemat_iterator_row(const igraph_sparsemat_iterator_t *it) {
 3184|   460k|    return it->mat->cs->i[it->pos];
 3185|   460k|}
igraph_sparsemat_iterator_col:
 3197|   460k|igraph_int_t igraph_sparsemat_iterator_col(const igraph_sparsemat_iterator_t *it) {
 3198|   460k|    if (igraph_sparsemat_is_triplet(it->mat)) {
  ------------------
  |  Branch (3198:9): [True: 0, False: 460k]
  ------------------
 3199|      0|        return it->mat->cs->p[it->pos];
 3200|   460k|    } else {
 3201|   460k|        return it->col;
 3202|   460k|    }
 3203|   460k|}
igraph_sparsemat_iterator_get:
 3216|   768k|igraph_sparsemat_iterator_get(const igraph_sparsemat_iterator_t *it) {
 3217|   768k|    return it->mat->cs->x[it->pos];
 3218|   768k|}
igraph_sparsemat_iterator_next:
 3230|   768k|igraph_int_t igraph_sparsemat_iterator_next(igraph_sparsemat_iterator_t *it) {
 3231|   768k|    it->pos += 1;
 3232|  1.40M|    while (it->col < it->mat->cs->n &&
  ------------------
  |  Branch (3232:12): [True: 1.38M, False: 17.6k]
  ------------------
 3233|  1.38M|           it->mat->cs->p[it->col + 1] == it->pos) {
  ------------------
  |  Branch (3233:12): [True: 639k, False: 750k]
  ------------------
 3234|   639k|        it->col++;
 3235|   639k|    }
 3236|   768k|    return it->pos;
 3237|   768k|}
sparsemat.c:igraph_i_sparsemat_rowsums_triplet:
 2146|  7.04k|                                              igraph_vector_t *res) {
 2147|  7.04k|    CS_INT i;
  ------------------
  |  |  209|  7.04k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  7.04k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2148|  7.04k|    CS_INT *pi = A->cs->i;
  ------------------
  |  |  209|  7.04k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  7.04k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2149|  7.04k|    CS_ENTRY *px = A->cs->x;
  ------------------
  |  |  212|  7.04k|#define CS_ENTRY double
  ------------------
 2150|       |
 2151|  7.04k|    IGRAPH_CHECK(igraph_vector_resize(res, A->cs->m));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
 2152|  7.04k|    igraph_vector_null(res);
 2153|       |
 2154|   316k|    for (i = 0; i < A->cs->nz; i++, pi++, px++) {
  ------------------
  |  Branch (2154:17): [True: 309k, False: 7.04k]
  ------------------
 2155|   309k|        VECTOR(*res)[ *pi ] += *px;
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2156|   309k|    }
 2157|       |
 2158|  7.04k|    return IGRAPH_SUCCESS;
 2159|  7.04k|}
sparsemat.c:igraph_i_sparsemat_colsums_triplet:
 2545|  7.04k|                                              igraph_vector_t *res) {
 2546|  7.04k|    CS_INT i;
  ------------------
  |  |  209|  7.04k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  7.04k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2547|  7.04k|    CS_INT *pp = A->cs->p;
  ------------------
  |  |  209|  7.04k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  7.04k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2548|  7.04k|    CS_ENTRY *px = A->cs->x;
  ------------------
  |  |  212|  7.04k|#define CS_ENTRY double
  ------------------
 2549|       |
 2550|  7.04k|    IGRAPH_CHECK(igraph_vector_resize(res, A->cs->n));
  ------------------
  |  |  656|  7.04k|    do { \
  |  |  657|  7.04k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.04k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.04k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
 2551|  7.04k|    igraph_vector_null(res);
 2552|       |
 2553|   316k|    for (i = 0; i < A->cs->nz; i++, pp++, px++) {
  ------------------
  |  Branch (2553:17): [True: 309k, False: 7.04k]
  ------------------
 2554|   309k|        VECTOR(*res)[ *pp ] += *px;
  ------------------
  |  |   60|   309k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2555|   309k|    }
 2556|       |
 2557|  7.04k|    return IGRAPH_SUCCESS;
 2558|  7.04k|}

igraph_stack_int_init:
   44|  24.0k|igraph_error_t FUNCTION(igraph_stack, init)(TYPE(igraph_stack)* s, igraph_int_t capacity) {
   45|  24.0k|    igraph_int_t alloc_size;
   46|  24.0k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  24.0k|    do { \
  |  |  925|  24.0k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  24.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 24.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  24.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
   47|  24.0k|    alloc_size = capacity > 0 ? capacity : 1;
  ------------------
  |  Branch (47:18): [True: 24.0k, False: 5]
  ------------------
   48|  24.0k|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  24.0k|    do { \
  |  |  925|  24.0k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  24.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 24.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  24.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
   49|  24.0k|    s->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  24.0k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  48.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 24.0k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 24.0k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 24.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|  24.0k|    if (s->stor_begin == NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 24.0k]
  ------------------
   51|      0|        IGRAPH_ERROR("Cannot initialize stack.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   52|      0|    }
   53|  24.0k|    s->stor_end = s->stor_begin + alloc_size;
   54|  24.0k|    s->end = s->stor_begin;
   55|       |
   56|  24.0k|    return IGRAPH_SUCCESS;
   57|  24.0k|}
igraph_stack_int_destroy:
   72|  24.0k|void FUNCTION(igraph_stack, destroy)    (TYPE(igraph_stack)* s) {
   73|  24.0k|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  24.0k|    do { \
  |  |  925|  24.0k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  24.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 24.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  24.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
   74|  24.0k|    if (s->stor_begin != NULL) {
  ------------------
  |  Branch (74:9): [True: 24.0k, False: 0]
  ------------------
   75|  24.0k|        IGRAPH_FREE(s->stor_begin);
  ------------------
  |  |   36|  24.0k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
   76|       |        s->stor_begin = NULL;
   77|  24.0k|    }
   78|  24.0k|}
igraph_stack_int_empty:
  154|  16.1M|igraph_bool_t FUNCTION(igraph_stack, empty)(TYPE(igraph_stack)* s) {
  155|  16.1M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  16.1M|    do { \
  |  |  925|  16.1M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  16.1M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  16.1M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 16.1M]
  |  |  ------------------
  ------------------
  156|  16.1M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  16.1M|    do { \
  |  |  925|  16.1M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  16.1M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  16.1M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 16.1M]
  |  |  ------------------
  ------------------
  157|  16.1M|    return s->stor_begin == s->end;
  158|  16.1M|}
igraph_stack_int_clear:
  187|  4.96M|void FUNCTION(igraph_stack, clear)(TYPE(igraph_stack)* s) {
  188|  4.96M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  4.96M|    do { \
  |  |  925|  4.96M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.96M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.96M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.96M]
  |  |  ------------------
  ------------------
  189|  4.96M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  4.96M|    do { \
  |  |  925|  4.96M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.96M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.96M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.96M]
  |  |  ------------------
  ------------------
  190|  4.96M|    s->end = s->stor_begin;
  191|  4.96M|}
igraph_stack_int_push:
  208|  12.0M|igraph_error_t FUNCTION(igraph_stack, push)(TYPE(igraph_stack)* s, BASE elem) {
  209|  12.0M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  210|  12.0M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  211|       |
  212|  12.0M|    if (s->stor_end == s->end) {
  ------------------
  |  Branch (212:9): [True: 0, False: 12.0M]
  ------------------
  213|       |        /* full, allocate more storage */
  214|      0|        igraph_int_t old_size = FUNCTION(igraph_stack, size)(s);
  ------------------
  |  |  178|      0|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|      0|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|      0|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|      0|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (215:33): [True: 0, False: 0]
  ------------------
  216|      0|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (216:13): [True: 0, False: 0]
  ------------------
  217|      0|            IGRAPH_ERROR("Cannot push to stack, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  218|      0|        }
  219|      0|        if (new_size == 0) {
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|            new_size = 1;
  221|      0|        }
  222|      0|        IGRAPH_CHECK(FUNCTION(igraph_stack, reserve)(s, new_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  223|      0|    }
  224|       |
  225|  12.0M|    *(s->end) = elem;
  226|  12.0M|    s->end += 1;
  227|       |
  228|  12.0M|    return IGRAPH_SUCCESS;
  229|  12.0M|}
igraph_stack_int_pop:
  244|  12.0M|BASE FUNCTION(igraph_stack, pop)(TYPE(igraph_stack)* s) {
  245|  12.0M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  246|  12.0M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  247|  12.0M|    IGRAPH_ASSERT(s->end != NULL);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  248|  12.0M|    IGRAPH_ASSERT(s->end != s->stor_begin);
  ------------------
  |  |  924|  12.0M|    do { \
  |  |  925|  12.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  249|       |
  250|  12.0M|    (s->end)--;
  251|       |
  252|  12.0M|    return *(s->end);
  253|  12.0M|}
igraph_stack_int_top:
  268|  1.77M|BASE FUNCTION(igraph_stack, top)(const TYPE(igraph_stack)* s) {
  269|  1.77M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  1.77M|    do { \
  |  |  925|  1.77M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.77M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.77M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.77M]
  |  |  ------------------
  ------------------
  270|  1.77M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  1.77M|    do { \
  |  |  925|  1.77M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.77M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.77M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.77M]
  |  |  ------------------
  ------------------
  271|  1.77M|    IGRAPH_ASSERT(s->end != NULL);
  ------------------
  |  |  924|  1.77M|    do { \
  |  |  925|  1.77M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.77M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.77M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.77M]
  |  |  ------------------
  ------------------
  272|  1.77M|    IGRAPH_ASSERT(s->end != s->stor_begin);
  ------------------
  |  |  924|  1.77M|    do { \
  |  |  925|  1.77M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.77M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.77M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.77M]
  |  |  ------------------
  ------------------
  273|       |
  274|  1.77M|    return *(s->end - 1);
  275|  1.77M|}

igraph_vector_int_list_init:
  109|  38.2k|igraph_error_t FUNCTION(init)(TYPE *v, igraph_int_t size) {
  110|  38.2k|    igraph_int_t alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (110:31): [True: 37.9k, False: 221]
  ------------------
  111|  38.2k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  38.2k|    do { \
  |  |  925|  38.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
  112|  38.2k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, ITEM_TYPE);
  ------------------
  |  |   33|  38.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  76.4k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 38.2k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 38.2k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 38.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  38.2k|    if (v->stor_begin == 0) {
  ------------------
  |  Branch (113:9): [True: 0, False: 38.2k]
  ------------------
  114|      0|        IGRAPH_ERROR("Cannot initialize list.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  115|      0|    }
  116|  38.2k|    v->stor_end = v->stor_begin + alloc_size;
  117|  38.2k|    v->end = v->stor_begin + size;
  118|       |
  119|  38.2k|    IGRAPH_CHECK(INTERNAL_FUNCTION(init_slice)(v, v->stor_begin, v->end));
  ------------------
  |  |  656|  38.2k|    do { \
  |  |  657|  38.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  38.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  38.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  38.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
  120|       |
  121|  38.2k|    return IGRAPH_SUCCESS;
  122|  38.2k|}
igraph_vector_int_list_destroy:
  176|  38.2k|void FUNCTION(destroy)(TYPE *v) {
  177|  38.2k|    IGRAPH_ASSERT(v != 0);
  ------------------
  |  |  924|  38.2k|    do { \
  |  |  925|  38.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
  178|       |
  179|  38.2k|    if (v->stor_begin != 0) {
  ------------------
  |  Branch (179:9): [True: 38.2k, False: 0]
  ------------------
  180|  38.2k|        FUNCTION(clear)(v);
  ------------------
  |  |  136|  38.2k|        #define FUNCTION(c) CONCAT4(igraph_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  38.2k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  38.2k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  38.2k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  38.2k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  182|       |        v->stor_begin = NULL;
  183|  38.2k|    }
  184|  38.2k|}
igraph_vector_int_list_size:
  287|  21.2k|igraph_int_t FUNCTION(size)(const TYPE *v) {
  288|  21.2k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  21.2k|    do { \
  |  |  925|  21.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.2k]
  |  |  ------------------
  ------------------
  289|  21.2k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  21.2k|    do { \
  |  |  925|  21.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.2k]
  |  |  ------------------
  ------------------
  290|  21.2k|    return v->end - v->stor_begin;
  291|  21.2k|}
igraph_vector_int_list_clear:
  357|  38.2k|void FUNCTION(clear)(TYPE *v) {
  358|  38.2k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  38.2k|    do { \
  |  |  925|  38.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
  359|  38.2k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  38.2k|    do { \
  |  |  925|  38.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
  360|  38.2k|    INTERNAL_FUNCTION(destroy_slice)(v, v->stor_begin, v->end);
  ------------------
  |  |  137|  38.2k|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  38.2k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  38.2k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  38.2k|    v->end = v->stor_begin;
  362|  38.2k|}
igraph_vector_int_list_get_ptr:
  377|  2.23M|ITEM_TYPE *FUNCTION(get_ptr)(const TYPE *v, igraph_int_t pos) {
  378|  2.23M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  2.23M|    do { \
  |  |  925|  2.23M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.23M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.23M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.23M]
  |  |  ------------------
  ------------------
  379|  2.23M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  2.23M|    do { \
  |  |  925|  2.23M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.23M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.23M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.23M]
  |  |  ------------------
  ------------------
  380|  2.23M|    return v->stor_begin + pos;
  381|  2.23M|}
vector_list.c:igraph_i_vector_int_list_init_item:
 1051|  1.44M|static igraph_error_t INTERNAL_FUNCTION(init_item)(const TYPE *list, ITEM_TYPE *item) {
 1052|  1.44M|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|  1.44M|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
 1053|  1.44M|    return ITEM_FUNCTION(init)(item, 0);
  ------------------
  |  |   42|  1.44M|        #define ITEM_FUNCTION(f) CONCAT3(igraph_vector,SHORT,f)
  |  |  ------------------
  |  |  |  |   22|  1.44M|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  1.44M|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  1.44M|}
vector_list.c:igraph_i_vector_int_list_destroy_item:
 1060|  1.44M|static void INTERNAL_FUNCTION(destroy_item)(ITEM_TYPE *item) {
 1061|  1.44M|    ITEM_FUNCTION(destroy)(item);
  ------------------
  |  |   42|  1.44M|        #define ITEM_FUNCTION(f) CONCAT3(igraph_vector,SHORT,f)
  |  |  ------------------
  |  |  |  |   22|  1.44M|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  1.44M|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1062|  1.44M|}
vector_list.c:igraph_i_vector_int_list_init_slice:
 1068|  38.2k|static igraph_error_t INTERNAL_FUNCTION(init_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1069|  38.2k|    ITEM_TYPE *current;
  ------------------
  |  |   31|  38.2k|    #define ITEM_TYPE BASE_VECTOR
  |  |  ------------------
  |  |  |  |   67|  38.2k|    #define BASE_VECTOR igraph_vector_int_t
  |  |  ------------------
  ------------------
 1070|  38.2k|    igraph_error_t retval;
 1071|       |
 1072|  1.48M|    for (current = start; current < end; current++) {
  ------------------
  |  Branch (1072:27): [True: 1.44M, False: 38.2k]
  ------------------
 1073|  1.44M|        retval = INTERNAL_FUNCTION(init_item)(list, current);
  ------------------
  |  |  137|  1.44M|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  1.44M|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.44M|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1074|  1.44M|        if (retval) {
  ------------------
  |  Branch (1074:13): [True: 0, False: 1.44M]
  ------------------
 1075|      0|            INTERNAL_FUNCTION(destroy_slice)(list, start, current);
  ------------------
  |  |  137|      0|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|      0|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1076|      0|            IGRAPH_CHECK(retval);
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1077|      0|        }
 1078|  1.44M|    }
 1079|       |
 1080|  38.2k|    return IGRAPH_SUCCESS;
 1081|  38.2k|}
vector_list.c:igraph_i_vector_int_list_destroy_slice:
 1083|  38.2k|static void INTERNAL_FUNCTION(destroy_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1084|  38.2k|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|  38.2k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
 1085|  1.48M|    for (; start < end; start++) {
  ------------------
  |  Branch (1085:12): [True: 1.44M, False: 38.2k]
  ------------------
 1086|  1.44M|        INTERNAL_FUNCTION(destroy_item)(start);
  ------------------
  |  |  137|  1.44M|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  1.44M|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.44M|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1087|  1.44M|    }
 1088|  38.2k|}
igraph_attribute_record_list_init:
  109|  2.02M|igraph_error_t FUNCTION(init)(TYPE *v, igraph_int_t size) {
  110|  2.02M|    igraph_int_t alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (110:31): [True: 0, False: 2.02M]
  ------------------
  111|  2.02M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  2.02M|    do { \
  |  |  925|  2.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.02M]
  |  |  ------------------
  ------------------
  112|  2.02M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, ITEM_TYPE);
  ------------------
  |  |   33|  2.02M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  4.04M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 2.02M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 2.02M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 2.02M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  2.02M|    if (v->stor_begin == 0) {
  ------------------
  |  Branch (113:9): [True: 0, False: 2.02M]
  ------------------
  114|      0|        IGRAPH_ERROR("Cannot initialize list.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  115|      0|    }
  116|  2.02M|    v->stor_end = v->stor_begin + alloc_size;
  117|  2.02M|    v->end = v->stor_begin + size;
  118|       |
  119|  2.02M|    IGRAPH_CHECK(INTERNAL_FUNCTION(init_slice)(v, v->stor_begin, v->end));
  ------------------
  |  |  656|  2.02M|    do { \
  |  |  657|  2.02M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.02M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  2.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.02M]
  |  |  ------------------
  ------------------
  120|       |
  121|  2.02M|    return IGRAPH_SUCCESS;
  122|  2.02M|}
igraph_attribute_record_list_init_copy:
  141|   346k|igraph_error_t FUNCTION(init_copy)(TYPE* to, const TYPE* from) {
  142|   346k|    igraph_int_t i, size = FUNCTION(size)(from);
  ------------------
  |  |  161|   346k|    #define FUNCTION(c) CONCAT2x(igraph_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|   346k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
  143|       |
  144|   346k|    IGRAPH_CHECK(FUNCTION(init)(to, 0));
  ------------------
  |  |  656|   346k|    do { \
  |  |  657|   346k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   346k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   346k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 346k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   346k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 346k]
  |  |  ------------------
  ------------------
  145|   346k|    IGRAPH_FINALLY(FUNCTION(destroy), to);
  ------------------
  |  |  603|   346k|    do { \
  |  |  604|   346k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   346k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   346k|         * incorrect destructor function with the pointer */ \
  |  |  607|   346k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 346k]
  |  |  ------------------
  |  |  608|   346k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   346k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 346k]
  |  |  ------------------
  ------------------
  146|       |
  147|   372k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (147:17): [True: 25.5k, False: 346k]
  ------------------
  148|  25.5k|        IGRAPH_CHECK(FUNCTION(push_back_copy)(to, FUNCTION(get_ptr)(from, i)));
  ------------------
  |  |  656|  25.5k|    do { \
  |  |  657|  25.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  149|  25.5k|    }
  150|       |
  151|   346k|    IGRAPH_FINALLY_CLEAN(1);
  152|       |
  153|   346k|    return IGRAPH_SUCCESS;
  154|   346k|}
igraph_attribute_record_list_destroy:
  176|  2.02M|void FUNCTION(destroy)(TYPE *v) {
  177|  2.02M|    IGRAPH_ASSERT(v != 0);
  ------------------
  |  |  924|  2.02M|    do { \
  |  |  925|  2.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.02M]
  |  |  ------------------
  ------------------
  178|       |
  179|  2.02M|    if (v->stor_begin != 0) {
  ------------------
  |  Branch (179:9): [True: 2.02M, False: 0]
  ------------------
  180|  2.02M|        FUNCTION(clear)(v);
  ------------------
  |  |  161|  2.02M|    #define FUNCTION(c) CONCAT2x(igraph_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|  2.02M|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
  181|  2.02M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  2.02M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  182|       |        v->stor_begin = NULL;
  183|  2.02M|    }
  184|  2.02M|}
igraph_attribute_record_list_empty:
  268|   616k|igraph_bool_t FUNCTION(empty)(const TYPE *v) {
  269|   616k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   616k|    do { \
  |  |  925|   616k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   616k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 616k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   616k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 616k]
  |  |  ------------------
  ------------------
  270|   616k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   616k|    do { \
  |  |  925|   616k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   616k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 616k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   616k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 616k]
  |  |  ------------------
  ------------------
  271|   616k|    return v->stor_begin == v->end;
  272|   616k|}
igraph_attribute_record_list_size:
  287|  1.98M|igraph_int_t FUNCTION(size)(const TYPE *v) {
  288|  1.98M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.98M|    do { \
  |  |  925|  1.98M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.98M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.98M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.98M]
  |  |  ------------------
  ------------------
  289|  1.98M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.98M|    do { \
  |  |  925|  1.98M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.98M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.98M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.98M]
  |  |  ------------------
  ------------------
  290|  1.98M|    return v->end - v->stor_begin;
  291|  1.98M|}
igraph_attribute_record_list_clear:
  357|  2.03M|void FUNCTION(clear)(TYPE *v) {
  358|  2.03M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  2.03M|    do { \
  |  |  925|  2.03M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.03M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.03M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
  359|  2.03M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  2.03M|    do { \
  |  |  925|  2.03M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.03M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.03M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
  360|  2.03M|    INTERNAL_FUNCTION(destroy_slice)(v, v->stor_begin, v->end);
  ------------------
  |  |  162|  2.03M|    #define INTERNAL_FUNCTION(c) CONCAT2x(igraph_i_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|  2.03M|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
  361|  2.03M|    v->end = v->stor_begin;
  362|  2.03M|}
igraph_attribute_record_list_get_ptr:
  377|   666k|ITEM_TYPE *FUNCTION(get_ptr)(const TYPE *v, igraph_int_t pos) {
  378|   666k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   666k|    do { \
  |  |  925|   666k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   666k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 666k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   666k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 666k]
  |  |  ------------------
  ------------------
  379|   666k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   666k|    do { \
  |  |  925|   666k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   666k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 666k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   666k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 666k]
  |  |  ------------------
  ------------------
  380|   666k|    return v->stor_begin + pos;
  381|   666k|}
igraph_attribute_record_list_push_back:
  587|  36.1k|igraph_error_t FUNCTION(push_back)(TYPE *v, ITEM_TYPE *e) {
  588|  36.1k|    IGRAPH_CHECK(INTERNAL_FUNCTION(expand_if_full)(v));
  ------------------
  |  |  656|  36.1k|    do { \
  |  |  657|  36.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  36.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  36.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 36.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  36.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 36.1k]
  |  |  ------------------
  ------------------
  589|  36.1k|    *(v->end) = *e;
  590|  36.1k|    v->end += 1;
  591|  36.1k|    return IGRAPH_SUCCESS;
  592|  36.1k|}
igraph_attribute_record_list_push_back_copy:
  612|  25.5k|igraph_error_t FUNCTION(push_back_copy)(TYPE *v, const ITEM_TYPE *e) {
  613|  25.5k|    ITEM_TYPE copy;
  ------------------
  |  |   61|  25.5k|    #define ITEM_TYPE BASE
  |  |  ------------------
  |  |  |  |  115|  25.5k|    #define BASE igraph_attribute_record_t
  |  |  ------------------
  ------------------
  614|  25.5k|    IGRAPH_CHECK(INTERNAL_FUNCTION(copy_item)(&copy, e));
  ------------------
  |  |  656|  25.5k|    do { \
  |  |  657|  25.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  615|  25.5k|    IGRAPH_FINALLY(INTERNAL_FUNCTION(destroy_item), &copy);
  ------------------
  |  |  603|  25.5k|    do { \
  |  |  604|  25.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  25.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  25.5k|         * incorrect destructor function with the pointer */ \
  |  |  607|  25.5k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 25.5k]
  |  |  ------------------
  |  |  608|  25.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  616|  25.5k|    IGRAPH_CHECK(FUNCTION(push_back)(v, &copy));
  ------------------
  |  |  656|  25.5k|    do { \
  |  |  657|  25.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  617|  25.5k|    IGRAPH_FINALLY_CLEAN(1);
  618|  25.5k|    return IGRAPH_SUCCESS;
  619|  25.5k|}
igraph_attribute_record_list_push_back_new:
  640|   612k|igraph_error_t FUNCTION(push_back_new)(TYPE *v, ITEM_TYPE** e) {
  641|   612k|    IGRAPH_CHECK(INTERNAL_FUNCTION(expand_if_full)(v));
  ------------------
  |  |  656|   612k|    do { \
  |  |  657|   612k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   612k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   612k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   612k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 612k]
  |  |  ------------------
  ------------------
  642|   612k|    IGRAPH_CHECK(INTERNAL_FUNCTION(init_item)(v, v->end));
  ------------------
  |  |  656|   612k|    do { \
  |  |  657|   612k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   612k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   612k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   612k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 612k]
  |  |  ------------------
  ------------------
  643|   612k|    if (e) {
  ------------------
  |  Branch (643:9): [True: 612k, False: 0]
  ------------------
  644|   612k|        *e = v->end;
  645|   612k|    }
  646|   612k|    v->end += 1;
  647|   612k|    return IGRAPH_SUCCESS;
  648|   612k|}
attributes.c:igraph_i_attribute_record_list_init_slice:
 1068|  2.02M|static igraph_error_t INTERNAL_FUNCTION(init_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1069|  2.02M|    ITEM_TYPE *current;
  ------------------
  |  |   61|  2.02M|    #define ITEM_TYPE BASE
  |  |  ------------------
  |  |  |  |  115|  2.02M|    #define BASE igraph_attribute_record_t
  |  |  ------------------
  ------------------
 1070|  2.02M|    igraph_error_t retval;
 1071|       |
 1072|  2.02M|    for (current = start; current < end; current++) {
  ------------------
  |  Branch (1072:27): [True: 0, False: 2.02M]
  ------------------
 1073|      0|        retval = INTERNAL_FUNCTION(init_item)(list, current);
  ------------------
  |  |  162|      0|    #define INTERNAL_FUNCTION(c) CONCAT2x(igraph_i_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|      0|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
 1074|      0|        if (retval) {
  ------------------
  |  Branch (1074:13): [True: 0, False: 0]
  ------------------
 1075|      0|            INTERNAL_FUNCTION(destroy_slice)(list, start, current);
  ------------------
  |  |  162|      0|    #define INTERNAL_FUNCTION(c) CONCAT2x(igraph_i_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|      0|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
 1076|      0|            IGRAPH_CHECK(retval);
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1077|      0|        }
 1078|      0|    }
 1079|       |
 1080|  2.02M|    return IGRAPH_SUCCESS;
 1081|  2.02M|}
attributes.c:igraph_i_attribute_record_list_destroy_slice:
 1083|  2.03M|static void INTERNAL_FUNCTION(destroy_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1084|  2.03M|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|  2.03M|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
 1085|  2.68M|    for (; start < end; start++) {
  ------------------
  |  Branch (1085:12): [True: 649k, False: 2.03M]
  ------------------
 1086|   649k|        INTERNAL_FUNCTION(destroy_item)(start);
  ------------------
  |  |  162|   649k|    #define INTERNAL_FUNCTION(c) CONCAT2x(igraph_i_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|   649k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
 1087|   649k|    }
 1088|  2.03M|}
attributes.c:igraph_i_attribute_record_list_expand_if_full:
 1094|   649k|static igraph_error_t INTERNAL_FUNCTION(expand_if_full)(TYPE *v) {
 1095|   649k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   649k|    do { \
  |  |  925|   649k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
 1096|   649k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   649k|    do { \
  |  |  925|   649k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
 1097|       |
 1098|   649k|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 649k]
  ------------------
 1099|      0|        igraph_int_t old_size = FUNCTION(size)(v);
  ------------------
  |  |  161|      0|    #define FUNCTION(c) CONCAT2x(igraph_attribute_record_list,c)
  |  |  ------------------
  |  |  |  |   19|      0|#define CONCAT2x(a,b) a ## _ ## b
  |  |  ------------------
  ------------------
 1100|      0|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (1100:33): [True: 0, False: 0]
  ------------------
 1101|      0|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (1101:13): [True: 0, False: 0]
  ------------------
 1102|      0|            IGRAPH_ERROR("Cannot add new item to list, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1103|      0|        }
 1104|      0|        if (new_size == 0) {
  ------------------
  |  Branch (1104:13): [True: 0, False: 0]
  ------------------
 1105|      0|            new_size = 1;
 1106|      0|        }
 1107|      0|        IGRAPH_CHECK(FUNCTION(reserve)(v, new_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1108|      0|    }
 1109|       |
 1110|   649k|    return IGRAPH_SUCCESS;
 1111|   649k|}

igraph_vector_int_pair_order:
  119|  84.2k|                                       igraph_vector_int_t* res, igraph_int_t nodes) {
  120|  84.2k|    igraph_int_t edges = igraph_vector_int_size(v);
  121|  84.2k|    igraph_vector_int_t ptr;
  122|  84.2k|    igraph_vector_int_t rad;
  123|  84.2k|    igraph_int_t i, j;
  124|       |
  125|  84.2k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  84.2k|    do { \
  |  |  925|  84.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  84.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
  126|  84.2k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  84.2k|    do { \
  |  |  925|  84.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  84.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
  127|       |
  128|  84.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&ptr, nodes + 1);
  ------------------
  |  |  119|  84.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  84.2k|    do { \
  |  |  |  |  657|  84.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  84.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  84.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  84.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  84.2k|    do { \
  |  |  |  |  604|  84.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  84.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  84.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  84.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  84.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  84.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
  129|  84.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&rad, edges);
  ------------------
  |  |  119|  84.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  84.2k|    do { \
  |  |  |  |  657|  84.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  84.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  84.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  84.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  84.2k|    do { \
  |  |  |  |  604|  84.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  84.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  84.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  84.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  84.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  84.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
  130|  84.2k|    IGRAPH_CHECK(igraph_vector_int_resize(res, edges));
  ------------------
  |  |  656|  84.2k|    do { \
  |  |  657|  84.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  84.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  84.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
  131|       |
  132|  1.25M|    for (i = 0; i < edges; i++) {
  ------------------
  |  Branch (132:17): [True: 1.17M, False: 84.2k]
  ------------------
  133|  1.17M|        igraph_int_t radix = VECTOR(*v2)[i];
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  134|  1.17M|        if (VECTOR(ptr)[radix] != 0) {
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (134:13): [True: 687k, False: 487k]
  ------------------
  135|   687k|            VECTOR(rad)[i] = VECTOR(ptr)[radix];
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(rad)[i] = VECTOR(ptr)[radix];
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  136|   687k|        }
  137|  1.17M|        VECTOR(ptr)[radix] = i + 1;
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  138|  1.17M|    }
  139|       |
  140|  84.2k|    j = 0;
  141|  2.92M|    for (i = 0; i < nodes + 1; i++) {
  ------------------
  |  Branch (141:17): [True: 2.83M, False: 84.2k]
  ------------------
  142|  2.83M|        if (VECTOR(ptr)[i] != 0) {
  ------------------
  |  |   60|  2.83M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (142:13): [True: 487k, False: 2.35M]
  ------------------
  143|   487k|            igraph_int_t next = VECTOR(ptr)[i] - 1;
  ------------------
  |  |   60|   487k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  144|   487k|            VECTOR(*res)[j++] = next;
  ------------------
  |  |   60|   487k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|  1.17M|            while (VECTOR(rad)[next] != 0) {
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (145:20): [True: 687k, False: 487k]
  ------------------
  146|   687k|                next = VECTOR(rad)[next] - 1;
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  147|   687k|                VECTOR(*res)[j++] = next;
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  148|   687k|            }
  149|   487k|        }
  150|  2.83M|    }
  151|       |
  152|  84.2k|    igraph_vector_int_null(&ptr);
  153|  84.2k|    igraph_vector_int_null(&rad);
  154|       |
  155|  1.25M|    for (i = 0; i < edges; i++) {
  ------------------
  |  Branch (155:17): [True: 1.17M, False: 84.2k]
  ------------------
  156|  1.17M|        igraph_int_t edge = VECTOR(*res)[edges - i - 1];
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  157|  1.17M|        igraph_int_t radix = VECTOR(*v)[edge];
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|  1.17M|        if (VECTOR(ptr)[radix] != 0) {
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (158:13): [True: 687k, False: 487k]
  ------------------
  159|   687k|            VECTOR(rad)[edge] = VECTOR(ptr)[radix];
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(rad)[edge] = VECTOR(ptr)[radix];
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  160|   687k|        }
  161|  1.17M|        VECTOR(ptr)[radix] = edge + 1;
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  162|  1.17M|    }
  163|       |
  164|  84.2k|    j = 0;
  165|  2.92M|    for (i = 0; i < nodes + 1; i++) {
  ------------------
  |  Branch (165:17): [True: 2.83M, False: 84.2k]
  ------------------
  166|  2.83M|        if (VECTOR(ptr)[i] != 0) {
  ------------------
  |  |   60|  2.83M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (166:13): [True: 487k, False: 2.35M]
  ------------------
  167|   487k|            igraph_int_t next = VECTOR(ptr)[i] - 1;
  ------------------
  |  |   60|   487k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  168|   487k|            VECTOR(*res)[j++] = next;
  ------------------
  |  |   60|   487k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  169|  1.17M|            while (VECTOR(rad)[next] != 0) {
  ------------------
  |  |   60|  1.17M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (169:20): [True: 687k, False: 487k]
  ------------------
  170|   687k|                next = VECTOR(rad)[next] - 1;
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  171|   687k|                VECTOR(*res)[j++] = next;
  ------------------
  |  |   60|   687k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  172|   687k|            }
  173|   487k|        }
  174|  2.83M|    }
  175|       |
  176|  84.2k|    igraph_vector_int_destroy(&ptr);
  177|  84.2k|    igraph_vector_int_destroy(&rad);
  178|  84.2k|    IGRAPH_FINALLY_CLEAN(2);
  179|       |
  180|  84.2k|    return IGRAPH_SUCCESS;
  181|  84.2k|}

igraph_vector_init:
  134|  2.08M|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  2.08M|    igraph_int_t alloc_size;
  136|  2.08M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  2.08M|    do { \
  |  |  925|  2.08M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.08M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.08M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.08M]
  |  |  ------------------
  ------------------
  137|  2.08M|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 1.33M, False: 752k]
  ------------------
  138|       |
  139|       |    /* When this function fails, it should leave stor_begin set to NULL,
  140|       |     * so that vector_destroy() is still safe to call on the vector.
  141|       |     * This simplifies freeing partially initialized data structures,
  142|       |     * such as adjacency lists, when an error occurs mid-initialization. */
  143|  2.08M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  2.08M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  4.17M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 2.08M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 2.08M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 2.08M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  2.08M|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  2.08M|    do { \
  |  |  710|  2.08M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  2.08M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  2.08M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 2.08M]
  |  |  ------------------
  ------------------
  145|  2.08M|    v->stor_end = v->stor_begin + alloc_size;
  146|  2.08M|    v->end = v->stor_begin + size;
  147|       |
  148|  2.08M|    return IGRAPH_SUCCESS;
  149|  2.08M|}
igraph_vector_destroy:
  408|  2.08M|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  2.08M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  2.08M|    do { \
  |  |  925|  2.08M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.08M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.08M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.08M]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  2.08M|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 2.08M, False: 0]
  ------------------
  413|  2.08M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  2.08M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  2.08M|    }
  416|  2.08M|}
igraph_vector_capacity:
  436|  1.10M|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|  1.10M|    return v->stor_end - v->stor_begin;
  438|  1.10M|}
igraph_vector_reserve:
  468|  1.10M|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|  1.10M|    igraph_int_t current_capacity;
  470|  1.10M|    BASE *tmp;
  ------------------
  |  |   29|  1.10M|    #define BASE igraph_real_t
  ------------------
  471|       |
  472|  1.10M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.10M|    do { \
  |  |  925|  1.10M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.10M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.10M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.10M]
  |  |  ------------------
  ------------------
  473|  1.10M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.10M|    do { \
  |  |  925|  1.10M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.10M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.10M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.10M]
  |  |  ------------------
  ------------------
  474|  1.10M|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  1.10M|    do { \
  |  |  925|  1.10M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.10M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.10M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.10M]
  |  |  ------------------
  ------------------
  475|       |
  476|  1.10M|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  170|  1.10M|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  1.10M|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  1.10M|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|  1.10M|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 968k, False: 133k]
  ------------------
  479|   968k|        return IGRAPH_SUCCESS;
  480|   968k|    }
  481|       |
  482|   133k|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|   133k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   266k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 133k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 133k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 133k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   133k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|   133k|    do { \
  |  |  710|   133k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   133k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   133k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 133k]
  |  |  ------------------
  ------------------
  484|       |
  485|   133k|    v->end = tmp + (v->end - v->stor_begin);
  486|   133k|    v->stor_begin = tmp;
  487|   133k|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|   133k|    return IGRAPH_SUCCESS;
  490|   133k|}
igraph_vector_empty:
  503|   851k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   851k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   851k|    do { \
  |  |  925|   851k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   851k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 851k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   851k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 851k]
  |  |  ------------------
  ------------------
  505|   851k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   851k|    do { \
  |  |  925|   851k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   851k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 851k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   851k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 851k]
  |  |  ------------------
  ------------------
  506|   851k|    return v->stor_begin == v->end;
  507|   851k|}
igraph_vector_size:
  522|  3.55M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|  3.55M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  3.55M|    do { \
  |  |  925|  3.55M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.55M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.55M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.55M]
  |  |  ------------------
  ------------------
  524|  3.55M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  3.55M|    do { \
  |  |  925|  3.55M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.55M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.55M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.55M]
  |  |  ------------------
  ------------------
  525|  3.55M|    return v->end - v->stor_begin;
  526|  3.55M|}
igraph_vector_clear:
  542|  1.26M|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|  1.26M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.26M|    do { \
  |  |  925|  1.26M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.26M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
  544|  1.26M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.26M|    do { \
  |  |  925|  1.26M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.26M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
  545|  1.26M|    v->end = v->stor_begin;
  546|  1.26M|}
igraph_vector_push_back:
  573|  1.11M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  1.11M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.11M|    do { \
  |  |  925|  1.11M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.11M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.11M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.11M]
  |  |  ------------------
  ------------------
  575|  1.11M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.11M|    do { \
  |  |  925|  1.11M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.11M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.11M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.11M]
  |  |  ------------------
  ------------------
  576|       |
  577|  1.11M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 38.9k, False: 1.07M]
  ------------------
  578|       |        /* full, allocate more storage */
  579|  38.9k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  38.9k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  38.9k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  38.9k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|  38.9k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  38.9k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  38.9k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 38.9k, False: 0]
  ------------------
  581|  38.9k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  38.9k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 38.9k]
  ------------------
  582|      0|            IGRAPH_ERROR("Cannot push to vector, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  583|      0|        }
  584|  38.9k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 38.9k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|  38.9k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  38.9k|    do { \
  |  |  657|  38.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  38.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  38.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  588|  38.9k|    }
  589|       |
  590|  1.11M|    *(v->end) = e;
  591|  1.11M|    v->end += 1;
  592|       |
  593|  1.11M|    return IGRAPH_SUCCESS;
  594|  1.11M|}
igraph_vector_null:
  725|   139k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   139k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   139k|    do { \
  |  |  925|   139k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   139k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 139k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   139k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 139k]
  |  |  ------------------
  ------------------
  727|   139k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   139k|    do { \
  |  |  925|   139k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   139k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 139k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   139k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 139k]
  |  |  ------------------
  ------------------
  728|   139k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  170|   139k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   139k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   139k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 138k, False: 111]
  ------------------
  729|   138k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  170|   138k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   138k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   138k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   138k|    }
  731|   139k|}
igraph_vector_fill:
  745|  10.5k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|  10.5k|    BASE *ptr;
  ------------------
  |  |   29|  10.5k|    #define BASE igraph_real_t
  ------------------
  747|  10.5k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.5k|    do { \
  |  |  925|  10.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  748|  10.5k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  10.5k|    do { \
  |  |  925|  10.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  749|       |
  750|       |    /* Optimize the commonly used integer case when filling with 0
  751|       |     * or -1, which are an all-0 and all-1 bit pattern that the
  752|       |     * compiler can generate higher efficiency code for. */
  753|       |#if defined(BASE_INT)
  754|       |    if (e == 0) {
  755|       |        FUNCTION(igraph_vector, null)(v);
  756|       |        return;
  757|       |    }
  758|       |    if (e == -1) {
  759|       |        for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  760|       |            *ptr = -1;
  761|       |        }
  762|       |        return;
  763|       |    }
  764|       |#endif
  765|       |
  766|   472k|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (766:31): [True: 461k, False: 10.5k]
  ------------------
  767|   461k|        *ptr = e;
  768|   461k|    }
  769|  10.5k|}
igraph_vector_pop_back:
  838|   550k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   550k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   550k|    do { \
  |  |  925|   550k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  840|   550k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   550k|    do { \
  |  |  925|   550k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  841|   550k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   550k|    do { \
  |  |  925|   550k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  842|   550k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   550k|    do { \
  |  |  925|   550k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   550k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 550k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   550k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 550k]
  |  |  ------------------
  ------------------
  843|       |
  844|   550k|    (v->end)--;
  845|       |
  846|   550k|    return *(v->end);
  847|   550k|}
igraph_vector_sort_ind:
 1045|  3.43k|        igraph_order_t order) {
 1046|       |
 1047|  3.43k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  3.43k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.43k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.43k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  3.43k|    BASE **vind, *first;
  ------------------
  |  |   29|  3.43k|    #define BASE igraph_real_t
  ------------------
 1049|  3.43k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
 1050|  3.43k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 3.43k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  3.43k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  3.43k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.86k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.43k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  3.43k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  3.43k|    do { \
  |  |  710|  3.43k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
 1055|   155k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 151k, False: 3.43k]
  ------------------
 1056|   151k|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|   151k|    }
 1058|  3.43k|    first = vind[0];
 1059|  3.43k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 3.43k]
  ------------------
 1060|      0|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_asc));
  ------------------
  |  |  170|      0|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|      0|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|      0|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1061|  3.43k|    } else {
 1062|  3.43k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_desc));
  ------------------
  |  |  170|  3.43k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.43k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.43k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|  3.43k|    }
 1064|   155k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 151k, False: 3.43k]
  ------------------
 1065|   151k|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|   151k|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  3.43k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  3.43k|    return IGRAPH_SUCCESS;
 1069|  3.43k|}
igraph_vector_resize:
 1264|  1.06M|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|  1.06M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.06M|    do { \
  |  |  925|  1.06M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.06M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.06M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.06M]
  |  |  ------------------
  ------------------
 1266|  1.06M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.06M|    do { \
  |  |  925|  1.06M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.06M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.06M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.06M]
  |  |  ------------------
  ------------------
 1267|  1.06M|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  1.06M|    do { \
  |  |  657|  1.06M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.06M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.06M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.06M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.06M]
  |  |  ------------------
  ------------------
 1268|  1.06M|    v->end = v->stor_begin + new_size;
 1269|  1.06M|    return IGRAPH_SUCCESS;
 1270|  1.06M|}
igraph_vector_which_max:
 1365|  3.53k|igraph_int_t FUNCTION(igraph_vector, which_max)(const TYPE(igraph_vector) *v) {
 1366|  3.53k|    BASE *max;
  ------------------
  |  |   29|  3.53k|    #define BASE igraph_real_t
  ------------------
 1367|  3.53k|    BASE *ptr;
  ------------------
  |  |   29|  3.53k|    #define BASE igraph_real_t
  ------------------
 1368|  3.53k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  3.53k|    do { \
  |  |  925|  3.53k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
 1369|  3.53k|    max = ptr = v->stor_begin;
 1370|  3.53k|#if defined(BASE_IGRAPH_REAL)
 1371|  3.53k|    if (isnan(*ptr)) { return ptr - v->stor_begin; } /* Result is NaN */
  ------------------
  |  Branch (1371:9): [True: 0, False: 3.53k]
  ------------------
 1372|  3.53k|#endif
 1373|  3.53k|    ptr++;
 1374|  45.4k|    while (ptr < v->end) {
  ------------------
  |  Branch (1374:12): [True: 41.9k, False: 3.53k]
  ------------------
 1375|  41.9k|        if (*ptr > *max) {
  ------------------
  |  Branch (1375:13): [True: 32.9k, False: 8.98k]
  ------------------
 1376|  32.9k|            max = ptr;
 1377|  32.9k|        }
 1378|  8.98k|#if defined(BASE_IGRAPH_REAL)
 1379|  8.98k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1379:18): [True: 0, False: 8.98k]
  ------------------
 1380|      0|            return ptr - v->stor_begin; /* Result is NaN */
 1381|      0|        }
 1382|  41.9k|#endif
 1383|  41.9k|        ptr++;
 1384|  41.9k|    }
 1385|  3.53k|    return max - v->stor_begin;
 1386|  3.53k|}
igraph_vector_min:
 1401|  35.1k|BASE FUNCTION(igraph_vector, min)(const TYPE(igraph_vector) *v) {
 1402|  35.1k|    BASE min;
  ------------------
  |  |   29|  35.1k|    #define BASE igraph_real_t
  ------------------
 1403|  35.1k|    BASE *ptr;
  ------------------
  |  |   29|  35.1k|    #define BASE igraph_real_t
  ------------------
 1404|  35.1k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  35.1k|    do { \
  |  |  925|  35.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  35.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 35.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  35.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 35.1k]
  |  |  ------------------
  ------------------
 1405|  35.1k|    min = *(v->stor_begin);
 1406|  35.1k|#if defined(BASE_IGRAPH_REAL)
 1407|  35.1k|    if (isnan(min)) { return min; }; /* Result is NaN */
  ------------------
  |  Branch (1407:9): [True: 0, False: 35.1k]
  ------------------
 1408|  35.1k|#endif
 1409|  35.1k|    ptr = v->stor_begin + 1;
 1410|   771k|    while (ptr < v->end) {
  ------------------
  |  Branch (1410:12): [True: 735k, False: 35.1k]
  ------------------
 1411|   735k|        if ((*ptr) < min) {
  ------------------
  |  Branch (1411:13): [True: 38.6k, False: 697k]
  ------------------
 1412|  38.6k|            min = *ptr;
 1413|  38.6k|        }
 1414|   697k|#if defined(BASE_IGRAPH_REAL)
 1415|   697k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1415:18): [True: 0, False: 697k]
  ------------------
 1416|      0|            return *ptr; /* Result is NaN */
 1417|      0|        }
 1418|   735k|#endif
 1419|   735k|        ptr++;
 1420|   735k|    }
 1421|  35.1k|    return min;
 1422|  35.1k|}
igraph_vector_init_copy:
 1538|  3.54k|) {
 1539|  3.54k|    igraph_int_t from_size;
 1540|       |
 1541|  3.54k|    IGRAPH_ASSERT(from != NULL);
  ------------------
  |  |  924|  3.54k|    do { \
  |  |  925|  3.54k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1542|  3.54k|    IGRAPH_ASSERT(from->stor_begin != NULL);
  ------------------
  |  |  924|  3.54k|    do { \
  |  |  925|  3.54k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1543|       |
 1544|  3.54k|    from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  3.54k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.54k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.54k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|  3.54k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(to, from_size));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1546|       |
 1547|  3.54k|    memcpy(to->stor_begin, from->stor_begin, from_size * sizeof(BASE));
 1548|       |
 1549|  3.54k|    return IGRAPH_SUCCESS;
 1550|  3.54k|}
igraph_vector_sum:
 1566|  21.9k|BASE FUNCTION(igraph_vector, sum)(const TYPE(igraph_vector) *v) {
 1567|  21.9k|    BASE res = ZERO;
  ------------------
  |  |   29|  21.9k|    #define BASE igraph_real_t
  ------------------
                  BASE res = ZERO;
  ------------------
  |  |   38|  21.9k|    #define ZERO 0.0
  ------------------
 1568|  21.9k|    const BASE *p;
 1569|  21.9k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  21.9k|    do { \
  |  |  925|  21.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.9k]
  |  |  ------------------
  ------------------
 1570|  21.9k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  21.9k|    do { \
  |  |  925|  21.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.9k]
  |  |  ------------------
  ------------------
 1571|   604k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1571:29): [True: 582k, False: 21.9k]
  ------------------
 1572|       |#ifdef SUM
 1573|       |        SUM(res, res, *p);
 1574|       |#else
 1575|   582k|        res += *p;
 1576|   582k|#endif
 1577|   582k|    }
 1578|  21.9k|    return res;
 1579|  21.9k|}
igraph_vector_binsearch_slice:
 2165|   260k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2166|   260k|    igraph_int_t left  = start;
 2167|   260k|    igraph_int_t right = end - 1;
 2168|       |
 2169|   260k|    if (left < 0)
  ------------------
  |  Branch (2169:9): [True: 0, False: 260k]
  ------------------
 2170|      0|        IGRAPH_ERROR("Invalid start position.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2171|       |
 2172|   260k|    if (right >= FUNCTION(igraph_vector, size)(v))
  ------------------
  |  |  170|   260k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   260k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   260k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2172:9): [True: 0, False: 260k]
  ------------------
 2173|      0|        IGRAPH_ERROR("Invalid end position.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2174|       |
 2175|   260k|    if (left > right)
  ------------------
  |  Branch (2175:9): [True: 0, False: 260k]
  ------------------
 2176|      0|        IGRAPH_ERROR("Invalid slice, start position must be smaller than end position.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2177|   260k|                     IGRAPH_EINVAL);
 2178|       |
 2179|   260k|    return FUNCTION(igraph_i_vector, binsearch_slice)(v, what, pos, start, end);
  ------------------
  |  |  170|   260k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   260k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   260k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2180|   260k|}
igraph_vector_scale:
 2258|   108k|void FUNCTION(igraph_vector, scale)(TYPE(igraph_vector) *v, BASE by) {
 2259|   108k|    const igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|   108k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   108k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   108k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2260|       |#ifdef EQ
 2261|       |    const BASE one = ONE;
 2262|       |    if (EQ(by, one)) {
 2263|       |        return;
 2264|       |    }
 2265|       |#else
 2266|   108k|    if (by == ONE) {
  ------------------
  |  |   39|   108k|    #define ONE 1.0
  ------------------
  |  Branch (2266:9): [True: 312, False: 107k]
  ------------------
 2267|    312|        return;
 2268|    312|    }
 2269|   107k|#endif
 2270|  4.58M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (2270:30): [True: 4.48M, False: 107k]
  ------------------
 2271|       |#ifdef PROD
 2272|       |        PROD(VECTOR(*v)[i], VECTOR(*v)[i], by);
 2273|       |#else
 2274|  4.48M|        VECTOR(*v)[i] *= by;
  ------------------
  |  |   60|  4.48M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2275|  4.48M|#endif
 2276|  4.48M|    }
 2277|   107k|}
igraph_vector_append:
 2427|  7.08k|                                               const TYPE(igraph_vector) *from) {
 2428|  7.08k|    IGRAPH_ASSERT(to != NULL);
  ------------------
  |  |  924|  7.08k|    do { \
  |  |  925|  7.08k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 2429|  7.08k|    IGRAPH_ASSERT(to->stor_begin != NULL);
  ------------------
  |  |  924|  7.08k|    do { \
  |  |  925|  7.08k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 2430|       |
 2431|  7.08k|    const igraph_int_t to_size = FUNCTION(igraph_vector, size)(to);
  ------------------
  |  |  170|  7.08k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  7.08k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  7.08k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|  7.08k|    const igraph_int_t from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  7.08k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  7.08k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  7.08k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|  7.08k|    const igraph_int_t to_capacity = FUNCTION(igraph_vector, capacity)(to);
  ------------------
  |  |  170|  7.08k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  7.08k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  7.08k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2434|  7.08k|    igraph_int_t new_to_size;
 2435|       |
 2436|  7.08k|    IGRAPH_SAFE_ADD(to_size, from_size, &new_to_size);
  ------------------
  |  |   47|  7.08k|    do { \
  |  |   48|  7.08k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  7.08k|        igraph_int_t _safe_sum; \
  |  |   50|  7.08k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 7.08k]
  |  |  ------------------
  |  |   51|      0|            IGRAPH_ERRORF("Overflow when adding %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|        } \
  |  |   53|  7.08k|        *(res) = _safe_sum; \
  |  |   54|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 2437|       |
 2438|  7.08k|    if (to_capacity < new_to_size) {
  ------------------
  |  Branch (2438:9): [True: 0, False: 7.08k]
  ------------------
 2439|      0|        igraph_int_t new_to_capacity = to_capacity < IGRAPH_INTEGER_MAX/2 ? to_capacity * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_to_capacity = to_capacity < IGRAPH_INTEGER_MAX/2 ? to_capacity * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (2439:40): [True: 0, False: 0]
  ------------------
 2440|      0|        if (new_to_capacity < new_to_size) {
  ------------------
  |  Branch (2440:13): [True: 0, False: 0]
  ------------------
 2441|      0|            new_to_capacity = new_to_size;
 2442|      0|        }
 2443|      0|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(to, new_to_capacity));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2444|      0|    }
 2445|       |
 2446|  7.08k|    memcpy(to->stor_begin + to_size, from->stor_begin,
 2447|  7.08k|           sizeof(BASE) * from_size);
 2448|  7.08k|    to->end = to->stor_begin + new_to_size;
 2449|       |
 2450|  7.08k|    return IGRAPH_SUCCESS;
 2451|  7.08k|}
igraph_vector_update:
 2524|  61.4k|                                    const TYPE(igraph_vector) *from) {
 2525|  61.4k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  61.4k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  61.4k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  61.4k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  61.4k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  656|  61.4k|    do { \
  |  |  657|  61.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  61.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  61.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 61.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  61.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 61.4k]
  |  |  ------------------
  ------------------
 2527|  61.4k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  61.4k|    return IGRAPH_SUCCESS;
 2529|  61.4k|}
igraph_vector_add:
 2696|  3.48k|                                 const TYPE(igraph_vector) *v2) {
 2697|       |
 2698|  3.48k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  3.48k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.48k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.48k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2699|  3.48k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  3.48k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.48k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.48k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|  3.48k|    igraph_int_t i;
 2701|  3.48k|    if (n1 != n2) {
  ------------------
  |  Branch (2701:9): [True: 0, False: 3.48k]
  ------------------
 2702|      0|        IGRAPH_ERROR("Vectors to be added must have the same sizes.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2703|      0|                     IGRAPH_EINVAL);
 2704|      0|    }
 2705|       |
 2706|   155k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2706:17): [True: 151k, False: 3.48k]
  ------------------
 2707|       |#ifdef SUM
 2708|       |        SUM(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2709|       |#else
 2710|   151k|        VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2711|   151k|#endif
 2712|   151k|    }
 2713|       |
 2714|  3.48k|    return IGRAPH_SUCCESS;
 2715|  3.48k|}
igraph_vector_mul:
 2767|  6.86k|                                 const TYPE(igraph_vector) *v2) {
 2768|       |
 2769|  6.86k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  6.86k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.86k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.86k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2770|  6.86k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  6.86k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.86k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.86k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2771|  6.86k|    igraph_int_t i;
 2772|  6.86k|    if (n1 != n2) {
  ------------------
  |  Branch (2772:9): [True: 0, False: 6.86k]
  ------------------
 2773|      0|        IGRAPH_ERROR("Vectors to be multiplied must have the same sizes.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2774|      0|                     IGRAPH_EINVAL);
 2775|      0|    }
 2776|       |
 2777|   215k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2777:17): [True: 209k, False: 6.86k]
  ------------------
 2778|       |#ifdef PROD
 2779|       |        PROD(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2780|       |#else
 2781|   209k|        VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   209k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   209k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2782|   209k|#endif
 2783|   209k|    }
 2784|       |
 2785|  6.86k|    return IGRAPH_SUCCESS;
 2786|  6.86k|}
igraph_vector_index:
 3423|   605k|                                   const igraph_vector_int_t *idx) {
 3424|       |
 3425|   605k|    igraph_int_t i, j, newlen = igraph_vector_int_size(idx);
 3426|   605k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(newv, newlen));
  ------------------
  |  |  656|   605k|    do { \
  |  |  657|   605k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   605k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   605k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 605k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   605k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 605k]
  |  |  ------------------
  ------------------
 3427|       |
 3428|   956k|    for (i = 0; i < newlen; i++) {
  ------------------
  |  Branch (3428:17): [True: 350k, False: 605k]
  ------------------
 3429|   350k|        j = VECTOR(*idx)[i];
  ------------------
  |  |   60|   350k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3430|   350k|        VECTOR(*newv)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   350k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*newv)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   350k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3431|   350k|    }
 3432|       |
 3433|   605k|    return IGRAPH_SUCCESS;
 3434|   605k|}
igraph_vector_bool_init:
  134|  10.6k|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  10.6k|    igraph_int_t alloc_size;
  136|  10.6k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  10.6k|    do { \
  |  |  925|  10.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  137|  10.6k|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 10.6k, False: 3]
  ------------------
  138|       |
  139|       |    /* When this function fails, it should leave stor_begin set to NULL,
  140|       |     * so that vector_destroy() is still safe to call on the vector.
  141|       |     * This simplifies freeing partially initialized data structures,
  142|       |     * such as adjacency lists, when an error occurs mid-initialization. */
  143|  10.6k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  10.6k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  21.2k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  10.6k|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  10.6k|    do { \
  |  |  710|  10.6k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  145|  10.6k|    v->stor_end = v->stor_begin + alloc_size;
  146|  10.6k|    v->end = v->stor_begin + size;
  147|       |
  148|  10.6k|    return IGRAPH_SUCCESS;
  149|  10.6k|}
igraph_vector_bool_destroy:
  408|  10.6k|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  10.6k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.6k|    do { \
  |  |  925|  10.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  10.6k|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 10.6k, False: 0]
  ------------------
  413|  10.6k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  10.6k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  10.6k|    }
  416|  10.6k|}
igraph_vector_int_init:
  134|  9.60M|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  9.60M|    igraph_int_t alloc_size;
  136|  9.60M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  9.60M|    do { \
  |  |  925|  9.60M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  9.60M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 9.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  9.60M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 9.60M]
  |  |  ------------------
  ------------------
  137|  9.60M|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 3.32M, False: 6.27M]
  ------------------
  138|       |
  139|       |    /* When this function fails, it should leave stor_begin set to NULL,
  140|       |     * so that vector_destroy() is still safe to call on the vector.
  141|       |     * This simplifies freeing partially initialized data structures,
  142|       |     * such as adjacency lists, when an error occurs mid-initialization. */
  143|  9.60M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  9.60M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  19.2M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 9.60M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 9.60M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 9.60M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  9.60M|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  9.60M|    do { \
  |  |  710|  9.60M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  9.60M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 9.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  9.60M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 9.60M]
  |  |  ------------------
  ------------------
  145|  9.60M|    v->stor_end = v->stor_begin + alloc_size;
  146|  9.60M|    v->end = v->stor_begin + size;
  147|       |
  148|  9.60M|    return IGRAPH_SUCCESS;
  149|  9.60M|}
igraph_vector_int_destroy:
  408|  9.60M|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  9.60M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  9.60M|    do { \
  |  |  925|  9.60M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  9.60M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 9.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  9.60M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 9.60M]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  9.60M|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 9.60M, False: 0]
  ------------------
  413|  9.60M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  9.60M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  9.60M|    }
  416|  9.60M|}
igraph_vector_int_capacity:
  436|  13.0M|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|  13.0M|    return v->stor_end - v->stor_begin;
  438|  13.0M|}
igraph_vector_int_reserve:
  468|  12.8M|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|  12.8M|    igraph_int_t current_capacity;
  470|  12.8M|    BASE *tmp;
  ------------------
  |  |   66|  12.8M|    #define BASE igraph_int_t
  ------------------
  471|       |
  472|  12.8M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  12.8M|    do { \
  |  |  925|  12.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.8M]
  |  |  ------------------
  ------------------
  473|  12.8M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  12.8M|    do { \
  |  |  925|  12.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.8M]
  |  |  ------------------
  ------------------
  474|  12.8M|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  12.8M|    do { \
  |  |  925|  12.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  12.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  12.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 12.8M]
  |  |  ------------------
  ------------------
  475|       |
  476|  12.8M|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  178|  12.8M|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  12.8M|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  12.8M|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|  12.8M|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 11.7M, False: 1.13M]
  ------------------
  479|  11.7M|        return IGRAPH_SUCCESS;
  480|  11.7M|    }
  481|       |
  482|  1.13M|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|  1.13M|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|  2.26M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 1.13M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 1.13M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 1.13M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  1.13M|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|  1.13M|    do { \
  |  |  710|  1.13M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  1.13M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  1.13M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 1.13M]
  |  |  ------------------
  ------------------
  484|       |
  485|  1.13M|    v->end = tmp + (v->end - v->stor_begin);
  486|  1.13M|    v->stor_begin = tmp;
  487|  1.13M|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|  1.13M|    return IGRAPH_SUCCESS;
  490|  1.13M|}
igraph_vector_int_empty:
  503|   144k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   144k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   144k|    do { \
  |  |  925|   144k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   144k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   144k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 144k]
  |  |  ------------------
  ------------------
  505|   144k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   144k|    do { \
  |  |  925|   144k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   144k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   144k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 144k]
  |  |  ------------------
  ------------------
  506|   144k|    return v->stor_begin == v->end;
  507|   144k|}
igraph_vector_int_size:
  522|  44.8M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|  44.8M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  44.8M|    do { \
  |  |  925|  44.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  44.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  44.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 44.8M]
  |  |  ------------------
  ------------------
  524|  44.8M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  44.8M|    do { \
  |  |  925|  44.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  44.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  44.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 44.8M]
  |  |  ------------------
  ------------------
  525|  44.8M|    return v->end - v->stor_begin;
  526|  44.8M|}
igraph_vector_int_clear:
  542|  4.02M|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|  4.02M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  4.02M|    do { \
  |  |  925|  4.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.02M]
  |  |  ------------------
  ------------------
  544|  4.02M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  4.02M|    do { \
  |  |  925|  4.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.02M]
  |  |  ------------------
  ------------------
  545|  4.02M|    v->end = v->stor_begin;
  546|  4.02M|}
igraph_vector_int_push_back:
  573|  5.49M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  5.49M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  5.49M|    do { \
  |  |  925|  5.49M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  5.49M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  5.49M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 5.49M]
  |  |  ------------------
  ------------------
  575|  5.49M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  5.49M|    do { \
  |  |  925|  5.49M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  5.49M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  5.49M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 5.49M]
  |  |  ------------------
  ------------------
  576|       |
  577|  5.49M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 167k, False: 5.32M]
  ------------------
  578|       |        /* full, allocate more storage */
  579|   167k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   167k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   167k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   167k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|   167k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|   167k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|   167k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 167k, False: 0]
  ------------------
  581|   167k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|   167k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 167k]
  ------------------
  582|      0|            IGRAPH_ERROR("Cannot push to vector, already at maximum size.", IGRAPH_EOVERFLOW);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  583|      0|        }
  584|   167k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 167k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|   167k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|   167k|    do { \
  |  |  657|   167k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   167k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   167k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 167k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   167k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 167k]
  |  |  ------------------
  ------------------
  588|   167k|    }
  589|       |
  590|  5.49M|    *(v->end) = e;
  591|  5.49M|    v->end += 1;
  592|       |
  593|  5.49M|    return IGRAPH_SUCCESS;
  594|  5.49M|}
igraph_vector_int_null:
  725|   493k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   493k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   493k|    do { \
  |  |  925|   493k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   493k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 493k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   493k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 493k]
  |  |  ------------------
  ------------------
  727|   493k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   493k|    do { \
  |  |  925|   493k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   493k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 493k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   493k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 493k]
  |  |  ------------------
  ------------------
  728|   493k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  178|   493k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   493k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   493k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 493k, False: 68]
  ------------------
  729|   493k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  178|   493k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   493k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   493k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   493k|    }
  731|   493k|}
igraph_vector_int_fill:
  745|   316k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|   316k|    BASE *ptr;
  ------------------
  |  |   66|   316k|    #define BASE igraph_int_t
  ------------------
  747|   316k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   316k|    do { \
  |  |  925|   316k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   316k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 316k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   316k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 316k]
  |  |  ------------------
  ------------------
  748|   316k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   316k|    do { \
  |  |  925|   316k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   316k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 316k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   316k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 316k]
  |  |  ------------------
  ------------------
  749|       |
  750|       |    /* Optimize the commonly used integer case when filling with 0
  751|       |     * or -1, which are an all-0 and all-1 bit pattern that the
  752|       |     * compiler can generate higher efficiency code for. */
  753|   316k|#if defined(BASE_INT)
  754|   316k|    if (e == 0) {
  ------------------
  |  Branch (754:9): [True: 0, False: 316k]
  ------------------
  755|      0|        FUNCTION(igraph_vector, null)(v);
  ------------------
  |  |  178|      0|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|      0|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|      0|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  756|      0|        return;
  757|      0|    }
  758|   316k|    if (e == -1) {
  ------------------
  |  Branch (758:9): [True: 316k, False: 0]
  ------------------
  759|  17.7M|        for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (759:35): [True: 17.4M, False: 316k]
  ------------------
  760|  17.4M|            *ptr = -1;
  761|  17.4M|        }
  762|   316k|        return;
  763|   316k|    }
  764|      0|#endif
  765|       |
  766|      0|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (766:31): [True: 0, False: 0]
  ------------------
  767|      0|        *ptr = e;
  768|      0|    }
  769|      0|}
igraph_vector_int_range:
  791|  7.29k|igraph_error_t FUNCTION(igraph_vector, range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
  792|  7.29k|    BASE *p;
  ------------------
  |  |   66|  7.29k|    #define BASE igraph_int_t
  ------------------
  793|  7.29k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(v, (end - start)));
  ------------------
  |  |  656|  7.29k|    do { \
  |  |  657|  7.29k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.29k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.29k]
  |  |  ------------------
  ------------------
  794|       |
  795|   323k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (795:29): [True: 316k, False: 7.29k]
  ------------------
  796|   316k|        *p = start;
  797|   316k|        start = start + ONE;
  ------------------
  |  |   72|   316k|    #define ONE 1
  ------------------
  798|   316k|    }
  799|       |
  800|  7.29k|    return IGRAPH_SUCCESS;
  801|  7.29k|}
igraph_vector_int_pop_back:
  838|   742k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   742k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   742k|    do { \
  |  |  925|   742k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   742k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 742k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   742k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 742k]
  |  |  ------------------
  ------------------
  840|   742k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   742k|    do { \
  |  |  925|   742k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   742k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 742k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   742k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 742k]
  |  |  ------------------
  ------------------
  841|   742k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   742k|    do { \
  |  |  925|   742k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   742k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 742k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   742k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 742k]
  |  |  ------------------
  ------------------
  842|   742k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   742k|    do { \
  |  |  925|   742k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   742k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 742k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   742k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 742k]
  |  |  ------------------
  ------------------
  843|       |
  844|   742k|    (v->end)--;
  845|       |
  846|   742k|    return *(v->end);
  847|   742k|}
igraph_vector_int_sort:
  958|   302k|void FUNCTION(igraph_vector, sort)(TYPE(igraph_vector) *v) {
  959|   302k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   302k|    do { \
  |  |  925|   302k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  960|   302k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   302k|    do { \
  |  |  925|   302k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  961|   302k|    igraph_qsort(v->stor_begin, FUNCTION(igraph_vector, size)(v),
  ------------------
  |  |  178|   302k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   302k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   302k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  962|   302k|                 sizeof(BASE), FUNCTION(igraph_vector, sort_cmp));
  ------------------
  |  |  178|   302k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   302k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   302k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|   302k|}
igraph_vector_int_sort_ind:
 1045|  41.9k|        igraph_order_t order) {
 1046|       |
 1047|  41.9k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  41.9k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  41.9k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  41.9k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  41.9k|    BASE **vind, *first;
  ------------------
  |  |   66|  41.9k|    #define BASE igraph_int_t
  ------------------
 1049|  41.9k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  41.9k|    do { \
  |  |  657|  41.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
 1050|  41.9k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 41.9k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  41.9k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  41.9k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  83.8k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 41.9k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 41.9k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 41.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  41.9k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  41.9k|    do { \
  |  |  710|  41.9k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  41.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  41.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 41.9k]
  |  |  ------------------
  ------------------
 1055|  2.39M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 2.34M, False: 41.9k]
  ------------------
 1056|  2.34M|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|  2.34M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|  2.34M|    }
 1058|  41.9k|    first = vind[0];
 1059|  41.9k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 41.9k, False: 0]
  ------------------
 1060|  41.9k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_asc));
  ------------------
  |  |  178|  41.9k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  41.9k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  41.9k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1061|  41.9k|    } else {
 1062|      0|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_desc));
  ------------------
  |  |  178|      0|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|      0|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|      0|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|      0|    }
 1064|  2.39M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 2.34M, False: 41.9k]
  ------------------
 1065|  2.34M|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|  2.34M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|  2.34M|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  41.9k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  41.9k|    return IGRAPH_SUCCESS;
 1069|  41.9k|}
igraph_vector_int_resize:
 1264|  11.8M|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|  11.8M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  11.8M|    do { \
  |  |  925|  11.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
 1266|  11.8M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  11.8M|    do { \
  |  |  925|  11.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
 1267|  11.8M|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  11.8M|    do { \
  |  |  657|  11.8M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  11.8M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  11.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  11.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
 1268|  11.8M|    v->end = v->stor_begin + new_size;
 1269|  11.8M|    return IGRAPH_SUCCESS;
 1270|  11.8M|}
igraph_vector_int_max:
 1327|  91.9k|BASE FUNCTION(igraph_vector, max)(const TYPE(igraph_vector) *v) {
 1328|  91.9k|    BASE max;
  ------------------
  |  |   66|  91.9k|    #define BASE igraph_int_t
  ------------------
 1329|  91.9k|    BASE *ptr;
  ------------------
  |  |   66|  91.9k|    #define BASE igraph_int_t
  ------------------
 1330|  91.9k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  91.9k|    do { \
  |  |  925|  91.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  91.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 91.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  91.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 91.9k]
  |  |  ------------------
  ------------------
 1331|  91.9k|    max = *(v->stor_begin);
 1332|       |#if defined(BASE_IGRAPH_REAL)
 1333|       |    if (isnan(max)) { return max; }; /* Result is NaN */
 1334|       |#endif
 1335|  91.9k|    ptr = v->stor_begin + 1;
 1336|  3.32M|    while (ptr < v->end) {
  ------------------
  |  Branch (1336:12): [True: 3.23M, False: 91.9k]
  ------------------
 1337|  3.23M|        if ((*ptr) > max) {
  ------------------
  |  Branch (1337:13): [True: 1.94M, False: 1.28M]
  ------------------
 1338|  1.94M|            max = *ptr;
 1339|  1.94M|        }
 1340|       |#if defined(BASE_IGRAPH_REAL)
 1341|       |        else if (isnan(*ptr))
 1342|       |            return *ptr; /* Result is NaN */
 1343|       |#endif
 1344|  3.23M|        ptr++;
 1345|  3.23M|    }
 1346|  91.9k|    return max;
 1347|  91.9k|}
igraph_vector_int_init_copy:
 1538|   388k|) {
 1539|   388k|    igraph_int_t from_size;
 1540|       |
 1541|   388k|    IGRAPH_ASSERT(from != NULL);
  ------------------
  |  |  924|   388k|    do { \
  |  |  925|   388k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   388k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 388k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   388k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 388k]
  |  |  ------------------
  ------------------
 1542|   388k|    IGRAPH_ASSERT(from->stor_begin != NULL);
  ------------------
  |  |  924|   388k|    do { \
  |  |  925|   388k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   388k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 388k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   388k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 388k]
  |  |  ------------------
  ------------------
 1543|       |
 1544|   388k|    from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   388k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   388k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   388k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|   388k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(to, from_size));
  ------------------
  |  |  656|   388k|    do { \
  |  |  657|   388k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   388k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   388k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 388k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   388k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 388k]
  |  |  ------------------
  ------------------
 1546|       |
 1547|   388k|    memcpy(to->stor_begin, from->stor_begin, from_size * sizeof(BASE));
 1548|       |
 1549|   388k|    return IGRAPH_SUCCESS;
 1550|   388k|}
igraph_vector_int_init_range:
 1686|  56.7k|igraph_error_t FUNCTION(igraph_vector, init_range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
 1687|  56.7k|    BASE *p;
  ------------------
  |  |   66|  56.7k|    #define BASE igraph_int_t
  ------------------
 1688|  56.7k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(v, (end - start)));
  ------------------
  |  |  656|  56.7k|    do { \
  |  |  657|  56.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  56.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  56.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 56.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  56.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 56.7k]
  |  |  ------------------
  ------------------
 1689|       |
 1690|  2.47M|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1690:29): [True: 2.41M, False: 56.7k]
  ------------------
 1691|  2.41M|        *p = start;
 1692|  2.41M|        start = start + ONE;
  ------------------
  |  |   72|  2.41M|    #define ONE 1
  ------------------
 1693|  2.41M|    }
 1694|       |
 1695|  56.7k|    return IGRAPH_SUCCESS;
 1696|  56.7k|}
igraph_vector_int_remove_section:
 1716|  6.01k|        TYPE(igraph_vector) *v, igraph_int_t from, igraph_int_t to) {
 1717|  6.01k|    igraph_int_t size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  6.01k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.01k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.01k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1718|       |
 1719|  6.01k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  6.01k|    do { \
  |  |  925|  6.01k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.01k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.01k]
  |  |  ------------------
  ------------------
 1720|  6.01k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  6.01k|    do { \
  |  |  925|  6.01k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.01k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.01k]
  |  |  ------------------
  ------------------
 1721|       |
 1722|  6.01k|    if (from < 0) {
  ------------------
  |  Branch (1722:9): [True: 0, False: 6.01k]
  ------------------
 1723|      0|        from = 0;
 1724|      0|    }
 1725|       |
 1726|  6.01k|    if (to > size) {
  ------------------
  |  Branch (1726:9): [True: 0, False: 6.01k]
  ------------------
 1727|      0|        to = size;
 1728|      0|    }
 1729|       |
 1730|  6.01k|    if (to > from) {
  ------------------
  |  Branch (1730:9): [True: 6.01k, False: 0]
  ------------------
 1731|  6.01k|        memmove(v->stor_begin + from, v->stor_begin + to,
 1732|  6.01k|                sizeof(BASE) * (v->end - v->stor_begin - to));
 1733|  6.01k|        v->end -= (to - from);
 1734|  6.01k|    }
 1735|  6.01k|}
igraph_vector_int_move_interval:
 1804|   198k|        igraph_int_t begin, igraph_int_t end, igraph_int_t to) {
 1805|   198k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   198k|    do { \
  |  |  925|   198k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   198k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   198k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 198k]
  |  |  ------------------
  ------------------
 1806|   198k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   198k|    do { \
  |  |  925|   198k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   198k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   198k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 198k]
  |  |  ------------------
  ------------------
 1807|   198k|    memmove(v->stor_begin + to, v->stor_begin + begin,
 1808|   198k|           sizeof(BASE) * (end - begin));
 1809|       |
 1810|   198k|    return IGRAPH_SUCCESS;
 1811|   198k|}
igraph_vector_int_isininterval:
 1832|   690k|        BASE high) {
 1833|   690k|    BASE *ptr;
  ------------------
  |  |   66|   690k|    #define BASE igraph_int_t
  ------------------
 1834|   690k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   690k|    do { \
  |  |  925|   690k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   690k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 690k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   690k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 690k]
  |  |  ------------------
  ------------------
 1835|   690k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   690k|    do { \
  |  |  925|   690k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   690k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 690k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   690k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 690k]
  |  |  ------------------
  ------------------
 1836|  3.56M|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (1836:31): [True: 2.87M, False: 690k]
  ------------------
 1837|       |        /* Note that the following is not equivalent to *ptr < low || *ptr > high
 1838|       |         * when *ptr is NaN! */
 1839|  2.87M|        if (!(*ptr >= low && *ptr <= high)) {
  ------------------
  |  Branch (1839:15): [True: 2.87M, False: 0]
  |  Branch (1839:30): [True: 2.87M, False: 0]
  ------------------
 1840|      0|            return 0;
 1841|      0|        }
 1842|  2.87M|    }
 1843|   690k|    return 1;
 1844|   690k|}
igraph_vector_int_search:
 2364|   192k|        igraph_int_t from, BASE what, igraph_int_t *pos) {
 2365|   192k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   192k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   192k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   192k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|  2.38M|    for (i = from; i < n; i++) {
  ------------------
  |  Branch (2366:20): [True: 2.38M, False: 0]
  ------------------
 2367|       |#ifdef EQ
 2368|       |        if (EQ(VECTOR(*v)[i], what)) {
 2369|       |            break;
 2370|       |        }
 2371|       |#else
 2372|  2.38M|        if (VECTOR(*v)[i] == what) {
  ------------------
  |  |   60|  2.38M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2372:13): [True: 192k, False: 2.19M]
  ------------------
 2373|   192k|            break;
 2374|   192k|        }
 2375|  2.38M|#endif
 2376|  2.38M|    }
 2377|       |
 2378|   192k|    if (i < n) {
  ------------------
  |  Branch (2378:9): [True: 192k, False: 0]
  ------------------
 2379|   192k|        if (pos != 0) {
  ------------------
  |  Branch (2379:13): [True: 192k, False: 0]
  ------------------
 2380|   192k|            *pos = i;
 2381|   192k|        }
 2382|   192k|        return true;
 2383|   192k|    } else {
 2384|       |        return false;
 2385|      0|    }
 2386|   192k|}
igraph_vector_int_append:
 2427|   154k|                                               const TYPE(igraph_vector) *from) {
 2428|   154k|    IGRAPH_ASSERT(to != NULL);
  ------------------
  |  |  924|   154k|    do { \
  |  |  925|   154k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
 2429|   154k|    IGRAPH_ASSERT(to->stor_begin != NULL);
  ------------------
  |  |  924|   154k|    do { \
  |  |  925|   154k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
 2430|       |
 2431|   154k|    const igraph_int_t to_size = FUNCTION(igraph_vector, size)(to);
  ------------------
  |  |  178|   154k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   154k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   154k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|   154k|    const igraph_int_t from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   154k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   154k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   154k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|   154k|    const igraph_int_t to_capacity = FUNCTION(igraph_vector, capacity)(to);
  ------------------
  |  |  178|   154k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   154k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   154k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2434|   154k|    igraph_int_t new_to_size;
 2435|       |
 2436|   154k|    IGRAPH_SAFE_ADD(to_size, from_size, &new_to_size);
  ------------------
  |  |   47|   154k|    do { \
  |  |   48|   154k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|   154k|        igraph_int_t _safe_sum; \
  |  |   50|   154k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 154k]
  |  |  ------------------
  |  |   51|      0|            IGRAPH_ERRORF("Overflow when adding %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|        } \
  |  |   53|   154k|        *(res) = _safe_sum; \
  |  |   54|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
 2437|       |
 2438|   154k|    if (to_capacity < new_to_size) {
  ------------------
  |  Branch (2438:9): [True: 0, False: 154k]
  ------------------
 2439|      0|        igraph_int_t new_to_capacity = to_capacity < IGRAPH_INTEGER_MAX/2 ? to_capacity * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_to_capacity = to_capacity < IGRAPH_INTEGER_MAX/2 ? to_capacity * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|      0|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (2439:40): [True: 0, False: 0]
  ------------------
 2440|      0|        if (new_to_capacity < new_to_size) {
  ------------------
  |  Branch (2440:13): [True: 0, False: 0]
  ------------------
 2441|      0|            new_to_capacity = new_to_size;
 2442|      0|        }
 2443|      0|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(to, new_to_capacity));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2444|      0|    }
 2445|       |
 2446|   154k|    memcpy(to->stor_begin + to_size, from->stor_begin,
 2447|   154k|           sizeof(BASE) * from_size);
 2448|   154k|    to->end = to->stor_begin + new_to_size;
 2449|       |
 2450|   154k|    return IGRAPH_SUCCESS;
 2451|   154k|}
igraph_vector_int_update:
 2524|  72.1k|                                    const TYPE(igraph_vector) *from) {
 2525|  72.1k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|  72.1k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  72.1k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  72.1k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  72.1k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  656|  72.1k|    do { \
  |  |  657|  72.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  72.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  72.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 72.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  72.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 72.1k]
  |  |  ------------------
  ------------------
 2527|  72.1k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  72.1k|    return IGRAPH_SUCCESS;
 2529|  72.1k|}
igraph_vector_int_shuffle:
 2668|   301k|void FUNCTION(igraph_vector, shuffle)(TYPE(igraph_vector) *v) {
 2669|   301k|    igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   301k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   301k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   301k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2670|   301k|    igraph_int_t k;
 2671|   301k|    BASE dummy;
  ------------------
  |  |   66|   301k|    #define BASE igraph_int_t
  ------------------
 2672|       |
 2673|  2.12M|    while (n > 1) {
  ------------------
  |  Branch (2673:12): [True: 1.81M, False: 301k]
  ------------------
 2674|  1.81M|        k = RNG_INTEGER(0, n - 1);
  ------------------
  |  |  152|  1.81M|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
 2675|  1.81M|        n--;
 2676|  1.81M|        dummy = VECTOR(*v)[n];
  ------------------
  |  |   60|  1.81M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2677|  1.81M|        VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  1.81M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  1.81M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2678|  1.81M|        VECTOR(*v)[k] = dummy;
  ------------------
  |  |   60|  1.81M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2679|  1.81M|    }
 2680|   301k|}
igraph_vector_int_minmax:
 2861|  52.3k|                          BASE *min, BASE *max) {
 2862|  52.3k|    BASE* ptr;
  ------------------
  |  |   66|  52.3k|    #define BASE igraph_int_t
  ------------------
 2863|  52.3k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  52.3k|    do { \
  |  |  925|  52.3k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  52.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 52.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  52.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 52.3k]
  |  |  ------------------
  ------------------
 2864|  52.3k|    *min = *max = *(v->stor_begin);
 2865|       |    #if defined(BASE_IGRAPH_REAL)
 2866|       |        if (isnan(*min)) { return; }; /* Result is NaN */
 2867|       |    #endif
 2868|  52.3k|    ptr = v->stor_begin + 1;
 2869|  2.80M|    while (ptr < v->end) {
  ------------------
  |  Branch (2869:12): [True: 2.75M, False: 52.3k]
  ------------------
 2870|  2.75M|        if (*ptr > *max) {
  ------------------
  |  Branch (2870:13): [True: 438k, False: 2.31M]
  ------------------
 2871|   438k|            *max = *ptr;
 2872|  2.31M|        } else if (*ptr < *min) {
  ------------------
  |  Branch (2872:20): [True: 47.5k, False: 2.26M]
  ------------------
 2873|  47.5k|            *min = *ptr;
 2874|  47.5k|        }
 2875|       |        #if defined(BASE_IGRAPH_REAL)
 2876|       |        else if (isnan(*ptr)) { /* Result is NaN */
 2877|       |            *min = *max = *ptr;
 2878|       |            return;
 2879|       |        };
 2880|       |        #endif
 2881|  2.75M|        ptr++;
 2882|  2.75M|    }
 2883|  52.3k|}
igraph_vector_int_intersection_size_sorted:
 3172|  57.3k|        const TYPE(igraph_vector) *v2) {
 3173|       |
 3174|  57.3k|    igraph_int_t size1, size2, count;
 3175|  57.3k|    igraph_real_t r;
 3176|       |
 3177|  57.3k|    size1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  178|  57.3k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  57.3k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  57.3k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3178|  57.3k|    size2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  178|  57.3k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  57.3k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  57.3k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3179|       |
 3180|  57.3k|    count = 0;
 3181|       |
 3182|  57.3k|    if (size1 == 0 || size2 == 0) {
  ------------------
  |  Branch (3182:9): [True: 0, False: 57.3k]
  |  Branch (3182:23): [True: 0, False: 57.3k]
  ------------------
 3183|      0|        return count;
 3184|      0|    }
 3185|       |
 3186|  57.3k|    r = size1 > size2 ? (igraph_real_t) size1 / size2 : (igraph_real_t) size2 / size1;
  ------------------
  |  Branch (3186:9): [True: 24.6k, False: 32.7k]
  ------------------
 3187|       |
 3188|       |    /* When the set size ratio is small, use a simple linear scan. The ideal ratio
 3189|       |     * seems to be affected by processor cache effects. It depends on the machine,
 3190|       |     * as well as on the input sizes. The threshold of 10 was determined empirically
 3191|       |     * by using the intersection.c (direct) and igraph_ecc.c (indirect) benchmarks.
 3192|       |     * See https://github.com/igraph/igraph/pull/2618 */
 3193|  57.3k|    if (r < 10) {
  ------------------
  |  Branch (3193:9): [True: 45.5k, False: 11.8k]
  ------------------
 3194|       |        /* This is a fast branchless implementation that uses arithmetic
 3195|       |         * instead of conditionals. */
 3196|  45.5k|        igraph_int_t i1 = 0, i2 = 0;
 3197|   350k|        while (i1 < size1 && i2 < size2) {
  ------------------
  |  Branch (3197:16): [True: 326k, False: 23.7k]
  |  Branch (3197:30): [True: 304k, False: 21.7k]
  ------------------
 3198|   304k|            BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   66|   304k|    #define BASE igraph_int_t
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3199|   304k|            igraph_int_t d1 = (e1 <= e2), d2 = (e1 >= e2);
 3200|   304k|            i1 += d1; i2 += d2;
 3201|   304k|            count += (d1 == d2);
 3202|   304k|        }
 3203|  45.5k|    } else {
 3204|  11.8k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  11.8k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  11.8k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  11.8k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3205|  11.8k|            v1, 0, size1, v2, 0, size2, &count);
 3206|  11.8k|    }
 3207|       |
 3208|  57.3k|    return count;
 3209|  57.3k|}
vector.c:igraph_vector_i_sort_ind_cmp_desc:
 1004|   358k|static int FUNCTION(igraph_vector, i_sort_ind_cmp_desc)(const void *p1, const void *p2) {
 1005|   358k|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   29|   358k|    #define BASE igraph_real_t
  ------------------
 1006|   358k|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   29|   358k|    #define BASE igraph_real_t
  ------------------
 1007|   358k|    if ( **pa < **pb ) {
  ------------------
  |  Branch (1007:10): [True: 124k, False: 234k]
  ------------------
 1008|   124k|        return 1;
 1009|   124k|    }
 1010|   234k|    if ( **pa > **pb) {
  ------------------
  |  Branch (1010:10): [True: 108k, False: 125k]
  ------------------
 1011|   108k|        return -1;
 1012|   108k|    }
 1013|   125k|    return 0;
 1014|   234k|}
vector.c:igraph_i_vector_binsearch_slice:
 2183|   260k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|   260k|    igraph_int_t left  = start;
 2185|   260k|    igraph_int_t right = end - 1;
 2186|       |
 2187|   534k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 273k, False: 260k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|   273k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|   273k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|   273k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 260k, False: 13.0k]
  ------------------
 2191|   260k|            right = middle - 1;
 2192|   260k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  13.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 13.0k, False: 0]
  ------------------
 2193|  13.0k|            left = middle + 1;
 2194|  13.0k|        } else {
 2195|      0|            if (pos != 0) {
  ------------------
  |  Branch (2195:17): [True: 0, False: 0]
  ------------------
 2196|      0|                *pos = middle;
 2197|      0|            }
 2198|      0|            return true;
 2199|      0|        }
 2200|   273k|    }
 2201|       |
 2202|       |    /* if we are here, the element was not found */
 2203|   260k|    if (pos != 0) {
  ------------------
  |  Branch (2203:9): [True: 260k, False: 0]
  ------------------
 2204|   260k|        *pos = left;
 2205|   260k|    }
 2206|       |
 2207|       |    return false;
 2208|   260k|}
vector.c:igraph_vector_int_sort_cmp:
  924|  6.55k|static int FUNCTION(igraph_vector, sort_cmp)(const void *a, const void *b) {
  925|  6.55k|    const BASE *da = (const BASE *) a;
  926|  6.55k|    const BASE *db = (const BASE *) b;
  927|       |
  928|  6.55k|    return (*da > *db) - (*da < *db);
  929|  6.55k|}
vector.c:igraph_vector_int_i_sort_ind_cmp_asc:
  989|  11.0M|static int FUNCTION(igraph_vector, i_sort_ind_cmp_asc)(const void *p1, const void *p2) {
  990|  11.0M|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   66|  11.0M|    #define BASE igraph_int_t
  ------------------
  991|  11.0M|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   66|  11.0M|    #define BASE igraph_int_t
  ------------------
  992|  11.0M|    if ( **pa < **pb ) {
  ------------------
  |  Branch (992:10): [True: 5.77M, False: 5.28M]
  ------------------
  993|  5.77M|        return -1;
  994|  5.77M|    }
  995|  5.28M|    if ( **pa > **pb) {
  ------------------
  |  Branch (995:10): [True: 4.57M, False: 713k]
  ------------------
  996|  4.57M|        return 1;
  997|  4.57M|    }
  998|   713k|    return 0;
  999|  5.28M|}
vector.c:igraph_i_vector_int_binsearch_slice:
 2183|  14.2k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|  14.2k|    igraph_int_t left  = start;
 2185|  14.2k|    igraph_int_t right = end - 1;
 2186|       |
 2187|  70.8k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 58.4k, False: 12.3k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|  58.4k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|  58.4k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|  58.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 47.6k, False: 10.8k]
  ------------------
 2191|  47.6k|            right = middle - 1;
 2192|  47.6k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  10.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 8.97k, False: 1.84k]
  ------------------
 2193|  8.97k|            left = middle + 1;
 2194|  8.97k|        } else {
 2195|  1.84k|            if (pos != 0) {
  ------------------
  |  Branch (2195:17): [True: 1.84k, False: 0]
  ------------------
 2196|  1.84k|                *pos = middle;
 2197|  1.84k|            }
 2198|  1.84k|            return true;
 2199|  1.84k|        }
 2200|  58.4k|    }
 2201|       |
 2202|       |    /* if we are here, the element was not found */
 2203|  12.3k|    if (pos != 0) {
  ------------------
  |  Branch (2203:9): [True: 12.3k, False: 0]
  ------------------
 2204|  12.3k|        *pos = left;
 2205|  12.3k|    }
 2206|       |
 2207|       |    return false;
 2208|  14.2k|}
vector.c:igraph_i_vector_int_intersection_size_sorted:
 3095|  40.3k|    igraph_int_t *result) {
 3096|       |
 3097|  40.3k|    igraph_int_t size1, size2, probe1, probe2;
 3098|       |
 3099|  40.3k|    if (begin1 == end1 || begin2 == end2) {
  ------------------
  |  Branch (3099:9): [True: 18.6k, False: 21.7k]
  |  Branch (3099:27): [True: 7.50k, False: 14.2k]
  ------------------
 3100|  26.1k|        return;
 3101|  26.1k|    }
 3102|       |
 3103|  14.2k|    size1 = end1 - begin1;
 3104|  14.2k|    size2 = end2 - begin2;
 3105|       |
 3106|  14.2k|    if (size1 < size2) {
  ------------------
  |  Branch (3106:9): [True: 6.98k, False: 7.26k]
  ------------------
 3107|  6.98k|        probe1 = begin1 + (size1 >> 1);      /* pick the median element */
 3108|  6.98k|        FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |  178|  6.98k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.98k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |   60|  6.98k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3109|  6.98k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  6.98k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.98k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3110|  6.98k|            v1, begin1, probe1, v2, begin2, probe2, result
 3111|  6.98k|        );
 3112|  6.98k|        if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  6.65k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  6.65k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3112:15): [True: 336, False: 6.65k]
  |  Branch (3112:33): [True: 5.88k, False: 770]
  ------------------
 3113|    770|            (*result)++;
 3114|    770|            probe2++;
 3115|    770|        }
 3116|  6.98k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  6.98k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.98k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3117|  6.98k|            v1, probe1 + 1, end1, v2, probe2, end2, result
 3118|  6.98k|        );
 3119|  7.26k|    } else {
 3120|  7.26k|        probe2 = begin2 + (size2 >> 1);      /* pick the median element */
 3121|  7.26k|        FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |  178|  7.26k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.26k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.26k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |   60|  7.26k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3122|  7.26k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  7.26k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.26k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.26k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3123|  7.26k|            v1, begin1, probe1, v2, begin2, probe2, result
 3124|  7.26k|        );
 3125|  7.26k|        if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  6.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  6.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3125:15): [True: 287, False: 6.97k]
  |  Branch (3125:33): [True: 5.89k, False: 1.07k]
  ------------------
 3126|  1.07k|            (*result)++;
 3127|  1.07k|            probe1++;
 3128|  1.07k|        }
 3129|  7.26k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  7.26k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.26k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.26k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3130|  7.26k|            v1, probe1, end1, v2, probe2 + 1, end2, result
 3131|  7.26k|        );
 3132|  7.26k|    }
 3133|  14.2k|}

igraph_vector_ptr_init:
   86|   158k|igraph_error_t igraph_vector_ptr_init(igraph_vector_ptr_t* v, igraph_int_t size) {
   87|   158k|    igraph_int_t alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (87:31): [True: 0, False: 158k]
  ------------------
   88|   158k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   158k|    do { \
  |  |  925|   158k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   158k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 158k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   158k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 158k]
  |  |  ------------------
  ------------------
   89|   158k|    if (size < 0) {
  ------------------
  |  Branch (89:9): [True: 0, False: 158k]
  ------------------
   90|      0|        size = 0;
   91|      0|    }
   92|   158k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, void*);
  ------------------
  |  |   33|   158k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   317k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 158k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 158k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 158k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|   158k|    if (v->stor_begin == 0) {
  ------------------
  |  Branch (93:9): [True: 0, False: 158k]
  ------------------
   94|      0|        IGRAPH_ERROR("Insufficient memory for initializing a pointer vector.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   95|      0|    }
   96|   158k|    v->stor_end = v->stor_begin + alloc_size;
   97|   158k|    v->end = v->stor_begin + size;
   98|   158k|    v->item_destructor = 0;
   99|       |
  100|   158k|    return IGRAPH_SUCCESS;
  101|   158k|}
igraph_vector_ptr_destroy:
  132|   200k|void igraph_vector_ptr_destroy(igraph_vector_ptr_t* v) {
  133|   200k|    IGRAPH_ASSERT(v != 0);
  ------------------
  |  |  924|   200k|    do { \
  |  |  925|   200k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   200k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 200k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   200k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 200k]
  |  |  ------------------
  ------------------
  134|   200k|    if (v->stor_begin != 0) {
  ------------------
  |  Branch (134:9): [True: 158k, False: 41.9k]
  ------------------
  135|   158k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|   158k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  136|       |        v->stor_begin = NULL;
  137|   158k|    }
  138|   200k|}
igraph_vector_ptr_reserve:
  215|   114k|igraph_error_t igraph_vector_ptr_reserve(igraph_vector_ptr_t* v, igraph_int_t capacity) {
  216|   114k|    igraph_int_t actual_size = igraph_vector_ptr_size(v);
  217|   114k|    void **tmp;
  218|   114k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   114k|    do { \
  |  |  925|   114k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   114k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  219|   114k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   114k|    do { \
  |  |  925|   114k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   114k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  220|   114k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|   114k|    do { \
  |  |  925|   114k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   114k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  221|       |
  222|   114k|    if (capacity <= igraph_vector_ptr_size(v)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 114k]
  ------------------
  223|      0|        return IGRAPH_SUCCESS;
  224|      0|    }
  225|       |
  226|   114k|    tmp = IGRAPH_REALLOC(v->stor_begin, (size_t) capacity, void*);
  ------------------
  |  |   35|   114k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   229k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 114k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 114k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 114k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|   114k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for pointer vector.");
  ------------------
  |  |  709|   114k|    do { \
  |  |  710|   114k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   114k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  228|       |
  229|   114k|    v->stor_begin = tmp;
  230|   114k|    v->stor_end = v->stor_begin + capacity;
  231|   114k|    v->end = v->stor_begin + actual_size;
  232|       |
  233|   114k|    return IGRAPH_SUCCESS;
  234|   114k|}
igraph_vector_ptr_size:
  291|   955k|igraph_int_t igraph_vector_ptr_size(const igraph_vector_ptr_t* v) {
  292|   955k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   955k|    do { \
  |  |  925|   955k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   955k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 955k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   955k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 955k]
  |  |  ------------------
  ------------------
  293|   955k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   955k|    do { \
  |  |  925|   955k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   955k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 955k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   955k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 955k]
  |  |  ------------------
  ------------------
  294|   955k|    return v->end - v->stor_begin;
  295|   955k|}
igraph_vector_ptr_push_back:
  360|   166k|igraph_error_t igraph_vector_ptr_push_back(igraph_vector_ptr_t* v, void* e) {
  361|   166k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   166k|    do { \
  |  |  925|   166k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   166k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 166k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   166k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 166k]
  |  |  ------------------
  ------------------
  362|   166k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   166k|    do { \
  |  |  925|   166k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   166k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 166k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   166k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 166k]
  |  |  ------------------
  ------------------
  363|       |
  364|       |    /* full, allocate more storage */
  365|   166k|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (365:9): [True: 56.9k, False: 109k]
  ------------------
  366|  56.9k|        igraph_int_t new_size = igraph_vector_ptr_size(v) * 2;
  367|  56.9k|        if (new_size == 0) {
  ------------------
  |  Branch (367:13): [True: 0, False: 56.9k]
  ------------------
  368|      0|            new_size = 1;
  369|      0|        }
  370|  56.9k|        IGRAPH_CHECK(igraph_vector_ptr_reserve(v, new_size));
  ------------------
  |  |  656|  56.9k|    do { \
  |  |  657|  56.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  56.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  56.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 56.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  56.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 56.9k]
  |  |  ------------------
  ------------------
  371|  56.9k|    }
  372|       |
  373|   166k|    *(v->end) = e;
  374|   166k|    v->end += 1;
  375|       |
  376|   166k|    return IGRAPH_SUCCESS;
  377|   166k|}
igraph_vector_ptr_insert:
  416|  57.8k|igraph_error_t igraph_vector_ptr_insert(igraph_vector_ptr_t* v, igraph_int_t pos, void* e) {
  417|  57.8k|    igraph_int_t size = igraph_vector_ptr_size(v);
  418|  57.8k|    IGRAPH_CHECK(igraph_vector_ptr_resize(v, size + 1));
  ------------------
  |  |  656|  57.8k|    do { \
  |  |  657|  57.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  57.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  57.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 57.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  57.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 57.8k]
  |  |  ------------------
  ------------------
  419|  57.8k|    if (pos < size) {
  ------------------
  |  Branch (419:9): [True: 57.8k, False: 0]
  ------------------
  420|  57.8k|        memmove(v->stor_begin + pos + 1, v->stor_begin + pos,
  421|  57.8k|                sizeof(void*) * (size_t) (size - pos));
  422|  57.8k|    }
  423|  57.8k|    v->stor_begin[pos] = e;
  424|  57.8k|    return IGRAPH_SUCCESS;
  425|  57.8k|}
igraph_vector_ptr_resize:
  496|  57.8k|igraph_error_t igraph_vector_ptr_resize(igraph_vector_ptr_t* v, igraph_int_t newsize) {
  497|  57.8k|    IGRAPH_CHECK(igraph_vector_ptr_reserve(v, newsize));
  ------------------
  |  |  656|  57.8k|    do { \
  |  |  657|  57.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  57.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  57.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 57.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  57.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 57.8k]
  |  |  ------------------
  ------------------
  498|  57.8k|    v->end = v->stor_begin + newsize;
  499|  57.8k|    return IGRAPH_SUCCESS;
  500|  57.8k|}
igraph_vector_ptr_remove:
  594|  52.4k|void igraph_vector_ptr_remove(igraph_vector_ptr_t *v, igraph_int_t pos) {
  595|  52.4k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  52.4k|    do { \
  |  |  925|  52.4k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  52.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 52.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  52.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 52.4k]
  |  |  ------------------
  ------------------
  596|  52.4k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  52.4k|    do { \
  |  |  925|  52.4k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  52.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 52.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  52.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 52.4k]
  |  |  ------------------
  ------------------
  597|  52.4k|    if (pos + 1 < igraph_vector_ptr_size(v)) { /* No need to move data when removing the last element. */
  ------------------
  |  Branch (597:9): [True: 39.2k, False: 13.1k]
  ------------------
  598|  39.2k|        memmove(v->stor_begin + pos, v->stor_begin + pos + 1,
  599|  39.2k|                sizeof(void*) * (size_t) (igraph_vector_ptr_size(v) - pos - 1));
  600|  39.2k|    }
  601|  52.4k|    v->end--;
  602|  52.4k|}
igraph_vector_ptr_sort:
  625|   154k|void igraph_vector_ptr_sort(igraph_vector_ptr_t *v, int (*compar)(const void*, const void*)) {
  626|   154k|    igraph_qsort(v->stor_begin, (size_t) igraph_vector_ptr_size(v), sizeof(void*),
  627|   154k|          compar);
  628|   154k|}

igraph_adjlist_init:
  155|  3.43k|                        igraph_bool_t multiple) {
  156|       |
  157|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  158|  3.43k|    igraph_vector_int_t degrees;
  159|  3.43k|    int iter = 0;
  160|       |
  161|  3.43k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  162|       |
  163|  3.43k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (163:9): [True: 3.43k, False: 0]
  |  Branch (163:30): [True: 3.43k, False: 0]
  |  Branch (163:52): [True: 0, False: 3.43k]
  ------------------
  164|      0|        IGRAPH_ERROR("Cannot create adjacency list view.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  165|      0|    }
  166|       |
  167|  3.43k|    if (loops != IGRAPH_NO_LOOPS && loops != IGRAPH_LOOPS_ONCE && loops != IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (167:9): [True: 0, False: 3.43k]
  |  Branch (167:37): [True: 0, False: 0]
  |  Branch (167:67): [True: 0, False: 0]
  ------------------
  168|      0|        IGRAPH_ERROR("Invalid loops argument.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  169|      0|    }
  170|       |
  171|  3.43k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (171:9): [True: 0, False: 3.43k]
  ------------------
  172|      0|        mode = IGRAPH_ALL;
  173|      0|    }
  174|       |
  175|  3.43k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  176|       |    /* igraph_degree() is fast when loops=true */
  177|  3.43k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  178|       |
  179|  3.43k|    al->length = no_of_nodes;
  180|  3.43k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t);
  ------------------
  |  |   33|  3.43k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.86k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.43k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  3.43k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating adjacency list view.");
  ------------------
  |  |  709|  3.43k|    do { \
  |  |  710|  3.43k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  182|  3.43k|    IGRAPH_FINALLY(igraph_adjlist_destroy, al);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  183|       |
  184|       |    /* if we already know there are no multi-edges, they don't need to be removed */
  185|  3.43k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (185:9): [True: 3.43k, False: 0]
  ------------------
  186|  3.43k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (186:9): [True: 3.43k, False: 0]
  ------------------
  187|       |
  188|       |        /* special case: if the graph is directed, but we are ignoring edge directions,
  189|       |         * mutual edges also act as multi-edges */
  190|  3.43k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (190:13): [True: 3.43k, False: 0]
  |  Branch (190:42): [True: 3.43k, False: 0]
  ------------------
  191|  3.43k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (191:17): [True: 0, False: 3.43k]
  ------------------
  192|      0|                !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MUTUAL)) {
  ------------------
  |  Branch (192:17): [True: 0, False: 0]
  ------------------
  193|      0|                multiple = IGRAPH_MULTIPLE;
  194|      0|            }
  195|  3.43k|        } else {
  196|      0|            multiple = IGRAPH_MULTIPLE;
  197|      0|        }
  198|  3.43k|    }
  199|       |
  200|       |    /* if we already know there are no loops, they don't need to be removed */
  201|  3.43k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (201:9): [True: 3.43k, False: 0]
  ------------------
  202|  3.43k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (202:9): [True: 3.43k, False: 0]
  ------------------
  203|  3.43k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (203:13): [True: 3.43k, False: 0]
  ------------------
  204|  3.43k|            loops = IGRAPH_LOOPS_TWICE;
  205|  3.43k|        } else {
  206|      0|            loops = IGRAPH_LOOPS_ONCE;
  207|      0|        }
  208|  3.43k|    }
  209|       |
  210|  3.43k|    igraph_bool_t has_loops = false;
  211|  3.43k|    igraph_bool_t has_multiple = false;
  212|       |
  213|       |    /* In theory, we could just run igraph_neighbors() in a loop with 'loops'
  214|       |     * and 'multiple' set exactly how the caller wants it. However, we take the
  215|       |     * opportunity to also _cache_ whether the graph has multiple or loop edges
  216|       |     * if we are looping over all vertices anyway, and that requires us to query
  217|       |     * the neighbors in full */
  218|       |
  219|   155k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (219:30): [True: 151k, False: 3.43k]
  ------------------
  220|   151k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|   151k|    do { \
  |  |   72|   151k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 151k]
  |  |  ------------------
  |  |   73|      0|            IGRAPH_ALLOW_INTERRUPTION(); \
  |  |  ------------------
  |  |  |  |   46|      0|    do { \
  |  |  |  |   47|      0|        if (igraph_i_interruption_handler) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (47:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |  |  |   50|      0|            } \
  |  |  |  |   51|      0|        } \
  |  |  |  |   52|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      0|            iter = 0; \
  |  |   75|      0|        } \
  |  |   76|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  221|       |
  222|   151k|        IGRAPH_CHECK(igraph_vector_int_init(&al->adjs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  656|   151k|    do { \
  |  |  657|   151k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   151k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  223|   151k|        IGRAPH_CHECK(igraph_neighbors(graph, &al->adjs[i], i, mode, IGRAPH_LOOPS, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|   151k|    do { \
  |  |  657|   151k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   151k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  224|       |
  225|       |        /* Attention: This function will only set values for has_loops and has_multiple
  226|       |         * if it finds loops/multi-edges. Otherwise, they are left at their original value. */
  227|   151k|        IGRAPH_CHECK(igraph_i_simplify_sorted_int_adjacency_vector_in_place(
  ------------------
  |  |  656|   151k|    do { \
  |  |  657|   151k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   151k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  228|   151k|            &al->adjs[i], i, mode, loops, multiple, &has_loops, &has_multiple
  229|   151k|        ));
  230|   151k|    }
  231|  3.43k|    if (has_loops) {
  ------------------
  |  Branch (231:9): [True: 0, False: 3.43k]
  ------------------
  232|       |        /* If we have found at least one loop above, set the cache to true. */
  233|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, true);
  234|  3.43k|    } else if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (234:16): [True: 0, False: 3.43k]
  ------------------
  235|       |        /* If we explicitly _checked_ for loops (to remove them) and haven't
  236|       |         * found one, set the cache to false. This is the only case when a
  237|       |         * definite "no" from has_loops really means that there are no loops at
  238|       |         * all. */
  239|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, false);
  240|      0|    }
  241|  3.43k|    if (has_multiple) {
  ------------------
  |  Branch (241:9): [True: 623, False: 2.81k]
  ------------------
  242|       |        /* If we have found at least one multiedge above, set the cache to true,
  243|       |         * except when treating a directed graph as undirected. In that case, mutual
  244|       |         * edges would also look like multi-edges in this check. */
  245|    623|        if (! igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (245:13): [True: 0, False: 623]
  |  Branch (245:44): [True: 0, False: 623]
  ------------------
  246|      0|            igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, true);
  247|      0|        }
  248|  2.81k|    } else if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (248:16): [True: 2.81k, False: 0]
  ------------------
  249|       |        /* If we explicitly _checked_ for multi-edges (to remove them) and
  250|       |         * haven't found one, set the cache to false. This is the only case
  251|       |         * when a definite "no" from has_multiple really means that there are
  252|       |         * no multi-edges at all. */
  253|  2.81k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, false);
  254|  2.81k|    }
  255|       |
  256|  3.43k|    igraph_vector_int_destroy(&degrees);
  257|  3.43k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_adjlist_destroy */
  258|       |
  259|  3.43k|    return IGRAPH_SUCCESS;
  260|  3.43k|}
igraph_adjlist_destroy:
  479|  3.43k|void igraph_adjlist_destroy(igraph_adjlist_t *al) {
  480|   155k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (480:30): [True: 151k, False: 3.43k]
  ------------------
  481|       |        /* This works if some igraph_vector_int_t's contain NULL,
  482|       |           because igraph_vector_int_destroy can handle this. */
  483|   151k|        igraph_vector_int_destroy(&al->adjs[i]);
  484|   151k|    }
  485|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  3.43k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  486|  3.43k|}
igraph_inclist_init:
  750|  45.0k|                        igraph_loops_t loops) {
  751|  45.0k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  752|  45.0k|    igraph_vector_int_t degrees;
  753|  45.0k|    int iter = 0;
  754|       |
  755|  45.0k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (755:9): [True: 41.5k, False: 3.54k]
  |  Branch (755:30): [True: 31.1k, False: 10.4k]
  |  Branch (755:52): [True: 0, False: 31.1k]
  ------------------
  756|      0|        IGRAPH_ERROR("Cannot create incidence list view.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  757|      0|    }
  758|       |
  759|  45.0k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (759:9): [True: 12.1k, False: 32.9k]
  ------------------
  760|  12.1k|        mode = IGRAPH_ALL;
  761|  12.1k|    }
  762|       |
  763|  45.0k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  45.0k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  45.0k|    do { \
  |  |  |  |  657|  45.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  45.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  45.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 45.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  45.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 45.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  45.0k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  45.0k|    do { \
  |  |  |  |  604|  45.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  45.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  45.0k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  45.0k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 45.0k]
  |  |  |  |  ------------------
  |  |  |  |  608|  45.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  45.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 45.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 45.0k]
  |  |  ------------------
  ------------------
  764|       |    /* igraph_degrees() is fast when loops=true */
  765|  45.0k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  45.0k|    do { \
  |  |  657|  45.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  45.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  45.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 45.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  45.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 45.0k]
  |  |  ------------------
  ------------------
  766|       |
  767|  45.0k|    il->length = no_of_nodes;
  768|  45.0k|    il->incs = IGRAPH_CALLOC(il->length, igraph_vector_int_t);
  ------------------
  |  |   33|  45.0k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  90.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 45.0k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 45.0k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 45.0k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  769|  45.0k|    if (il->incs == 0) {
  ------------------
  |  Branch (769:9): [True: 0, False: 45.0k]
  ------------------
  770|      0|        IGRAPH_ERROR("Cannot create incidence list view.", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  771|      0|    }
  772|       |
  773|  45.0k|    IGRAPH_FINALLY(igraph_inclist_destroy, il);
  ------------------
  |  |  603|  45.0k|    do { \
  |  |  604|  45.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  45.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  45.0k|         * incorrect destructor function with the pointer */ \
  |  |  607|  45.0k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 45.0k]
  |  |  ------------------
  |  |  608|  45.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  45.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 45.0k]
  |  |  ------------------
  ------------------
  774|  2.00M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (774:30): [True: 1.95M, False: 45.0k]
  ------------------
  775|  1.95M|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|  1.95M|    do { \
  |  |   72|  1.95M|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 1.95M]
  |  |  ------------------
  |  |   73|      0|            IGRAPH_ALLOW_INTERRUPTION(); \
  |  |  ------------------
  |  |  |  |   46|      0|    do { \
  |  |  |  |   47|      0|        if (igraph_i_interruption_handler) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (47:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |  |  |   50|      0|            } \
  |  |  |  |   51|      0|        } \
  |  |  |  |   52|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      0|            iter = 0; \
  |  |   75|      0|        } \
  |  |   76|  1.95M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
  776|       |
  777|  1.95M|        IGRAPH_CHECK(igraph_vector_int_init(&il->incs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  656|  1.95M|    do { \
  |  |  657|  1.95M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.95M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.95M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.95M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
  778|  1.95M|        IGRAPH_CHECK(igraph_incident(graph, &il->incs[i], i, mode, loops));
  ------------------
  |  |  656|  1.95M|    do { \
  |  |  657|  1.95M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.95M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.95M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  1.95M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
  779|  1.95M|    }
  780|       |
  781|  45.0k|    igraph_vector_int_destroy(&degrees);
  782|  45.0k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_inclist_destroy */
  783|       |
  784|  45.0k|    return IGRAPH_SUCCESS;
  785|  45.0k|}
igraph_inclist_destroy:
  829|  45.0k|void igraph_inclist_destroy(igraph_inclist_t *il) {
  830|  2.00M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (830:30): [True: 1.95M, False: 45.0k]
  ------------------
  831|       |        /* This works if some igraph_vector_int_t's contain NULL,
  832|       |           because igraph_vector_int_destroy can handle this. */
  833|  1.95M|        igraph_vector_int_destroy(&il->incs[i]);
  834|  1.95M|    }
  835|       |    IGRAPH_FREE(il->incs);
  ------------------
  |  |   36|  45.0k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  836|  45.0k|}
igraph_lazy_adjlist_init:
 1080|  3.43k|                             igraph_bool_t multiple) {
 1081|  3.43k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1081:9): [True: 3.43k, False: 0]
  |  Branch (1081:30): [True: 3.43k, False: 0]
  |  Branch (1081:52): [True: 0, False: 3.43k]
  ------------------
 1082|      0|        IGRAPH_ERROR("Cannot create lazy adjacency list view.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1083|      0|    }
 1084|       |
 1085|  3.43k|    if (loops != IGRAPH_NO_LOOPS && loops != IGRAPH_LOOPS_ONCE && loops != IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1085:9): [True: 3.43k, False: 0]
  |  Branch (1085:37): [True: 3.43k, False: 0]
  |  Branch (1085:67): [True: 0, False: 3.43k]
  ------------------
 1086|      0|        IGRAPH_ERROR("Invalid loops argument.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1087|      0|    }
 1088|       |
 1089|  3.43k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1089:9): [True: 0, False: 3.43k]
  ------------------
 1090|      0|        mode = IGRAPH_ALL;
 1091|      0|    }
 1092|       |
 1093|       |    /* if we already know there are no multi-edges, they don't need to be removed */
 1094|  3.43k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (1094:9): [True: 3.43k, False: 0]
  ------------------
 1095|  3.43k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (1095:9): [True: 3.43k, False: 0]
  ------------------
 1096|       |
 1097|       |        /* special case: if the graph is directed, but we are ignoring edge directions,
 1098|       |         * mutual edges also act as multi-edges */
 1099|  3.43k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1099:13): [True: 3.43k, False: 0]
  |  Branch (1099:42): [True: 3.43k, False: 0]
  ------------------
 1100|  3.43k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (1100:17): [True: 0, False: 3.43k]
  ------------------
 1101|      0|                !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MUTUAL)) {
  ------------------
  |  Branch (1101:17): [True: 0, False: 0]
  ------------------
 1102|      0|                multiple = IGRAPH_MULTIPLE;
 1103|      0|            }
 1104|  3.43k|        } else {
 1105|      0|            multiple = IGRAPH_MULTIPLE;
 1106|      0|        }
 1107|  3.43k|    }
 1108|       |
 1109|       |    /* if we already know there are no loops, they don't need to be removed */
 1110|  3.43k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1110:9): [True: 3.43k, False: 0]
  ------------------
 1111|  3.43k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1111:9): [True: 3.43k, False: 0]
  ------------------
 1112|  3.43k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1112:13): [True: 3.43k, False: 0]
  ------------------
 1113|  3.43k|            loops = IGRAPH_LOOPS_TWICE;
 1114|  3.43k|        } else {
 1115|      0|            loops = IGRAPH_LOOPS_ONCE;
 1116|      0|        }
 1117|  3.43k|    }
 1118|       |
 1119|  3.43k|    al->mode = mode;
 1120|  3.43k|    al->loops = loops;
 1121|  3.43k|    al->multiple = multiple;
 1122|  3.43k|    al->graph = graph;
 1123|       |
 1124|  3.43k|    al->length = igraph_vcount(graph);
 1125|  3.43k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t*);
  ------------------
  |  |   33|  3.43k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.86k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.43k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1126|  3.43k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating lazy adjacency list view.");
  ------------------
  |  |  709|  3.43k|    do { \
  |  |  710|  3.43k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
 1127|       |
 1128|  3.43k|    return IGRAPH_SUCCESS;
 1129|  3.43k|}
igraph_lazy_adjlist_destroy:
 1141|  3.43k|void igraph_lazy_adjlist_destroy(igraph_lazy_adjlist_t *al) {
 1142|  3.43k|    igraph_lazy_adjlist_clear(al);
 1143|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  3.43k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1144|  3.43k|}
igraph_lazy_adjlist_clear:
 1154|  3.43k|void igraph_lazy_adjlist_clear(igraph_lazy_adjlist_t *al) {
 1155|  3.43k|    igraph_int_t i, n = al->length;
 1156|   155k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1156:17): [True: 151k, False: 3.43k]
  ------------------
 1157|   151k|        if (al->adjs[i] != 0) {
  ------------------
  |  Branch (1157:13): [True: 151k, False: 0]
  ------------------
 1158|   151k|            igraph_vector_int_destroy(al->adjs[i]);
 1159|       |            IGRAPH_FREE(al->adjs[i]);
  ------------------
  |  |   36|   151k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1160|   151k|        }
 1161|   151k|    }
 1162|  3.43k|}
igraph_i_lazy_adjlist_get_real:
 1177|   151k|igraph_vector_int_t *igraph_i_lazy_adjlist_get_real(igraph_lazy_adjlist_t *al, igraph_int_t no) {
 1178|   151k|    igraph_error_t ret;
 1179|       |
 1180|   151k|    if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1180:9): [True: 151k, False: 0]
  ------------------
 1181|   151k|        al->adjs[no] = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|   151k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   303k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 151k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|   151k|        if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1182:13): [True: 0, False: 151k]
  ------------------
 1183|      0|            return NULL;
 1184|      0|        }
 1185|       |
 1186|   151k|        ret = igraph_vector_int_init(al->adjs[no], 0);
 1187|   151k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1187:13): [True: 0, False: 151k]
  ------------------
 1188|      0|            IGRAPH_FREE(al->adjs[no]);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1189|      0|            return NULL;
 1190|      0|        }
 1191|       |
 1192|   151k|        ret = igraph_neighbors(al->graph, al->adjs[no], no, al->mode, al->loops, al->multiple);
 1193|   151k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1193:13): [True: 0, False: 151k]
  ------------------
 1194|      0|            igraph_vector_int_destroy(al->adjs[no]);
 1195|      0|            IGRAPH_FREE(al->adjs[no]);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1196|      0|            return NULL;
 1197|      0|        }
 1198|   151k|    }
 1199|       |
 1200|   151k|    return al->adjs[no];
 1201|   151k|}
adjlist.c:igraph_i_simplify_sorted_int_adjacency_vector_in_place:
  875|   151k|) {
  876|   151k|    igraph_bool_t dummy1 = true, dummy2 = true; /* set dummies to avoid uninitialized read */
  877|   151k|    if (has_loops == NULL) {
  ------------------
  |  Branch (877:9): [True: 0, False: 151k]
  ------------------
  878|      0|        has_loops = &dummy1;
  879|      0|    }
  880|   151k|    if (has_multiple == NULL) {
  ------------------
  |  Branch (880:9): [True: 0, False: 151k]
  ------------------
  881|      0|        has_multiple = &dummy2;
  882|      0|    }
  883|       |
  884|   151k|    igraph_int_t i, p = 0;
  885|   151k|    igraph_int_t n = igraph_vector_int_size(v);
  886|       |
  887|   151k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  888|       |
  889|   151k|    if (
  890|   151k|        multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (890:9): [True: 0, False: 151k]
  ------------------
  891|      0|        (
  892|      0|            loops == IGRAPH_LOOPS_TWICE ||
  ------------------
  |  Branch (892:13): [True: 0, False: 0]
  ------------------
  893|      0|            (loops == IGRAPH_LOOPS_ONCE && (mode == IGRAPH_IN || mode == IGRAPH_OUT))
  ------------------
  |  Branch (893:14): [True: 0, False: 0]
  |  Branch (893:45): [True: 0, False: 0]
  |  Branch (893:66): [True: 0, False: 0]
  ------------------
  894|      0|        )
  895|   151k|    ) {
  896|       |        /* nothing to simplify */
  897|      0|        return IGRAPH_SUCCESS;
  898|      0|    }
  899|       |
  900|   151k|    if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (900:9): [True: 0, False: 151k]
  ------------------
  901|      0|        if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (901:13): [True: 0, False: 0]
  ------------------
  902|       |            /* We need to get rid of loops and multiple edges completely */
  903|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (903:25): [True: 0, False: 0]
  ------------------
  904|      0|                if (VECTOR(*v)[i] != index &&
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (904:21): [True: 0, False: 0]
  ------------------
  905|      0|                    (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i])) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i])) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (905:22): [True: 0, False: 0]
  |  Branch (905:36): [True: 0, False: 0]
  ------------------
  906|      0|                    VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  907|      0|                    p++;
  908|      0|                } else {
  909|      0|                    if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (909:25): [True: 0, False: 0]
  ------------------
  910|      0|                        *has_loops = true;
  911|       |                        /* If we haven't found multi-edges yet, we also need to check
  912|       |                         * if this is a multi-loop, to set 'has_multiple' correctly. */
  913|      0|                        if (! *has_multiple) {
  ------------------
  |  Branch (913:29): [True: 0, False: 0]
  ------------------
  914|      0|                            if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (914:33): [True: 0, False: 0]
  ------------------
  915|       |                                /* Undirected loops appear twice in the neighbour list,
  916|       |                                 * so we check two following items instead of one. */
  917|      0|                                if (i < n - 2 &&
  ------------------
  |  Branch (917:37): [True: 0, False: 0]
  ------------------
  918|      0|                                    VECTOR(*v)[i + 1] == VECTOR(*v)[i] &&
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                                  VECTOR(*v)[i + 1] == VECTOR(*v)[i] &&
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (918:37): [True: 0, False: 0]
  ------------------
  919|      0|                                    VECTOR(*v)[i + 2] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                                  VECTOR(*v)[i + 2] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (919:37): [True: 0, False: 0]
  ------------------
  920|      0|                                    *has_multiple = true;
  921|      0|                                }
  922|      0|                            } else {
  923|      0|                                if (i != n - 1 && VECTOR(*v)[i + 1] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                              if (i != n - 1 && VECTOR(*v)[i + 1] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (923:37): [True: 0, False: 0]
  |  Branch (923:51): [True: 0, False: 0]
  ------------------
  924|      0|                                    *has_multiple = true;
  925|      0|                                }
  926|      0|                            }
  927|      0|                        }
  928|      0|                    } else if (i != n - 1 && VECTOR(*v)[i + 1] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  } else if (i != n - 1 && VECTOR(*v)[i + 1] == VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (928:32): [True: 0, False: 0]
  |  Branch (928:46): [True: 0, False: 0]
  ------------------
  929|      0|                        *has_multiple = true;
  930|      0|                    }
  931|      0|                }
  932|      0|            }
  933|      0|        } else {
  934|       |            /* We need to get rid of loops but keep multiple edges */
  935|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (935:25): [True: 0, False: 0]
  ------------------
  936|      0|                if (VECTOR(*v)[i] != index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (936:21): [True: 0, False: 0]
  ------------------
  937|      0|                    VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  938|      0|                    p++;
  939|      0|                } else {
  940|      0|                    *has_loops = true;
  941|      0|                }
  942|      0|            }
  943|      0|        }
  944|   151k|    } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (944:16): [True: 0, False: 151k]
  ------------------
  945|      0|        if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (945:13): [True: 0, False: 0]
  ------------------
  946|       |            /* We need to get rid of multiple edges completely (including
  947|       |             * multiple loop edges), but keep one edge from each loop edge */
  948|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (948:25): [True: 0, False: 0]
  ------------------
  949|      0|                if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (949:21): [True: 0, False: 0]
  |  Branch (949:35): [True: 0, False: 0]
  ------------------
  950|      0|                    VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  951|      0|                    p++;
  952|      0|                } else if (
  953|       |                        /* If this is not a loop then we have a multigraph.
  954|       |                           Else we have at least two loops.
  955|       |                           The v vector comes from a call to igraph_neighbors.
  956|       |                           This will count loops twice if mode == IGRAPH_ALL.
  957|       |                           So if mode != IGRAPH_ALL,
  958|       |                           then we have a multigraph.
  959|       |                           If mode == IGRAPH_ALL and we have three loops
  960|       |                           then we also have a multigraph
  961|       |                           */
  962|      0|                        (VECTOR(*v)[i] != index) ||
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (962:25): [True: 0, False: 0]
  ------------------
  963|      0|                       (mode != IGRAPH_ALL)  ||
  ------------------
  |  Branch (963:24): [True: 0, False: 0]
  ------------------
  964|      0|                       (mode == IGRAPH_ALL && i < n - 2 && VECTOR(*v)[i + 2] == VECTOR(*v)[i])
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                     (mode == IGRAPH_ALL && i < n - 2 && VECTOR(*v)[i + 2] == VECTOR(*v)[i])
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (964:25): [True: 0, False: 0]
  |  Branch (964:47): [True: 0, False: 0]
  |  Branch (964:60): [True: 0, False: 0]
  ------------------
  965|      0|                       ){
  966|      0|                    *has_multiple = true;
  967|      0|                }
  968|      0|            }
  969|      0|        } else {
  970|       |            /* We need to keep one edge from each loop edge and we don't need to
  971|       |             * touch multiple edges. Note that we can get here only if
  972|       |             * mode == IGRAPH_ALL; if mode was IGRAPH_IN or IGRAPH_OUT, we would
  973|       |             * have bailed out earlier */
  974|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|                VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  976|      0|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (976:21): [True: 0, False: 0]
  ------------------
  977|      0|                    *has_loops = true;
  978|       |                    /* this was a loop edge so if the next element is the same, we
  979|       |                    * need to skip that */
  980|      0|                    if (i < n-1 && VECTOR(*v)[i + 1] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (980:25): [True: 0, False: 0]
  |  Branch (980:36): [True: 0, False: 0]
  ------------------
  981|      0|                        i++;
  982|      0|                    }
  983|      0|                }
  984|      0|                p++;
  985|      0|            }
  986|      0|        }
  987|   151k|    } else if (loops == IGRAPH_LOOPS_TWICE && multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (987:16): [True: 151k, False: 0]
  |  Branch (987:47): [True: 151k, False: 0]
  ------------------
  988|       |        /* We need to get rid of multiple edges completely (including
  989|       |         * multiple loop edges), but keep both edge from each loop edge */
  990|   266k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (990:21): [True: 114k, False: 151k]
  ------------------
  991|   114k|            if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  65.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  65.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (991:17): [True: 48.9k, False: 65.8k]
  |  Branch (991:31): [True: 62.7k, False: 3.09k]
  ------------------
  992|   111k|                VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   111k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   111k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  993|   111k|                p++;
  994|   111k|            } else {
  995|       |                /* In ALL mode, two equal loop entries are the two incidences
  996|       |                 * of one edge. Only a third entry establishes parallel loops. */
  997|  3.09k|                if (VECTOR(*v)[i] != index || mode != IGRAPH_ALL ||
  ------------------
  |  |   60|  3.09k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (997:21): [True: 3.09k, False: 0]
  |  Branch (997:47): [True: 0, False: 0]
  ------------------
  998|  3.09k|                    (i < n - 2 && VECTOR(*v)[i + 2] == index)) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (998:22): [True: 0, False: 0]
  |  Branch (998:35): [True: 0, False: 0]
  ------------------
  999|  3.09k|                    *has_multiple = true;
 1000|  3.09k|                }
 1001|       |                /* Current item is the same as the next one, but if it is a
 1002|       |                 * loop edge, then the first one or two items are okay. We need
 1003|       |                 * to keep one if mode == IGRAPH_IN or mode == IGRAPH_OUT,
 1004|       |                 * otherwise we need to keep two */
 1005|  3.09k|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|  3.09k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1005:21): [True: 0, False: 3.09k]
  ------------------
 1006|      0|                    VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1007|      0|                    p++;
 1008|      0|                    if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1008:25): [True: 0, False: 0]
  ------------------
 1009|      0|                        VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1010|      0|                        p++;
 1011|      0|                    }
 1012|       |                    /* skip over all the items corresponding to the loop edges */
 1013|      0|                    while (i < n && VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1013:28): [True: 0, False: 0]
  |  Branch (1013:37): [True: 0, False: 0]
  ------------------
 1014|      0|                        i++;
 1015|      0|                    }
 1016|      0|                    i--; /* because the for loop also increases i by 1 */
 1017|      0|                }
 1018|  3.09k|            }
 1019|   114k|        }
 1020|   151k|    } else {
 1021|       |        /* LOOPS_TWICE with MULTIPLE returned early above; invalid 'loops'
 1022|       |         * values are rejected by the caller. */
 1023|      0|        IGRAPH_FATAL("Must not reach here.");
  ------------------
  |  |  895|      0|    do { \
  |  |  896|      0|        igraph_fatal(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  897|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (897:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1024|      0|    }
 1025|       |
 1026|       |    /* always succeeds since we are never growing the vector */
 1027|   151k|    igraph_vector_int_resize(v, p);
 1028|       |
 1029|   151k|    return IGRAPH_SUCCESS;
 1030|   151k|}

igraph_attribute_record_init:
  126|   649k|) {
  127|   649k|    attr->name = NULL;
  128|   649k|    attr->type = IGRAPH_ATTRIBUTE_UNSPECIFIED;
  129|   649k|    attr->value.as_raw = NULL;
  130|   649k|    attr->default_value.string = NULL;
  131|       |
  132|   649k|    IGRAPH_CHECK(igraph_attribute_record_set_name(attr, name));
  ------------------
  |  |  656|   649k|    do { \
  |  |  657|   649k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   649k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  133|   649k|    IGRAPH_FINALLY(igraph_free, attr->name);
  ------------------
  |  |  603|   649k|    do { \
  |  |  604|   649k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   649k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   649k|         * incorrect destructor function with the pointer */ \
  |  |  607|   649k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 649k]
  |  |  ------------------
  |  |  608|   649k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  134|   649k|    IGRAPH_CHECK(igraph_attribute_record_set_type(attr, type));
  ------------------
  |  |  656|   649k|    do { \
  |  |  657|   649k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   649k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  135|   649k|    IGRAPH_FINALLY_CLEAN(1);
  136|       |
  137|   649k|    return IGRAPH_SUCCESS;
  138|   649k|}
igraph_attribute_record_init_copy:
  159|  25.5k|) {
  160|  25.5k|    IGRAPH_CHECK(igraph_attribute_record_init(to, from->name, from->type));
  ------------------
  |  |  656|  25.5k|    do { \
  |  |  657|  25.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  161|       |
  162|  25.5k|    switch (from->type) {
  163|  25.5k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (163:9): [True: 25.5k, False: 0]
  ------------------
  164|  25.5k|            IGRAPH_CHECK(igraph_vector_update(to->value.as_vector, from->value.as_vector));
  ------------------
  |  |  656|  25.5k|    do { \
  |  |  657|  25.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  165|  25.5k|            break;
  166|       |
  167|  25.5k|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (167:9): [True: 0, False: 25.5k]
  ------------------
  168|      0|            IGRAPH_CHECK(igraph_strvector_update(to->value.as_strvector, from->value.as_strvector));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  169|      0|            break;
  170|       |
  171|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (171:9): [True: 0, False: 25.5k]
  ------------------
  172|      0|            IGRAPH_CHECK(igraph_vector_bool_update(to->value.as_vector_bool, from->value.as_vector_bool));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  173|      0|            break;
  174|       |
  175|      0|        case IGRAPH_ATTRIBUTE_UNSPECIFIED:
  ------------------
  |  Branch (175:9): [True: 0, False: 25.5k]
  ------------------
  176|      0|            break;
  177|       |
  178|      0|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 25.5k]
  ------------------
  179|      0|            break;
  180|  25.5k|    }
  181|       |
  182|  25.5k|    return IGRAPH_SUCCESS;
  183|  25.5k|}
igraph_attribute_record_destroy:
  241|   649k|void igraph_attribute_record_destroy(igraph_attribute_record_t *attr) {
  242|   649k|    igraph_i_attribute_record_destroy_values(attr);
  243|       |
  244|   649k|    if (attr->name) {
  ------------------
  |  Branch (244:9): [True: 649k, False: 0]
  ------------------
  245|   649k|        igraph_free(attr->name);
  246|       |        attr->name = NULL;
  247|   649k|    }
  248|   649k|}
igraph_attribute_record_check_type:
  264|  7.08k|) {
  265|  7.08k|    if (type != attr->type) {
  ------------------
  |  Branch (265:9): [True: 0, False: 7.08k]
  ------------------
  266|      0|        switch (type) {
  267|      0|            case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|                IGRAPH_ERROR("String attribute expected.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  269|      0|                break;
  270|      0|            case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|                IGRAPH_ERROR("Numeric attribute expected.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  272|      0|                break;
  273|      0|            case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|                IGRAPH_ERROR("Boolean attribute expected.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  275|      0|                break;
  276|      0|            case IGRAPH_ATTRIBUTE_OBJECT:
  ------------------
  |  Branch (276:13): [True: 0, False: 0]
  ------------------
  277|      0|                IGRAPH_ERROR("Object attribute expected.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  278|      0|                break;
  279|      0|            default:
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|                IGRAPH_ERROR("Attribute with unknown type expected.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  281|      0|                break;
  282|      0|        }
  283|      0|    }
  284|       |
  285|  7.08k|    return IGRAPH_SUCCESS;
  286|  7.08k|}
igraph_attribute_record_size:
  295|   317k|igraph_int_t igraph_attribute_record_size(const igraph_attribute_record_t *attr) {
  296|   317k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|   317k|    do { \
  |  |  925|   317k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   317k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 317k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   317k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 317k]
  |  |  ------------------
  ------------------
  297|       |
  298|   317k|    switch (attr->type) {
  299|   317k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (299:9): [True: 317k, False: 0]
  ------------------
  300|   317k|            return igraph_vector_size(attr->value.as_vector);
  301|       |
  302|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (302:9): [True: 0, False: 317k]
  ------------------
  303|      0|            return igraph_strvector_size(attr->value.as_strvector);
  304|       |
  305|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (305:9): [True: 0, False: 317k]
  ------------------
  306|      0|            return igraph_vector_bool_size(attr->value.as_vector_bool);
  307|       |
  308|      0|        case IGRAPH_ATTRIBUTE_UNSPECIFIED:
  ------------------
  |  Branch (308:9): [True: 0, False: 317k]
  ------------------
  309|      0|            return 0;
  310|       |
  311|      0|        default:
  ------------------
  |  Branch (311:9): [True: 0, False: 317k]
  ------------------
  312|      0|            IGRAPH_ERRORF("Unsupported attribute type: %d.", IGRAPH_EINVAL, (int) attr->type);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  313|   317k|    }
  314|   317k|}
igraph_attribute_record_resize:
  332|   327k|) {
  333|   327k|    igraph_int_t i;
  334|   327k|    igraph_vector_t *vec;
  335|   327k|    igraph_vector_bool_t *log;
  336|   327k|    igraph_strvector_t *str;
  337|       |
  338|   327k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|   327k|    do { \
  |  |  925|   327k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   327k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 327k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   327k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 327k]
  |  |  ------------------
  ------------------
  339|       |
  340|   327k|    switch (attr->type) {
  341|       |
  342|   327k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (342:9): [True: 327k, False: 0]
  ------------------
  343|   327k|            vec = attr->value.as_vector;
  344|   327k|            i = igraph_vector_size(vec);
  345|   327k|            IGRAPH_CHECK(igraph_vector_resize(vec, new_size));
  ------------------
  |  |  656|   327k|    do { \
  |  |  657|   327k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   327k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   327k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 327k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   327k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 327k]
  |  |  ------------------
  ------------------
  346|  1.19M|            while (i < new_size) {
  ------------------
  |  Branch (346:20): [True: 868k, False: 327k]
  ------------------
  347|   868k|                VECTOR(*vec)[i++] = attr->default_value.numeric;
  ------------------
  |  |   60|   868k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  348|   868k|            }
  349|   327k|            break;
  350|       |
  351|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (351:9): [True: 0, False: 327k]
  ------------------
  352|      0|            log = attr->value.as_vector_bool;
  353|      0|            i = igraph_vector_bool_size(log);
  354|      0|            IGRAPH_CHECK(igraph_vector_bool_resize(log, new_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  355|      0|            while (i < new_size) {
  ------------------
  |  Branch (355:20): [True: 0, False: 0]
  ------------------
  356|      0|                VECTOR(*log)[i++] = attr->default_value.boolean;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  357|      0|            }
  358|      0|            break;
  359|       |
  360|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (360:9): [True: 0, False: 327k]
  ------------------
  361|      0|            str = attr->value.as_strvector;
  362|      0|            if (attr->default_value.string == 0 || (*attr->default_value.string == 0)) {
  ------------------
  |  Branch (362:17): [True: 0, False: 0]
  |  Branch (362:52): [True: 0, False: 0]
  ------------------
  363|      0|                IGRAPH_CHECK(igraph_strvector_resize(str, new_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  364|      0|            } else {
  365|      0|                i = igraph_strvector_size(str);
  366|      0|                IGRAPH_CHECK(igraph_strvector_resize(str, new_size));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  367|      0|                while (i < new_size) {
  ------------------
  |  Branch (367:24): [True: 0, False: 0]
  ------------------
  368|      0|                    IGRAPH_CHECK(igraph_strvector_set(str, i++, attr->default_value.string));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  369|      0|                }
  370|      0|            }
  371|      0|            break;
  372|       |
  373|      0|        case IGRAPH_ATTRIBUTE_UNSPECIFIED:
  ------------------
  |  Branch (373:9): [True: 0, False: 327k]
  ------------------
  374|      0|            IGRAPH_ERROR("Attribute record has no type yet.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  375|      0|            break;
  376|       |
  377|      0|        default:
  ------------------
  |  Branch (377:9): [True: 0, False: 327k]
  ------------------
  378|      0|            IGRAPH_ERRORF("Unsupported attribute type: %d.", IGRAPH_EINVAL, (int) attr->type);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  379|   327k|    }
  380|       |
  381|   327k|    return IGRAPH_SUCCESS;
  382|   327k|}
igraph_attribute_record_set_default_numeric:
  399|   649k|) {
  400|   649k|    if (attr->type != IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (400:9): [True: 0, False: 649k]
  ------------------
  401|      0|        return IGRAPH_EINVAL;
  402|      0|    }
  403|       |
  404|   649k|    attr->default_value.numeric = value;
  405|   649k|    return IGRAPH_SUCCESS;
  406|   649k|}
igraph_attribute_record_set_name:
  483|  1.26M|) {
  484|  1.26M|    char *new_name;
  485|       |
  486|  1.26M|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  1.26M|    do { \
  |  |  925|  1.26M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.26M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
  487|       |
  488|  1.26M|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 649k, False: 612k]
  ------------------
  489|   649k|        new_name = strdup(name);
  490|   649k|        IGRAPH_CHECK_OOM(new_name, "Insufficient memory for allocating attribute name.");
  ------------------
  |  |  709|   649k|    do { \
  |  |  710|   649k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  491|   649k|    } else {
  492|   612k|        new_name = NULL;
  493|   612k|    }
  494|       |
  495|  1.26M|    if (attr->name) {
  ------------------
  |  Branch (495:9): [True: 0, False: 1.26M]
  ------------------
  496|      0|        igraph_free(attr->name);
  497|      0|    }
  498|       |
  499|  1.26M|    attr->name = new_name;
  500|       |
  501|  1.26M|    return IGRAPH_SUCCESS;
  502|  1.26M|}
igraph_attribute_record_set_type:
  539|  1.26M|) {
  540|  1.26M|    void *ptr;
  541|       |
  542|  1.26M|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  1.26M|    do { \
  |  |  925|  1.26M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.26M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
  543|       |
  544|  1.26M|    if (attr->type != type) {
  ------------------
  |  Branch (544:9): [True: 649k, False: 612k]
  ------------------
  545|   649k|        switch (type) {
  546|   649k|            case IGRAPH_ATTRIBUTE_NUMERIC: {
  ------------------
  |  Branch (546:13): [True: 649k, False: 0]
  ------------------
  547|   649k|                igraph_vector_t *vec = IGRAPH_CALLOC(1, igraph_vector_t);
  ------------------
  |  |   33|   649k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  1.29M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 649k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|   649k|                IGRAPH_CHECK_OOM(vec, "Insufficient memory for attribute record.");
  ------------------
  |  |  709|   649k|    do { \
  |  |  710|   649k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  549|   649k|                IGRAPH_FINALLY(igraph_free, vec);
  ------------------
  |  |  603|   649k|    do { \
  |  |  604|   649k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   649k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   649k|         * incorrect destructor function with the pointer */ \
  |  |  607|   649k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 649k]
  |  |  ------------------
  |  |  608|   649k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  550|   649k|                IGRAPH_VECTOR_INIT_FINALLY(vec, 0);
  ------------------
  |  |  104|   649k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   649k|    do { \
  |  |  |  |  657|   649k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   649k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   649k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|   649k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   649k|    do { \
  |  |  |  |  604|   649k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   649k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   649k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   649k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 649k]
  |  |  |  |  ------------------
  |  |  |  |  608|   649k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   649k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  551|   649k|                ptr = vec;
  552|   649k|            }
  553|      0|            break;
  554|       |
  555|      0|            case IGRAPH_ATTRIBUTE_STRING: {
  ------------------
  |  Branch (555:13): [True: 0, False: 649k]
  ------------------
  556|      0|                igraph_strvector_t *strvec = IGRAPH_CALLOC(1, igraph_strvector_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  557|      0|                IGRAPH_CHECK_OOM(strvec, "Insufficient memory for attribute record.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  558|      0|                IGRAPH_FINALLY(igraph_free, strvec);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  559|      0|                IGRAPH_STRVECTOR_INIT_FINALLY(strvec, 0);
  ------------------
  |  |   62|      0|    do { IGRAPH_CHECK(igraph_strvector_init(sv, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|        IGRAPH_FINALLY( igraph_strvector_destroy, sv); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:65): [Folded, False: 0]
  |  |  ------------------
  ------------------
  560|      0|                ptr = strvec;
  561|      0|            }
  562|      0|            break;
  563|       |
  564|      0|            case IGRAPH_ATTRIBUTE_BOOLEAN: {
  ------------------
  |  Branch (564:13): [True: 0, False: 649k]
  ------------------
  565|      0|                igraph_vector_bool_t *boolvec = IGRAPH_CALLOC(1, igraph_vector_bool_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|      0|                IGRAPH_CHECK_OOM(boolvec, "Insufficient memory for attribute record.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  567|      0|                IGRAPH_FINALLY(igraph_free, boolvec);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  568|      0|                IGRAPH_VECTOR_BOOL_INIT_FINALLY(boolvec, 0);
  ------------------
  |  |  109|      0|    do { IGRAPH_CHECK(igraph_vector_bool_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|        IGRAPH_FINALLY(igraph_vector_bool_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (110:65): [Folded, False: 0]
  |  |  ------------------
  ------------------
  569|      0|                ptr = boolvec;
  570|      0|            }
  571|      0|            break;
  572|       |
  573|      0|            default:
  ------------------
  |  Branch (573:13): [True: 0, False: 649k]
  ------------------
  574|      0|                IGRAPH_FATALF("Unsupported attribute type: %d.", (int) type);
  ------------------
  |  |  875|      0|    do { \
  |  |  876|      0|        igraph_fatalf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  877|      0|                      __VA_ARGS__); \
  |  |  878|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (878:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  575|   649k|        }
  576|       |
  577|   649k|        igraph_i_attribute_record_set_type(attr, type, ptr);
  578|   649k|        IGRAPH_FINALLY_CLEAN(2);
  579|   649k|    }
  580|       |
  581|  1.26M|    return IGRAPH_SUCCESS;
  582|  1.26M|}
igraph_i_attribute_init:
  617|   352k|) {
  618|   352k|    graph->attr = NULL;
  619|   352k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (619:9): [True: 352k, False: 0]
  ------------------
  620|   352k|        IGRAPH_CHECK(igraph_i_attribute_table->init(graph, attr));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  621|   352k|        if (graph->attr == NULL) {
  ------------------
  |  Branch (621:13): [True: 0, False: 352k]
  ------------------
  622|      0|            IGRAPH_ERROR("Attribute handler did not initialize attr pointer.", IGRAPH_FAILURE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  623|      0|        }
  624|   352k|    }
  625|   352k|    return IGRAPH_SUCCESS;
  626|   352k|}
igraph_i_attribute_destroy:
  628|   681k|void igraph_i_attribute_destroy(igraph_t *graph) {
  629|   681k|    if (graph->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (629:9): [True: 673k, False: 7.83k]
  |  Branch (629:24): [True: 673k, False: 0]
  ------------------
  630|   673k|        igraph_i_attribute_table->destroy(graph);
  631|   673k|    }
  632|       |    graph->attr = NULL;
  633|   681k|}
igraph_i_attribute_copy:
  636|   321k|                            igraph_bool_t va, igraph_bool_t ea) {
  637|   321k|    igraph_i_attribute_destroy(to);
  638|   321k|    if (from->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (638:9): [True: 321k, False: 0]
  |  Branch (638:23): [True: 321k, False: 0]
  ------------------
  639|   321k|        IGRAPH_CHECK(igraph_i_attribute_table->copy(to, from, ga, va, ea));
  ------------------
  |  |  656|   321k|    do { \
  |  |  657|   321k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   321k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   321k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 321k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   321k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 321k]
  |  |  ------------------
  ------------------
  640|   321k|        if (to->attr == NULL) {
  ------------------
  |  Branch (640:13): [True: 0, False: 321k]
  ------------------
  641|      0|            IGRAPH_ERROR("Attribute handler did not initialize attr pointer.", IGRAPH_FAILURE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  642|      0|        }
  643|   321k|    }
  644|   321k|    return IGRAPH_SUCCESS;
  645|   321k|}
igraph_i_attribute_add_vertices:
  649|   355k|) {
  650|   355k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (650:9): [True: 355k, False: 0]
  ------------------
  651|   355k|        return igraph_i_attribute_table->add_vertices(graph, nv, attr);
  652|   355k|    } else {
  653|      0|        return IGRAPH_SUCCESS;
  654|      0|    }
  655|   355k|}
igraph_i_attribute_permute_vertices:
  659|   302k|                                        const igraph_vector_int_t *idx) {
  660|       |    /* graph and newgraph may be the same, in which case we need to support
  661|       |     * in-place operations. If they are _not_ the same, it is assumed that the
  662|       |     * new graph has no vertex attributes yet */
  663|   302k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (663:9): [True: 302k, False: 0]
  ------------------
  664|   302k|        return igraph_i_attribute_table->permute_vertices(graph, newgraph, idx);
  665|   302k|    } else {
  666|      0|        return IGRAPH_SUCCESS;
  667|      0|    }
  668|   302k|}
igraph_i_attribute_combine_vertices:
  673|  3.54k|                                        const igraph_attribute_combination_t *comb) {
  674|       |    /* It is assumed that the two graphs are not the same and that the new
  675|       |     * graph has no vertex attributes yet. We cannot assert the latter but we
  676|       |     * can assert the former */
  677|  3.54k|    IGRAPH_ASSERT(graph != newgraph);
  ------------------
  |  |  924|  3.54k|    do { \
  |  |  925|  3.54k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  678|  3.54k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (678:9): [True: 3.54k, False: 0]
  ------------------
  679|  3.54k|        return igraph_i_attribute_table->combine_vertices(graph, newgraph,
  680|  3.54k|                merges,
  681|  3.54k|                comb);
  682|  3.54k|    } else {
  683|      0|        return IGRAPH_SUCCESS;
  684|      0|    }
  685|  3.54k|}
igraph_i_attribute_add_edges:
  690|  41.7k|) {
  691|  41.7k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (691:9): [True: 41.7k, False: 0]
  ------------------
  692|  41.7k|        return igraph_i_attribute_table->add_edges(graph, edges, attr);
  693|  41.7k|    } else {
  694|      0|        return IGRAPH_SUCCESS;
  695|      0|    }
  696|  41.7k|}
igraph_i_attribute_permute_edges:
  700|   302k|                                     const igraph_vector_int_t *idx) {
  701|       |    /* graph and newgraph may be the same, in which case we need to support
  702|       |     * in-place operations. If they are _not_ the same, it is assumed that the
  703|       |     * new graph has no edge attributes yet */
  704|   302k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (704:9): [True: 302k, False: 0]
  ------------------
  705|   302k|        return igraph_i_attribute_table->permute_edges(graph, newgraph, idx);
  706|   302k|    } else {
  707|      0|        return IGRAPH_SUCCESS;
  708|      0|    }
  709|   302k|}
igraph_i_attribute_combine_edges:
  714|  7.08k|                                     const igraph_attribute_combination_t *comb) {
  715|       |    /* It is assumed that the two graphs are not the same and that the new
  716|       |     * graph has no eedge attributes yet. We cannot assert the latter but we
  717|       |     * can assert the former */
  718|  7.08k|    IGRAPH_ASSERT(graph != newgraph);
  ------------------
  |  |  924|  7.08k|    do { \
  |  |  925|  7.08k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  719|  7.08k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (719:9): [True: 7.08k, False: 0]
  ------------------
  720|  7.08k|        return igraph_i_attribute_table->combine_edges(graph, newgraph,
  721|  7.08k|                merges,
  722|  7.08k|                comb);
  723|  7.08k|    } else {
  724|      0|        return IGRAPH_SUCCESS;
  725|      0|    }
  726|  7.08k|}
igraph_set_attribute_table:
  895|  3.56k|igraph_set_attribute_table(const igraph_attribute_table_t * table) {
  896|  3.56k|    igraph_attribute_table_t *old = igraph_i_attribute_table;
  897|  3.56k|    igraph_i_attribute_table = (igraph_attribute_table_t*) table;
  898|  3.56k|    return old;
  899|  3.56k|}
igraph_has_attribute_table:
  901|  10.6k|igraph_bool_t igraph_has_attribute_table(void) {
  902|       |    return igraph_i_attribute_table != NULL;
  903|  10.6k|}
igraph_attribute_combination_init:
  915|  3.54k|igraph_error_t igraph_attribute_combination_init(igraph_attribute_combination_t *comb) {
  916|  3.54k|    IGRAPH_CHECK(igraph_vector_ptr_init(&comb->list, 0));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  917|  3.54k|    return IGRAPH_SUCCESS;
  918|  3.54k|}
igraph_attribute_combination_destroy:
  929|  3.54k|void igraph_attribute_combination_destroy(igraph_attribute_combination_t *comb) {
  930|  3.54k|    igraph_int_t i, n = igraph_vector_ptr_size(&comb->list);
  931|  10.6k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (931:17): [True: 7.08k, False: 3.54k]
  ------------------
  932|  7.08k|        igraph_attribute_combination_record_t *rec = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  7.08k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  933|  7.08k|        if (rec->name) {
  ------------------
  |  Branch (933:13): [True: 7.08k, False: 0]
  ------------------
  934|  7.08k|            IGRAPH_FREE(rec->name);
  ------------------
  |  |   36|  7.08k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  935|  7.08k|        }
  936|       |        IGRAPH_FREE(rec);
  ------------------
  |  |   36|  7.08k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  937|  7.08k|    }
  938|  3.54k|    igraph_vector_ptr_destroy(&comb->list);
  939|  3.54k|}
igraph_attribute_combination_add:
  968|  7.08k|                                     igraph_function_pointer_t func) {
  969|  7.08k|    igraph_int_t i, n = igraph_vector_ptr_size(&comb->list);
  970|       |
  971|       |    /* Search, in case it is already there */
  972|  10.6k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (972:17): [True: 3.54k, False: 7.08k]
  ------------------
  973|  3.54k|        igraph_attribute_combination_record_t *r = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  3.54k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  974|  3.54k|        const char *n = r->name;
  975|  3.54k|        if ( (!name && !n) ||
  ------------------
  |  Branch (975:15): [True: 0, False: 3.54k]
  |  Branch (975:24): [True: 0, False: 0]
  ------------------
  976|  3.54k|             (name && n && !strcmp(n, name)) ) {
  ------------------
  |  Branch (976:15): [True: 3.54k, False: 0]
  |  Branch (976:23): [True: 3.54k, False: 0]
  |  Branch (976:28): [True: 0, False: 3.54k]
  ------------------
  977|      0|            r->type = type;
  978|      0|            r->func = func;
  979|      0|            break;
  980|      0|        }
  981|  3.54k|    }
  982|       |
  983|  7.08k|    if (i == n) {
  ------------------
  |  Branch (983:9): [True: 7.08k, False: 0]
  ------------------
  984|       |        /* This is a new attribute name */
  985|  7.08k|        igraph_attribute_combination_record_t *rec =
  986|  7.08k|            IGRAPH_CALLOC(1, igraph_attribute_combination_record_t);
  ------------------
  |  |   33|  7.08k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  14.1k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 7.08k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  987|  7.08k|        if (! rec) {
  ------------------
  |  Branch (987:13): [True: 0, False: 7.08k]
  ------------------
  988|      0|            IGRAPH_ERROR("Cannot create attribute combination data.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  989|      0|                         IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  990|      0|        }
  991|  7.08k|        IGRAPH_FINALLY(igraph_free, rec);
  ------------------
  |  |  603|  7.08k|    do { \
  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  ------------------
  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  992|  7.08k|        if (! name) {
  ------------------
  |  Branch (992:13): [True: 0, False: 7.08k]
  ------------------
  993|      0|            rec->name = NULL;
  994|  7.08k|        } else {
  995|  7.08k|            rec->name = strdup(name);
  996|  7.08k|            if (! rec->name) {
  ------------------
  |  Branch (996:17): [True: 0, False: 7.08k]
  ------------------
  997|      0|                IGRAPH_ERROR("Cannot create attribute combination data.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  998|      0|                             IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
  999|      0|            }
 1000|  7.08k|        }
 1001|  7.08k|        IGRAPH_FINALLY(igraph_free, (char *) rec->name); /* free() is safe on NULL */
  ------------------
  |  |  603|  7.08k|    do { \
  |  |  604|  7.08k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.08k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.08k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.08k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.08k]
  |  |  ------------------
  |  |  608|  7.08k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1002|  7.08k|        rec->type = type;
 1003|  7.08k|        rec->func = func;
 1004|       |
 1005|  7.08k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&comb->list, rec));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1006|  7.08k|        IGRAPH_FINALLY_CLEAN(2); /* ownership of 'rec' transferred to 'comb->list' */
 1007|       |
 1008|  7.08k|    }
 1009|       |
 1010|  7.08k|    return IGRAPH_SUCCESS;
 1011|  7.08k|}
igraph_attribute_combination_query:
 1058|  10.6k|                                       igraph_function_pointer_t *func) {
 1059|  10.6k|    igraph_int_t i, def = -1, len = igraph_vector_ptr_size(&comb->list);
 1060|       |
 1061|  14.1k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (1061:17): [True: 14.1k, False: 0]
  ------------------
 1062|  14.1k|        igraph_attribute_combination_record_t *rec = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  14.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1063|  14.1k|        const char *n = rec->name;
 1064|  14.1k|        if ( (!name && !n) ||
  ------------------
  |  Branch (1064:15): [True: 0, False: 14.1k]
  |  Branch (1064:24): [True: 0, False: 0]
  ------------------
 1065|  14.1k|             (name && n && !strcmp(n, name)) ) {
  ------------------
  |  Branch (1065:15): [True: 14.1k, False: 0]
  |  Branch (1065:23): [True: 14.1k, False: 0]
  |  Branch (1065:28): [True: 10.6k, False: 3.54k]
  ------------------
 1066|  10.6k|            *type = rec->type;
 1067|  10.6k|            *func = rec->func;
 1068|  10.6k|            return IGRAPH_SUCCESS;
 1069|  10.6k|        }
 1070|  3.54k|        if (!n) {
  ------------------
  |  Branch (1070:13): [True: 0, False: 3.54k]
  ------------------
 1071|      0|            def = i;
 1072|      0|        }
 1073|  3.54k|    }
 1074|       |
 1075|      0|    if (def == -1) {
  ------------------
  |  Branch (1075:9): [True: 0, False: 0]
  ------------------
 1076|       |        /* Did not find anything */
 1077|      0|        *type = IGRAPH_ATTRIBUTE_COMBINE_DEFAULT;
 1078|      0|        *func = 0;
 1079|      0|    } else {
 1080|      0|        igraph_attribute_combination_record_t *rec = VECTOR(comb->list)[def];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1081|      0|        *type = rec->type;
 1082|      0|        *func = rec->func;
 1083|      0|    }
 1084|       |
 1085|      0|    return IGRAPH_SUCCESS;
 1086|  10.6k|}
igraph_attribute_combination:
 1111|  3.54k|        igraph_attribute_combination_t *comb, ...) {
 1112|       |
 1113|  3.54k|    va_list ap;
 1114|       |
 1115|  3.54k|    IGRAPH_CHECK(igraph_attribute_combination_init(comb));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1116|       |
 1117|  3.54k|    va_start(ap, comb);
 1118|  10.6k|    while (true) {
  ------------------
  |  Branch (1118:12): [True: 10.6k, Folded]
  ------------------
 1119|  10.6k|        igraph_function_pointer_t func = NULL;
 1120|  10.6k|        igraph_attribute_combination_type_t type;
 1121|  10.6k|        const char *name;
 1122|       |
 1123|  10.6k|        name = va_arg(ap, const char *);
 1124|       |
 1125|  10.6k|        if (name == IGRAPH_NO_MORE_ATTRIBUTES) {
  ------------------
  |  |  214|  10.6k|#define IGRAPH_NO_MORE_ATTRIBUTES ((const char*)0)
  ------------------
  |  Branch (1125:13): [True: 3.54k, False: 7.08k]
  ------------------
 1126|  3.54k|            break;
 1127|  3.54k|        }
 1128|       |
 1129|  7.08k|        type = (igraph_attribute_combination_type_t) va_arg(ap, int);
 1130|  7.08k|        if (type == IGRAPH_ATTRIBUTE_COMBINE_FUNCTION) {
  ------------------
  |  Branch (1130:13): [True: 0, False: 7.08k]
  ------------------
 1131|      0|            func = va_arg(ap, igraph_function_pointer_t);
 1132|      0|        }
 1133|       |
 1134|  7.08k|        if (strlen(name) == 0) {
  ------------------
  |  Branch (1134:13): [True: 0, False: 7.08k]
  ------------------
 1135|      0|            name = 0;
 1136|      0|        }
 1137|       |
 1138|  7.08k|        igraph_error_t ret = igraph_attribute_combination_add(comb, name, type, func);
 1139|  7.08k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1139:13): [True: 0, False: 7.08k]
  ------------------
 1140|      0|            va_end(ap);
 1141|      0|            return ret;
 1142|      0|        }
 1143|  7.08k|    }
 1144|       |
 1145|  3.54k|    va_end(ap);
 1146|       |
 1147|  3.54k|    return IGRAPH_SUCCESS;
 1148|  3.54k|}
attributes.c:igraph_i_attribute_record_destroy_values:
  185|  1.29M|static void igraph_i_attribute_record_destroy_values(igraph_attribute_record_t *attr) {
  186|  1.29M|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  1.29M|    do { \
  |  |  925|  1.29M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.29M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.29M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.29M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.29M]
  |  |  ------------------
  ------------------
  187|       |
  188|  1.29M|    if (attr->value.as_raw) {
  ------------------
  |  Branch (188:9): [True: 649k, False: 649k]
  ------------------
  189|   649k|        switch (attr->type) {
  190|   649k|            case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (190:13): [True: 649k, False: 0]
  ------------------
  191|   649k|                igraph_vector_destroy(attr->value.as_vector);
  192|   649k|                break;
  193|       |
  194|      0|            case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (194:13): [True: 0, False: 649k]
  ------------------
  195|      0|                igraph_strvector_destroy(attr->value.as_strvector);
  196|      0|                break;
  197|       |
  198|      0|            case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (198:13): [True: 0, False: 649k]
  ------------------
  199|      0|                igraph_vector_bool_destroy(attr->value.as_vector_bool);
  200|      0|                break;
  201|       |
  202|      0|            default:
  ------------------
  |  Branch (202:13): [True: 0, False: 649k]
  ------------------
  203|      0|                break;
  204|   649k|        }
  205|       |
  206|   649k|        igraph_free(attr->value.as_raw);
  207|   649k|        attr->value.as_raw = NULL;
  208|   649k|    }
  209|       |
  210|  1.29M|    switch (attr->type) {
  211|   649k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (211:9): [True: 649k, False: 649k]
  ------------------
  212|   649k|            attr->default_value.numeric = 0;
  213|   649k|            break;
  214|       |
  215|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (215:9): [True: 0, False: 1.29M]
  ------------------
  216|      0|            if (attr->default_value.string) {
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|      0|                igraph_free(attr->default_value.string);
  218|      0|                attr->default_value.string = NULL;
  219|      0|            }
  220|      0|            break;
  221|       |
  222|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (222:9): [True: 0, False: 1.29M]
  ------------------
  223|      0|            attr->default_value.boolean = 0;
  224|      0|            break;
  225|       |
  226|   649k|        default:
  ------------------
  |  Branch (226:9): [True: 649k, False: 649k]
  ------------------
  227|   649k|            break;
  228|  1.29M|    }
  229|       |
  230|  1.29M|    attr->type = IGRAPH_ATTRIBUTE_UNSPECIFIED;
  231|  1.29M|}
attributes.c:igraph_i_attribute_record_set_type:
  506|   649k|) {
  507|   649k|    bool type_changed = attr->type != type;
  508|       |
  509|   649k|    if (type_changed || attr->value.as_raw != ptr) {
  ------------------
  |  Branch (509:9): [True: 649k, False: 0]
  |  Branch (509:25): [True: 0, False: 0]
  ------------------
  510|   649k|        igraph_i_attribute_record_destroy_values(attr);
  511|   649k|        attr->type = type;
  512|   649k|        attr->value.as_raw = ptr;
  513|   649k|    }
  514|       |
  515|   649k|    if (type_changed && type == IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (515:9): [True: 649k, False: 0]
  |  Branch (515:25): [True: 649k, False: 0]
  ------------------
  516|   649k|        IGRAPH_ASSERT(
  ------------------
  |  |  924|   649k|    do { \
  |  |  925|   649k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   649k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   649k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 649k]
  |  |  ------------------
  ------------------
  517|   649k|            igraph_attribute_record_set_default_numeric(attr, IGRAPH_NAN) == IGRAPH_SUCCESS
  518|   649k|        );
  519|   649k|    }
  520|   649k|}
attributes.c:igraph_i_attribute_record_list_init_item:
  596|   612k|) {
  597|   612k|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|   612k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
  598|       |    return igraph_attribute_record_init(item, NULL, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  599|   612k|}
attributes.c:igraph_i_attribute_record_list_copy_item:
  603|  25.5k|) {
  604|  25.5k|    return igraph_attribute_record_init_copy(dest, source);
  605|  25.5k|}
attributes.c:igraph_i_attribute_record_list_destroy_item:
  607|   649k|static void igraph_i_attribute_record_list_destroy_item(igraph_attribute_record_t* item) {
  608|   649k|    igraph_attribute_record_destroy(item);
  609|   649k|}

igraph_i_property_cache_init:
   32|   353k|igraph_error_t igraph_i_property_cache_init(igraph_i_property_cache_t *cache) {
   33|   353k|    IGRAPH_STATIC_ASSERT(IGRAPH_PROP_I_SIZE <= 32);
  ------------------
  |  |   68|   353k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
   34|       |
   35|   353k|    memset(cache->value, 0, sizeof(cache->value));
   36|   353k|    cache->known = 0;
   37|   353k|    return IGRAPH_SUCCESS;
   38|   353k|}
igraph_i_property_cache_copy:
   45|  7.45k|        const igraph_i_property_cache_t *other_cache) {
   46|  7.45k|    *cache = *other_cache;
   47|  7.45k|    return IGRAPH_SUCCESS;
   48|  7.45k|}
igraph_i_property_cache_destroy:
   53|   360k|void igraph_i_property_cache_destroy(igraph_i_property_cache_t *cache) {
   54|   360k|    IGRAPH_UNUSED(cache);
  ------------------
  |  |   30|   360k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
   55|       |    /* Nothing to do */
   56|   360k|}
igraph_i_property_cache_get_bool:
   72|  24.8k|igraph_bool_t igraph_i_property_cache_get_bool(const igraph_t *graph, igraph_cached_property_t prop) {
   73|  24.8k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  24.8k|    do { \
  |  |  925|  24.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  49.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 24.8k]
  |  |  |  |  |  Branch (612:52): [True: 24.8k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 24.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  24.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 24.8k]
  |  |  ------------------
  ------------------
   74|  24.8k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (74:5): [True: 0, False: 24.8k]
  |  Branch (74:5): [True: 24.8k, False: 0]
  ------------------
   75|  24.8k|    return graph->cache->value[prop];
   76|  24.8k|}
igraph_i_property_cache_has:
   84|   352k|igraph_bool_t igraph_i_property_cache_has(const igraph_t *graph, igraph_cached_property_t prop) {
   85|   352k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|   352k|    do { \
  |  |  925|   352k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   704k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  Branch (612:52): [True: 352k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 352k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
   86|   352k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (86:5): [True: 0, False: 352k]
  |  Branch (86:5): [True: 352k, False: 0]
  ------------------
   87|   352k|    return graph->cache->known & (1 << prop);
   88|   352k|}
igraph_i_property_cache_set_bool:
   97|  23.7k|void igraph_i_property_cache_set_bool(const igraph_t *graph, igraph_cached_property_t prop, igraph_bool_t value) {
   98|  23.7k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  23.7k|    do { \
  |  |  925|  23.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  47.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.7k]
  |  |  |  |  |  Branch (612:52): [True: 23.7k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 23.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
   99|  23.7k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (99:5): [True: 0, False: 23.7k]
  |  Branch (99:5): [True: 23.7k, False: 0]
  ------------------
  100|       |    /* Even though graph is const, updating the cache is not considered modification.
  101|       |     * Functions that merely compute graph properties, and thus leave the graph structure
  102|       |     * intact, will often update the cache. */
  103|  23.7k|    graph->cache->value[prop] = value;
  104|  23.7k|    graph->cache->known |= (1 << prop);
  105|  23.7k|}
igraph_i_property_cache_set_bool_checked:
  123|  29.5k|void igraph_i_property_cache_set_bool_checked(const igraph_t *graph, igraph_cached_property_t prop, igraph_bool_t value) {
  124|  29.5k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  29.5k|    do { \
  |  |  925|  29.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  59.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 29.5k]
  |  |  |  |  |  Branch (612:52): [True: 29.5k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 29.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  29.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 29.5k]
  |  |  ------------------
  ------------------
  125|  29.5k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (125:5): [True: 0, False: 29.5k]
  |  Branch (125:5): [True: 29.5k, False: 0]
  ------------------
  126|       |    /* Even though graph is const, updating the cache is not considered modification.
  127|       |     * Functions that merely compute graph properties, and thus leave the graph structure
  128|       |     * intact, will often update the cache. */
  129|  29.5k|    if (graph->cache->known & (1 << prop)) {
  ------------------
  |  Branch (129:9): [True: 5.81k, False: 23.7k]
  ------------------
  130|  5.81k|        IGRAPH_ASSERT(graph->cache->value[prop] == value);
  ------------------
  |  |  924|  5.81k|    do { \
  |  |  925|  5.81k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  5.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  5.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 5.81k]
  |  |  ------------------
  ------------------
  131|  23.7k|    } else {
  132|  23.7k|        igraph_i_property_cache_set_bool(graph, prop, value);
  133|  23.7k|    }
  134|  29.5k|}
igraph_i_property_cache_invalidate_conditionally:
  182|   398k|) {
  183|   398k|    uint32_t invalidate = ~keep_always;
  184|   398k|    uint32_t mask;
  185|   398k|    uint32_t maybe_keep;
  186|   398k|    igraph_bool_t cached_value;
  187|       |
  188|   398k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (188:5): [True: 0, False: 398k]
  |  Branch (188:5): [True: 398k, False: 0]
  ------------------
  189|       |
  190|       |    /* The bits of maybe_keep are set to 1 for those properties that are:
  191|       |     *
  192|       |     * - currently cached
  193|       |     * - should _probably_ be invalidated
  194|       |     * - _but_ the current cached value of the property may change the decision
  195|       |     */
  196|   398k|    maybe_keep = graph->cache->known & invalidate & (keep_when_false | keep_when_true);
  197|       |
  198|   398k|    if (maybe_keep) {
  ------------------
  |  Branch (198:9): [True: 0, False: 398k]
  ------------------
  199|      0|        for (igraph_cached_property_t prop = (igraph_cached_property_t ) 0; prop < IGRAPH_PROP_I_SIZE; ++prop) {
  ------------------
  |  Branch (199:77): [True: 0, False: 0]
  ------------------
  200|      0|            mask = 1 << prop;
  201|      0|            if (maybe_keep & mask) {
  ------------------
  |  Branch (201:17): [True: 0, False: 0]
  ------------------
  202|       |                /* if we get here, we know that the property is cached; we have
  203|       |                 * masked maybe_keep with graph->cache->known */
  204|      0|                cached_value = igraph_i_property_cache_get_bool(graph, prop);
  205|      0|                if (
  206|      0|                    ((keep_when_false & mask) && !cached_value) ||
  ------------------
  |  Branch (206:22): [True: 0, False: 0]
  |  Branch (206:50): [True: 0, False: 0]
  ------------------
  207|      0|                    ((keep_when_true & mask) && cached_value)
  ------------------
  |  Branch (207:22): [True: 0, False: 0]
  |  Branch (207:49): [True: 0, False: 0]
  ------------------
  208|      0|                ) {
  209|      0|                    invalidate &= ~mask;
  210|      0|                }
  211|      0|            }
  212|      0|        }
  213|      0|    }
  214|       |
  215|   398k|    graph->cache->known &= ~invalidate;
  216|   398k|}

igraph_cattribute_EANV:
 2226|  7.08k|                           igraph_es_t eids, igraph_vector_t *result) {
 2227|  7.08k|    igraph_vector_clear(result);
 2228|  7.08k|    return igraph_i_cattribute_get_numeric_edge_attr(graph, name, eids, result);
 2229|  7.08k|}
igraph_cattribute_VAN_setv:
 2636|  3.54k|                               const igraph_vector_t *v) {
 2637|  3.54k|    igraph_i_cattributes_t *attr = graph->attr;
 2638|  3.54k|    igraph_attribute_record_t *rec;
 2639|  3.54k|    igraph_int_t nv = igraph_vcount(graph);
 2640|       |
 2641|       |    /* Check length first */
 2642|  3.54k|    if (igraph_vector_size(v) != nv) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 3.54k]
  ------------------
 2643|      0|        IGRAPH_ERROR("Invalid vertex attribute vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2644|      0|    }
 2645|       |
 2646|  3.54k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_create(&attr->val, name, IGRAPH_ATTRIBUTE_NUMERIC, nv, &rec));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 2647|  3.54k|    IGRAPH_CHECK(igraph_vector_update(rec->value.as_vector, v));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 2648|       |
 2649|  3.54k|    return IGRAPH_SUCCESS;
 2650|  3.54k|}
igraph_cattribute_EAN_setv:
 2734|  3.54k|                               const igraph_vector_t *v) {
 2735|  3.54k|    igraph_i_cattributes_t *attr = graph->attr;
 2736|  3.54k|    igraph_attribute_record_t *rec;
 2737|  3.54k|    igraph_int_t ne = igraph_ecount(graph);
 2738|       |
 2739|       |    /* Check length first */
 2740|  3.54k|    if (igraph_vector_size(v) != ne) {
  ------------------
  |  Branch (2740:9): [True: 0, False: 3.54k]
  ------------------
 2741|      0|        IGRAPH_ERROR("Invalid edge attribute vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2742|      0|    }
 2743|       |
 2744|  3.54k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_create(&attr->eal, name, IGRAPH_ATTRIBUTE_NUMERIC, ne, &rec));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 2745|  3.54k|    IGRAPH_CHECK(igraph_vector_update(rec->value.as_vector, v));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 2746|       |
 2747|  3.54k|    return IGRAPH_SUCCESS;
 2748|  3.54k|}
igraph_cattribute_remove_all:
 2896|  3.54k|                                  igraph_bool_t v, igraph_bool_t e) {
 2897|       |
 2898|  3.54k|    igraph_i_cattributes_t *attr = graph->attr;
 2899|       |
 2900|  3.54k|    if (g) {
  ------------------
  |  Branch (2900:9): [True: 3.54k, False: 0]
  ------------------
 2901|  3.54k|        igraph_attribute_record_list_clear(&attr->gal);
 2902|  3.54k|    }
 2903|  3.54k|    if (v) {
  ------------------
  |  Branch (2903:9): [True: 3.54k, False: 0]
  ------------------
 2904|  3.54k|        igraph_attribute_record_list_clear(&attr->val);
 2905|  3.54k|    }
 2906|  3.54k|    if (e) {
  ------------------
  |  Branch (2906:9): [True: 3.54k, False: 0]
  ------------------
 2907|  3.54k|        igraph_attribute_record_list_clear(&attr->eal);
 2908|  3.54k|    }
 2909|  3.54k|}
cattributes.c:igraph_i_cattribute_init:
  195|   352k|) {
  196|   352k|    igraph_i_cattributes_t *nattr;
  197|       |
  198|   352k|    nattr = IGRAPH_CALLOC(1, igraph_i_cattributes_t);
  ------------------
  |  |   33|   352k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   705k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 352k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|   352k|    IGRAPH_CHECK_OOM(nattr, "Insufficient memory to allocate attribute storage.");
  ------------------
  |  |  709|   352k|    do { \
  |  |  710|   352k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  200|   352k|    IGRAPH_FINALLY(igraph_free, nattr);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  201|       |
  202|   352k|    if (attr) {
  ------------------
  |  Branch (202:9): [True: 0, False: 352k]
  ------------------
  203|      0|        IGRAPH_CHECK(igraph_attribute_record_list_init_copy(&nattr->gal, attr));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  204|   352k|    } else {
  205|   352k|        IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->gal, 0));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  206|   352k|    }
  207|   352k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->gal);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  208|       |
  209|   352k|    IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->val, 0));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  210|   352k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->val);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  211|       |
  212|   352k|    IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->eal, 0));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  213|   352k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->eal);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  214|       |
  215|   352k|    graph->attr = nattr;
  216|   352k|    IGRAPH_FINALLY_CLEAN(4);
  217|       |
  218|   352k|    return IGRAPH_SUCCESS;
  219|   352k|}
cattributes.c:igraph_i_cattribute_destroy:
  221|   673k|static void igraph_i_cattribute_destroy(igraph_t *graph) {
  222|   673k|    igraph_i_cattributes_t *attr = graph->attr;
  223|   673k|    igraph_attribute_record_list_destroy(&attr->eal);
  224|   673k|    igraph_attribute_record_list_destroy(&attr->val);
  225|   673k|    igraph_attribute_record_list_destroy(&attr->gal);
  226|       |    IGRAPH_FREE(graph->attr); /* sets to NULL */
  ------------------
  |  |   36|   673k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  227|   673k|}
cattributes.c:igraph_i_cattribute_copy:
  235|   321k|) {
  236|   321k|    igraph_i_cattributes_t *attrto, *attrfrom = from->attr;
  237|   321k|    igraph_attribute_record_list_t *alto[3], *alfrom[3] = {
  238|   321k|        &attrfrom->gal, &attrfrom->val, &attrfrom->eal
  239|   321k|    };
  240|   321k|    igraph_bool_t copy[3] = { ga, va, ea };
  241|       |
  242|   321k|    attrto = IGRAPH_CALLOC(1, igraph_i_cattributes_t);
  ------------------
  |  |   33|   321k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   642k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 321k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|   321k|    IGRAPH_CHECK_OOM(attrto, "Insufficient memory to copy attributes.");
  ------------------
  |  |  709|   321k|    do { \
  |  |  710|   321k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   321k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 321k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   321k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 321k]
  |  |  ------------------
  ------------------
  244|   321k|    IGRAPH_FINALLY(igraph_free, attrto);
  ------------------
  |  |  603|   321k|    do { \
  |  |  604|   321k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   321k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   321k|         * incorrect destructor function with the pointer */ \
  |  |  607|   321k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 321k]
  |  |  ------------------
  |  |  608|   321k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   321k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 321k]
  |  |  ------------------
  ------------------
  245|       |
  246|   321k|    alto[0] = &attrto->gal;
  247|   321k|    alto[1] = &attrto->val;
  248|   321k|    alto[2] = &attrto->eal;
  249|       |
  250|  1.28M|    for (igraph_int_t i = 0; i < 3; i++) {
  ------------------
  |  Branch (250:30): [True: 963k, False: 321k]
  ------------------
  251|   963k|        if (copy[i]) {
  ------------------
  |  Branch (251:13): [True: 346k, False: 616k]
  ------------------
  252|   346k|            IGRAPH_CHECK(igraph_attribute_record_list_init_copy(alto[i], alfrom[i]));
  ------------------
  |  |  656|   346k|    do { \
  |  |  657|   346k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   346k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   346k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 346k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   346k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 346k]
  |  |  ------------------
  ------------------
  253|   616k|        } else {
  254|   616k|            IGRAPH_CHECK(igraph_attribute_record_list_init(alto[i], 0));
  ------------------
  |  |  656|   616k|    do { \
  |  |  657|   616k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   616k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   616k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 616k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   616k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 616k]
  |  |  ------------------
  ------------------
  255|   616k|        }
  256|   963k|        IGRAPH_FINALLY(igraph_attribute_record_list_destroy, alto[i]);
  ------------------
  |  |  603|   963k|    do { \
  |  |  604|   963k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   963k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   963k|         * incorrect destructor function with the pointer */ \
  |  |  607|   963k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 963k]
  |  |  ------------------
  |  |  608|   963k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   963k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 963k]
  |  |  ------------------
  ------------------
  257|   963k|    }
  258|       |
  259|   321k|    to->attr = attrto;
  260|   321k|    IGRAPH_FINALLY_CLEAN(4);
  261|       |
  262|   321k|    return IGRAPH_SUCCESS;
  263|   321k|}
cattributes.c:igraph_i_cattribute_add_vertices:
  373|   355k|) {
  374|   355k|    igraph_i_cattributes_t *attr = graph->attr;
  375|   355k|    return igraph_i_cattribute_add_vertices_or_edges(&attr->val, igraph_vcount(graph), nv, nattr);
  376|   355k|}
cattributes.c:igraph_i_cattribute_add_vertices_or_edges:
  344|   397k|) {
  345|   397k|    igraph_int_t origlen = newlen - nv;
  346|   397k|    igraph_error_t err = igraph_i_cattribute_add_vertices_or_edges_inner(
  347|   397k|        val, newlen, nv, nattr
  348|   397k|    );
  349|       |
  350|   397k|    if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (350:9): [True: 0, False: 397k]
  ------------------
  351|       |        /* If unsuccessful, revert attribute vector sizes.
  352|       |         * The following function assumes that all attributes vectors that
  353|       |         * are present have a length at least as great as origlen.
  354|       |         * This is true at the moment because any new attributes that are
  355|       |         * added to the graph are created directly at 'origlen' instead of
  356|       |         * being created at smaller sizes and resized later.
  357|       |         *
  358|       |         * NOTE: While this ensures that all attribute vector lengths are
  359|       |         * correct, it does not ensure that no extra attributes have
  360|       |         * been added to the graph. However, the presence of extra
  361|       |         * attributes does not make the attribute table inconsistent
  362|       |         * like the incorrect attribute vector lengths would.
  363|       |         */
  364|      0|        igraph_i_cattribute_revert_attribute_vector_sizes(val, origlen);
  365|      0|    }
  366|       |
  367|   397k|    return err;
  368|   397k|}
cattributes.c:igraph_i_cattribute_add_vertices_or_edges_inner:
  269|   397k|) {
  270|   397k|    igraph_int_t length;
  271|   397k|    igraph_int_t nattrno = nattr == NULL ? 0 : igraph_attribute_record_list_size(nattr);
  ------------------
  |  Branch (271:28): [True: 397k, False: 0]
  ------------------
  272|   397k|    igraph_int_t origlen = newlen - nv;
  273|       |
  274|   397k|    IGRAPH_ASSERT(origlen >= 0);
  ------------------
  |  |  924|   397k|    do { \
  |  |  925|   397k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   397k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 397k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   397k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 397k]
  |  |  ------------------
  ------------------
  275|       |
  276|       |    /* Find all the attributes that are newly added, and create new value vectors
  277|       |     * for them in the original graph */
  278|   397k|    for (igraph_int_t i = 0; i < nattrno; i++) {
  ------------------
  |  Branch (278:30): [True: 0, False: 397k]
  ------------------
  279|      0|        const igraph_attribute_record_t *nattr_entry = igraph_attribute_record_list_get_ptr(nattr, i);
  280|      0|        const char *nname = nattr_entry->name;
  281|      0|        IGRAPH_CHECK(igraph_i_cattribute_find_or_create(val, nname, nattr_entry->type, origlen, NULL));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  282|      0|    }
  283|       |
  284|       |    /* Now append the new values */
  285|   397k|    length = igraph_attribute_record_list_size(val);
  286|   397k|    for (igraph_int_t i = 0; i < length; i++) {
  ------------------
  |  Branch (286:30): [True: 0, False: 397k]
  ------------------
  287|      0|        igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(val, i);
  288|      0|        const igraph_attribute_record_t *newrec = nattr
  ------------------
  |  Branch (288:51): [True: 0, False: 0]
  ------------------
  289|      0|            ? igraph_i_cattribute_find_const(nattr, oldrec->name, oldrec->type)
  290|      0|            : NULL;
  291|       |
  292|      0|        IGRAPH_ASSERT(igraph_attribute_record_size(oldrec) == origlen);
  ------------------
  |  |  924|      0|    do { \
  |  |  925|      0|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  293|       |
  294|      0|        if (newrec) {
  ------------------
  |  Branch (294:13): [True: 0, False: 0]
  ------------------
  295|       |            /* This attribute is present in nattr */
  296|      0|            switch (oldrec->type) {
  297|      0|            case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|                if (nv != igraph_vector_size(newrec->value.as_vector)) {
  ------------------
  |  Branch (298:21): [True: 0, False: 0]
  ------------------
  299|      0|                    IGRAPH_ERROR("Invalid numeric attribute length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  300|      0|                }
  301|      0|                IGRAPH_CHECK(igraph_vector_append(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  302|      0|                    oldrec->value.as_vector, newrec->value.as_vector
  303|      0|                ));
  304|      0|                break;
  305|      0|            case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (305:13): [True: 0, False: 0]
  ------------------
  306|      0|                if (nv != igraph_strvector_size(newrec->value.as_strvector)) {
  ------------------
  |  Branch (306:21): [True: 0, False: 0]
  ------------------
  307|      0|                    IGRAPH_ERROR("Invalid string attribute length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  308|      0|                }
  309|      0|                IGRAPH_CHECK(igraph_strvector_append(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  310|      0|                    oldrec->value.as_strvector, newrec->value.as_strvector
  311|      0|                ));
  312|      0|                break;
  313|      0|            case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|                if (nv != igraph_vector_bool_size(newrec->value.as_vector_bool)) {
  ------------------
  |  Branch (314:21): [True: 0, False: 0]
  ------------------
  315|      0|                    IGRAPH_ERROR("Invalid boolean attribute length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  316|      0|                }
  317|      0|                IGRAPH_CHECK(igraph_vector_bool_append(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  318|      0|                    oldrec->value.as_vector_bool, newrec->value.as_vector_bool
  319|      0|                ));
  320|      0|                break;
  321|      0|            default:
  ------------------
  |  Branch (321:13): [True: 0, False: 0]
  ------------------
  322|      0|                IGRAPH_WARNINGF(
  ------------------
  |  |  777|      0|    do { \
  |  |  778|      0|        igraph_warningf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  779|      0|                        __VA_ARGS__); \
  |  |  780|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (780:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  323|      0|                    "Attribute '%s' with unknown type %d ignored.",
  324|      0|                    oldrec->name, (int) oldrec->type
  325|      0|                );
  326|      0|                break;
  327|      0|            }
  328|      0|        } else {
  329|       |            /* No such attribute among the new ones so just extend the length
  330|       |             * of the current record */
  331|      0|            IGRAPH_CHECK(igraph_attribute_record_resize(oldrec, newlen));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  332|      0|        }
  333|       |
  334|      0|        IGRAPH_ASSERT(igraph_attribute_record_size(oldrec) == newlen);
  ------------------
  |  |  924|      0|    do { \
  |  |  925|      0|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  335|      0|    }
  336|       |
  337|   397k|    return IGRAPH_SUCCESS;
  338|   397k|}
cattributes.c:igraph_i_cattribute_permute_vertices:
  668|   302k|) {
  669|   302k|    igraph_i_cattributes_t *attr = graph->attr, *new_attr = newgraph->attr;
  670|   302k|    igraph_attribute_record_list_t *val = &attr->val, *new_val = &new_attr->val;
  671|   302k|    if (graph == newgraph) {
  ------------------
  |  Branch (671:9): [True: 0, False: 302k]
  ------------------
  672|      0|        return igraph_i_cattribute_permute_attribute_record_list_in_place(val, idx);
  673|   302k|    } else {
  674|   302k|        return igraph_i_cattribute_permute_attribute_record_list(val, new_val, idx);
  675|   302k|    }
  676|   302k|}
cattributes.c:igraph_i_cattribute_permute_attribute_record_list:
  497|   605k|) {
  498|   605k|    igraph_int_t no_attrs, idxlen;
  499|       |
  500|   605k|    no_attrs = igraph_attribute_record_list_size(attrs);
  501|       |
  502|       |    /* When vertices or edges  are permuted, we now assume that there are no
  503|       |     * attributes in the target attribute list yet */
  504|   605k|    IGRAPH_ASSERT(igraph_attribute_record_list_empty(new_attrs));
  ------------------
  |  |  924|   605k|    do { \
  |  |  925|   605k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   605k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 605k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   605k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 605k]
  |  |  ------------------
  ------------------
  505|   605k|    IGRAPH_FINALLY(igraph_attribute_record_list_clear, new_attrs);
  ------------------
  |  |  603|   605k|    do { \
  |  |  604|   605k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   605k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   605k|         * incorrect destructor function with the pointer */ \
  |  |  607|   605k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 605k]
  |  |  ------------------
  |  |  608|   605k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   605k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 605k]
  |  |  ------------------
  ------------------
  506|       |
  507|   605k|    idxlen = igraph_vector_int_size(idx);
  508|  1.21M|    for (igraph_int_t i = 0; i < no_attrs; i++) {
  ------------------
  |  Branch (508:30): [True: 605k, False: 605k]
  ------------------
  509|   605k|        igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(attrs, i);
  510|   605k|        igraph_attribute_type_t type = oldrec->type;
  511|       |
  512|       |        /* Create a record for the same attribute in the new graph */
  513|   605k|        igraph_attribute_record_t *newrec;
  514|   605k|        IGRAPH_CHECK(igraph_i_cattribute_find_or_create(
  ------------------
  |  |  656|   605k|    do { \
  |  |  657|   605k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   605k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   605k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 605k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   605k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 605k]
  |  |  ------------------
  ------------------
  515|   605k|            new_attrs, oldrec->name, oldrec->type, idxlen, &newrec
  516|   605k|        ));
  517|       |
  518|       |        /* The data */
  519|   605k|        switch (type) {
  520|   605k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (520:9): [True: 605k, False: 0]
  ------------------
  521|   605k|            IGRAPH_CHECK(igraph_vector_index(
  ------------------
  |  |  656|   605k|    do { \
  |  |  657|   605k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   605k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   605k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 605k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   605k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 605k]
  |  |  ------------------
  ------------------
  522|   605k|                oldrec->value.as_vector, newrec->value.as_vector, idx
  523|   605k|            ));
  524|   605k|            break;
  525|   605k|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (525:9): [True: 0, False: 605k]
  ------------------
  526|      0|            IGRAPH_CHECK(igraph_vector_bool_index(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  527|      0|                oldrec->value.as_vector_bool, newrec->value.as_vector_bool, idx
  528|      0|            ));
  529|      0|            break;
  530|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (530:9): [True: 0, False: 605k]
  ------------------
  531|      0|            IGRAPH_CHECK(igraph_strvector_index(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  532|      0|                oldrec->value.as_strvector, newrec->value.as_strvector, idx
  533|      0|            ));
  534|      0|            break;
  535|      0|        default:
  ------------------
  |  Branch (535:9): [True: 0, False: 605k]
  ------------------
  536|      0|            IGRAPH_WARNINGF(
  ------------------
  |  |  777|      0|    do { \
  |  |  778|      0|        igraph_warningf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  779|      0|                        __VA_ARGS__); \
  |  |  780|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (780:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  537|   605k|                "Attribute '%s' with unknown type %d ignored.",
  538|   605k|                oldrec->name, (int) oldrec->type
  539|   605k|            );
  540|   605k|        }
  541|   605k|    }
  542|       |
  543|   605k|    IGRAPH_FINALLY_CLEAN(1);
  544|       |
  545|   605k|    return IGRAPH_SUCCESS;
  546|   605k|}
cattributes.c:igraph_i_cattribute_combine_vertices:
 1452|  3.54k|) {
 1453|  3.54k|    igraph_i_cattributes_t *attr = graph->attr;
 1454|  3.54k|    igraph_i_cattributes_t *toattr = newgraph->attr;
 1455|  3.54k|    return igraph_i_cattribute_combine_attribute_record_lists(
 1456|  3.54k|        &attr->val, &toattr->val, merges, comb
 1457|  3.54k|    );
 1458|  3.54k|}
cattributes.c:igraph_i_cattribute_combine_attribute_record_lists:
 1270|  10.6k|) {
 1271|  10.6k|    igraph_int_t no_attrs = igraph_attribute_record_list_size(attrs);
 1272|  10.6k|    igraph_attribute_combination_todo_item_t *todo_items;
 1273|       |
 1274|  10.6k|    IGRAPH_ASSERT(attrs != new_attrs);
  ------------------
  |  |  924|  10.6k|    do { \
  |  |  925|  10.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1275|  10.6k|    IGRAPH_ASSERT(igraph_attribute_record_list_empty(new_attrs));
  ------------------
  |  |  924|  10.6k|    do { \
  |  |  925|  10.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1276|       |
 1277|  10.6k|    todo_items = IGRAPH_CALLOC(no_attrs, igraph_attribute_combination_todo_item_t);
  ------------------
  |  |   33|  10.6k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  21.2k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1278|  10.6k|    IGRAPH_CHECK_OOM(todo_items, "Cannot combine attributes.");
  ------------------
  |  |  709|  10.6k|    do { \
  |  |  710|  10.6k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1279|  10.6k|    IGRAPH_FINALLY(igraph_free, todo_items);
  ------------------
  |  |  603|  10.6k|    do { \
  |  |  604|  10.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.6k]
  |  |  ------------------
  |  |  608|  10.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1280|       |
 1281|  21.2k|    for (igraph_int_t i = 0; i < no_attrs; i++) {
  ------------------
  |  Branch (1281:30): [True: 10.6k, False: 10.6k]
  ------------------
 1282|  10.6k|        const igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(attrs, i);
 1283|  10.6k|        const char *name = oldrec->name;
 1284|  10.6k|        igraph_attribute_combination_type_t type;
 1285|  10.6k|        igraph_function_pointer_t voidfunc;
 1286|  10.6k|        IGRAPH_CHECK(igraph_attribute_combination_query(comb, name, &type, &voidfunc));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1287|  10.6k|        todo_items[i].type = type;
 1288|  10.6k|        todo_items[i].func.as_void = voidfunc;
 1289|  10.6k|    }
 1290|       |
 1291|  10.6k|    IGRAPH_FINALLY(igraph_attribute_record_list_clear, new_attrs);
  ------------------
  |  |  603|  10.6k|    do { \
  |  |  604|  10.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.6k]
  |  |  ------------------
  |  |  608|  10.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1292|       |
 1293|  21.2k|    for (igraph_int_t i = 0; i < no_attrs; i++) {
  ------------------
  |  Branch (1293:30): [True: 10.6k, False: 10.6k]
  ------------------
 1294|  10.6k|        const igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(attrs, i);
 1295|  10.6k|        igraph_attribute_record_t newrec;
 1296|  10.6k|        const char *name = oldrec->name;
 1297|  10.6k|        igraph_attribute_combination_todo_item_t todo_item = todo_items[i];
 1298|  10.6k|        igraph_attribute_type_t attr_type = oldrec->type;
 1299|       |
 1300|  10.6k|        if (todo_item.type == IGRAPH_ATTRIBUTE_COMBINE_DEFAULT ||
  ------------------
  |  Branch (1300:13): [True: 0, False: 10.6k]
  ------------------
 1301|  10.6k|            todo_item.type == IGRAPH_ATTRIBUTE_COMBINE_IGNORE) {
  ------------------
  |  Branch (1301:13): [True: 0, False: 10.6k]
  ------------------
 1302|      0|            continue;
 1303|      0|        }
 1304|       |
 1305|  10.6k|        IGRAPH_CHECK(igraph_attribute_record_init(&newrec, name, attr_type));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1306|  10.6k|        IGRAPH_FINALLY(igraph_attribute_record_destroy, &newrec);
  ------------------
  |  |  603|  10.6k|    do { \
  |  |  604|  10.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.6k]
  |  |  ------------------
  |  |  608|  10.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1307|       |
 1308|  10.6k|        IGRAPH_CHECK(igraph_attribute_record_resize(&newrec, igraph_vector_int_list_size(merges)));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1309|       |
 1310|  10.6k|        if (attr_type == IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (1310:13): [True: 10.6k, False: 0]
  ------------------
 1311|  10.6k|            switch (todo_item.type) {
 1312|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FUNCTION:
  ------------------
  |  Branch (1312:13): [True: 0, False: 10.6k]
  ------------------
 1313|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_func(oldrec, &newrec, merges,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1314|      0|                             todo_item.func.as_num));
 1315|      0|                break;
 1316|  7.08k|            case IGRAPH_ATTRIBUTE_COMBINE_SUM:
  ------------------
  |  Branch (1316:13): [True: 7.08k, False: 3.54k]
  ------------------
 1317|  7.08k|                IGRAPH_CHECK(igraph_i_cattributes_cn_sum(oldrec, &newrec, merges));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1318|  7.08k|                break;
 1319|  7.08k|            case IGRAPH_ATTRIBUTE_COMBINE_PROD:
  ------------------
  |  Branch (1319:13): [True: 0, False: 10.6k]
  ------------------
 1320|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_prod(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1321|      0|                break;
 1322|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MIN:
  ------------------
  |  Branch (1322:13): [True: 0, False: 10.6k]
  ------------------
 1323|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_min(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1324|      0|                break;
 1325|  3.54k|            case IGRAPH_ATTRIBUTE_COMBINE_MAX:
  ------------------
  |  Branch (1325:13): [True: 3.54k, False: 7.08k]
  ------------------
 1326|  3.54k|                IGRAPH_CHECK(igraph_i_cattributes_cn_max(oldrec, &newrec, merges));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1327|  3.54k|                break;
 1328|  3.54k|            case IGRAPH_ATTRIBUTE_COMBINE_RANDOM:
  ------------------
  |  Branch (1328:13): [True: 0, False: 10.6k]
  ------------------
 1329|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_random(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1330|      0|                break;
 1331|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FIRST:
  ------------------
  |  Branch (1331:13): [True: 0, False: 10.6k]
  ------------------
 1332|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_first(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1333|      0|                break;
 1334|      0|            case IGRAPH_ATTRIBUTE_COMBINE_LAST:
  ------------------
  |  Branch (1334:13): [True: 0, False: 10.6k]
  ------------------
 1335|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_last(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1336|      0|                break;
 1337|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEAN:
  ------------------
  |  Branch (1337:13): [True: 0, False: 10.6k]
  ------------------
 1338|      0|                IGRAPH_CHECK(igraph_i_cattributes_cn_mean(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1339|      0|                break;
 1340|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEDIAN:
  ------------------
  |  Branch (1340:13): [True: 0, False: 10.6k]
  ------------------
 1341|      0|                IGRAPH_ERROR("Median calculation not implemented.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1342|      0|                             IGRAPH_UNIMPLEMENTED);
 1343|      0|                break;
 1344|      0|            case IGRAPH_ATTRIBUTE_COMBINE_CONCAT:
  ------------------
  |  Branch (1344:13): [True: 0, False: 10.6k]
  ------------------
 1345|      0|                IGRAPH_ERROR("Cannot concatenate numeric attributes.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1346|      0|                             IGRAPH_EATTRCOMBINE);
 1347|      0|                break;
 1348|      0|            default:
  ------------------
  |  Branch (1348:13): [True: 0, False: 10.6k]
  ------------------
 1349|      0|                IGRAPH_ERROR("Unknown attribute combination.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1350|      0|                             IGRAPH_UNIMPLEMENTED);
 1351|      0|                break;
 1352|  10.6k|            }
 1353|  10.6k|        } else if (attr_type == IGRAPH_ATTRIBUTE_BOOLEAN) {
  ------------------
  |  Branch (1353:20): [True: 0, False: 0]
  ------------------
 1354|      0|            switch (todo_item.type) {
 1355|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FUNCTION:
  ------------------
  |  Branch (1355:13): [True: 0, False: 0]
  ------------------
 1356|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_func(oldrec, &newrec, merges,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1357|      0|                             todo_item.func.as_bool));
 1358|      0|                break;
 1359|      0|            case IGRAPH_ATTRIBUTE_COMBINE_SUM:
  ------------------
  |  Branch (1359:13): [True: 0, False: 0]
  ------------------
 1360|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MAX:
  ------------------
  |  Branch (1360:13): [True: 0, False: 0]
  ------------------
 1361|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_any_is_true(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1362|      0|                break;
 1363|      0|            case IGRAPH_ATTRIBUTE_COMBINE_PROD:
  ------------------
  |  Branch (1363:13): [True: 0, False: 0]
  ------------------
 1364|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MIN:
  ------------------
  |  Branch (1364:13): [True: 0, False: 0]
  ------------------
 1365|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_all_is_true(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1366|      0|                break;
 1367|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEAN:
  ------------------
  |  Branch (1367:13): [True: 0, False: 0]
  ------------------
 1368|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEDIAN:
  ------------------
  |  Branch (1368:13): [True: 0, False: 0]
  ------------------
 1369|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_majority(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1370|      0|                break;
 1371|      0|            case IGRAPH_ATTRIBUTE_COMBINE_RANDOM:
  ------------------
  |  Branch (1371:13): [True: 0, False: 0]
  ------------------
 1372|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_random(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1373|      0|                break;
 1374|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FIRST:
  ------------------
  |  Branch (1374:13): [True: 0, False: 0]
  ------------------
 1375|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_first(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1376|      0|                break;
 1377|      0|            case IGRAPH_ATTRIBUTE_COMBINE_LAST:
  ------------------
  |  Branch (1377:13): [True: 0, False: 0]
  ------------------
 1378|      0|                IGRAPH_CHECK(igraph_i_cattributes_cb_last(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1379|      0|                break;
 1380|      0|            case IGRAPH_ATTRIBUTE_COMBINE_CONCAT:
  ------------------
  |  Branch (1380:13): [True: 0, False: 0]
  ------------------
 1381|      0|                IGRAPH_ERROR("Cannot calculate concatenation of Booleans.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1382|      0|                             IGRAPH_EATTRCOMBINE);
 1383|      0|                break;
 1384|      0|            default:
  ------------------
  |  Branch (1384:13): [True: 0, False: 0]
  ------------------
 1385|      0|                IGRAPH_ERROR("Unknown attribute combination.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1386|      0|                             IGRAPH_UNIMPLEMENTED);
 1387|      0|                break;
 1388|      0|            }
 1389|      0|        } else if (attr_type == IGRAPH_ATTRIBUTE_STRING) {
  ------------------
  |  Branch (1389:20): [True: 0, False: 0]
  ------------------
 1390|      0|            switch (todo_item.type) {
 1391|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FUNCTION:
  ------------------
  |  Branch (1391:13): [True: 0, False: 0]
  ------------------
 1392|      0|                IGRAPH_CHECK(igraph_i_cattributes_cs_func(oldrec, &newrec, merges,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1393|      0|                             todo_item.func.as_str));
 1394|      0|                break;
 1395|      0|            case IGRAPH_ATTRIBUTE_COMBINE_SUM:
  ------------------
  |  Branch (1395:13): [True: 0, False: 0]
  ------------------
 1396|      0|                IGRAPH_ERROR("Cannot sum strings.", IGRAPH_EATTRCOMBINE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1397|      0|                break;
 1398|      0|            case IGRAPH_ATTRIBUTE_COMBINE_PROD:
  ------------------
  |  Branch (1398:13): [True: 0, False: 0]
  ------------------
 1399|      0|                IGRAPH_ERROR("Cannot multiply strings.", IGRAPH_EATTRCOMBINE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1400|      0|                break;
 1401|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MIN:
  ------------------
  |  Branch (1401:13): [True: 0, False: 0]
  ------------------
 1402|      0|                IGRAPH_ERROR("Cannot find minimum of strings.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1403|      0|                             IGRAPH_EATTRCOMBINE);
 1404|      0|                break;
 1405|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MAX:
  ------------------
  |  Branch (1405:13): [True: 0, False: 0]
  ------------------
 1406|      0|                IGRAPH_ERROR("Cannot find maximum of strings.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1407|      0|                             IGRAPH_EATTRCOMBINE);
 1408|      0|                break;
 1409|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEAN:
  ------------------
  |  Branch (1409:13): [True: 0, False: 0]
  ------------------
 1410|      0|                IGRAPH_ERROR("Cannot calculate mean of strings.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1411|      0|                             IGRAPH_EATTRCOMBINE);
 1412|      0|                break;
 1413|      0|            case IGRAPH_ATTRIBUTE_COMBINE_MEDIAN:
  ------------------
  |  Branch (1413:13): [True: 0, False: 0]
  ------------------
 1414|      0|                IGRAPH_ERROR("Cannot calculate median of strings.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1415|      0|                             IGRAPH_EATTRCOMBINE);
 1416|      0|                break;
 1417|      0|            case IGRAPH_ATTRIBUTE_COMBINE_RANDOM:
  ------------------
  |  Branch (1417:13): [True: 0, False: 0]
  ------------------
 1418|      0|                IGRAPH_CHECK(igraph_i_cattributes_sn_random(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1419|      0|                break;
 1420|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FIRST:
  ------------------
  |  Branch (1420:13): [True: 0, False: 0]
  ------------------
 1421|      0|                IGRAPH_CHECK(igraph_i_cattributes_cs_first(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1422|      0|                break;
 1423|      0|            case IGRAPH_ATTRIBUTE_COMBINE_LAST:
  ------------------
  |  Branch (1423:13): [True: 0, False: 0]
  ------------------
 1424|      0|                IGRAPH_CHECK(igraph_i_cattributes_cs_last(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1425|      0|                break;
 1426|      0|            case IGRAPH_ATTRIBUTE_COMBINE_CONCAT:
  ------------------
  |  Branch (1426:13): [True: 0, False: 0]
  ------------------
 1427|      0|                IGRAPH_CHECK(igraph_i_cattributes_cs_concat(oldrec, &newrec, merges));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1428|      0|                break;
 1429|      0|            default:
  ------------------
  |  Branch (1429:13): [True: 0, False: 0]
  ------------------
 1430|      0|                IGRAPH_ERROR("Unknown attribute combination.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1431|      0|                             IGRAPH_UNIMPLEMENTED);
 1432|      0|                break;
 1433|      0|            }
 1434|      0|        } else {
 1435|      0|            IGRAPH_ERROR("Unknown attribute type, this should not happen.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1436|      0|                         IGRAPH_UNIMPLEMENTED);
 1437|      0|        }
 1438|       |
 1439|  10.6k|        IGRAPH_CHECK(igraph_attribute_record_list_push_back(new_attrs, &newrec));
  ------------------
  |  |  656|  10.6k|    do { \
  |  |  657|  10.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1440|  10.6k|        IGRAPH_FINALLY_CLEAN(1);  /* ownership of newrec transferred */
 1441|  10.6k|    }
 1442|       |
 1443|  10.6k|    IGRAPH_FREE(todo_items);
  ------------------
  |  |   36|  10.6k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1444|  10.6k|    IGRAPH_FINALLY_CLEAN(2);
 1445|       |
 1446|  10.6k|    return IGRAPH_SUCCESS;
 1447|  10.6k|}
cattributes.c:igraph_i_cattributes_cn_sum:
  689|  7.08k|                                       const igraph_vector_int_list_t *merges) {
  690|  7.08k|    const igraph_vector_t *oldv = oldrec->value.as_vector;
  691|  7.08k|    igraph_vector_t *newv = newrec->value.as_vector;
  692|  7.08k|    igraph_int_t newlen = igraph_vector_int_list_size(merges);
  693|       |
  694|   120k|    for (igraph_int_t i = 0; i < newlen; i++) {
  ------------------
  |  Branch (694:30): [True: 113k, False: 7.08k]
  ------------------
  695|   113k|        igraph_real_t s = 0.0;
  696|   113k|        const igraph_vector_int_t *idx = igraph_vector_int_list_get_ptr(merges, i);
  697|   113k|        igraph_int_t n = igraph_vector_int_size(idx);
  698|   242k|        for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (698:34): [True: 129k, False: 113k]
  ------------------
  699|   129k|            igraph_int_t x = VECTOR(*idx)[j];
  ------------------
  |  |   60|   129k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  700|   129k|            s += VECTOR(*oldv)[x];
  ------------------
  |  |   60|   129k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  701|   129k|        }
  702|   113k|        VECTOR(*newv)[i] = s;
  ------------------
  |  |   60|   113k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  703|   113k|    }
  704|       |
  705|  7.08k|    return IGRAPH_SUCCESS;
  706|  7.08k|}
cattributes.c:igraph_i_cattributes_cn_max:
  755|  3.54k|                                       const igraph_vector_int_list_t *merges) {
  756|  3.54k|    const igraph_vector_t *oldv = oldrec->value.as_vector;
  757|  3.54k|    igraph_vector_t *newv = newrec->value.as_vector;
  758|  3.54k|    igraph_int_t newlen = igraph_vector_int_list_size(merges);
  759|       |
  760|   157k|    for (igraph_int_t i = 0; i < newlen; i++) {
  ------------------
  |  Branch (760:30): [True: 153k, False: 3.54k]
  ------------------
  761|   153k|        const igraph_vector_int_t *idx = igraph_vector_int_list_get_ptr(merges, i);
  762|   153k|        igraph_int_t n = igraph_vector_int_size(idx);
  763|   153k|        igraph_real_t m = n > 0 ? VECTOR(*oldv)[ VECTOR(*idx)[0] ] : IGRAPH_NAN;
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      igraph_real_t m = n > 0 ? VECTOR(*oldv)[ VECTOR(*idx)[0] ] : IGRAPH_NAN;
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      igraph_real_t m = n > 0 ? VECTOR(*oldv)[ VECTOR(*idx)[0] ] : IGRAPH_NAN;
  ------------------
  |  |  138|      0|#define IGRAPH_NAN ((double)NAN)
  ------------------
  |  Branch (763:27): [True: 153k, False: 0]
  ------------------
  764|   154k|        for (igraph_int_t j = 1; j < n; j++) {
  ------------------
  |  Branch (764:34): [True: 1.49k, False: 153k]
  ------------------
  765|  1.49k|            igraph_int_t x = VECTOR(*idx)[j];
  ------------------
  |  |   60|  1.49k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  766|  1.49k|            igraph_real_t val = VECTOR(*oldv)[x];
  ------------------
  |  |   60|  1.49k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  767|  1.49k|            if (val > m) {
  ------------------
  |  Branch (767:17): [True: 626, False: 866]
  ------------------
  768|    626|                m = val;
  769|    626|            }
  770|  1.49k|        }
  771|   153k|        VECTOR(*newv)[i] = m;
  ------------------
  |  |   60|   153k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  772|   153k|    }
  773|       |
  774|  3.54k|    return IGRAPH_SUCCESS;
  775|  3.54k|}
cattributes.c:igraph_i_cattribute_add_edges:
 1463|  41.7k|) {
 1464|  41.7k|    igraph_int_t ne = igraph_vector_int_size(edges) / 2;
 1465|  41.7k|    igraph_i_cattributes_t *attr = graph->attr;
 1466|  41.7k|    return igraph_i_cattribute_add_vertices_or_edges(&attr->eal, igraph_ecount(graph), ne, nattr);
 1467|  41.7k|}
cattributes.c:igraph_i_cattribute_permute_edges:
 1471|   302k|                                             const igraph_vector_int_t *idx) {
 1472|   302k|    igraph_i_cattributes_t *attr = graph->attr, *new_attr = newgraph->attr;
 1473|   302k|    igraph_attribute_record_list_t *eal = &attr->eal, *new_eal = &new_attr->eal;
 1474|   302k|    if (graph == newgraph) {
  ------------------
  |  Branch (1474:9): [True: 0, False: 302k]
  ------------------
 1475|      0|        return igraph_i_cattribute_permute_attribute_record_list_in_place(eal, idx);
 1476|   302k|    } else {
 1477|   302k|        return igraph_i_cattribute_permute_attribute_record_list(eal, new_eal, idx);
 1478|   302k|    }
 1479|   302k|}
cattributes.c:igraph_i_cattribute_combine_edges:
 1484|  7.08k|) {
 1485|  7.08k|    igraph_i_cattributes_t *attr = graph->attr;
 1486|  7.08k|    igraph_i_cattributes_t *toattr = newgraph->attr;
 1487|  7.08k|    return igraph_i_cattribute_combine_attribute_record_lists(
 1488|  7.08k|        &attr->eal, &toattr->eal, merges, comb
 1489|  7.08k|    );
 1490|  7.08k|}
cattributes.c:igraph_i_cattribute_find_or_return:
  113|  7.08k|) {
  114|  7.08k|    igraph_attribute_record_t *rec;
  115|       |
  116|  7.08k|    rec = igraph_i_cattribute_find(attrs, name, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  117|  7.08k|    if (!rec) {
  ------------------
  |  Branch (117:9): [True: 0, False: 7.08k]
  ------------------
  118|      0|        IGRAPH_ERRORF("Attribute '%s' does not exist.", IGRAPH_EINVAL, name);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  119|      0|    }
  120|       |
  121|  7.08k|    if (type != IGRAPH_ATTRIBUTE_UNSPECIFIED) {
  ------------------
  |  Branch (121:9): [True: 7.08k, False: 0]
  ------------------
  122|  7.08k|        IGRAPH_CHECK(igraph_attribute_record_check_type(rec, type));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
  123|  7.08k|    }
  124|       |
  125|  7.08k|    if (ptr) {
  ------------------
  |  Branch (125:9): [True: 7.08k, False: 0]
  ------------------
  126|  7.08k|        *ptr = rec;
  127|  7.08k|    }
  128|       |
  129|  7.08k|    return IGRAPH_SUCCESS;
  130|  7.08k|}
cattributes.c:igraph_i_cattribute_get_numeric_edge_attr:
 1717|  7.08k|) {
 1718|  7.08k|    igraph_i_cattributes_t *attr = graph->attr;
 1719|  7.08k|    igraph_attribute_record_list_t *eal = &attr->eal;
 1720|  7.08k|    igraph_attribute_record_t *rec;
 1721|  7.08k|    const igraph_vector_t *num;
 1722|       |
 1723|  7.08k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_return(eal, name, IGRAPH_ATTRIBUTE_NUMERIC, &rec));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1724|       |
 1725|  7.08k|    num = rec->value.as_vector;
 1726|  7.08k|    if (igraph_es_is_all(&es)) {
  ------------------
  |  Branch (1726:9): [True: 7.08k, False: 0]
  ------------------
 1727|  7.08k|        IGRAPH_CHECK(igraph_vector_append(value, num));
  ------------------
  |  |  656|  7.08k|    do { \
  |  |  657|  7.08k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.08k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.08k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 1728|  7.08k|    } else {
 1729|      0|        igraph_eit_t it;
 1730|      0|        igraph_int_t i = igraph_vector_size(value);
 1731|      0|        IGRAPH_CHECK(igraph_eit_create(graph, es, &it));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1732|      0|        IGRAPH_FINALLY(igraph_eit_destroy, &it);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1733|      0|        IGRAPH_CHECK(igraph_vector_resize(value, i + IGRAPH_EIT_SIZE(it)));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1734|      0|        for (; !IGRAPH_EIT_END(it); IGRAPH_EIT_NEXT(it), i++) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                      for (; !IGRAPH_EIT_END(it); IGRAPH_EIT_NEXT(it), i++) {
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (1734:16): [True: 0, False: 0]
  ------------------
 1735|      0|            igraph_int_t e = IGRAPH_EIT_GET(it);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1736|      0|            VECTOR(*value)[i] = VECTOR(*num)[e];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*value)[i] = VECTOR(*num)[e];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1737|      0|        }
 1738|      0|        igraph_eit_destroy(&it);
 1739|      0|        IGRAPH_FINALLY_CLEAN(1);
 1740|      0|    }
 1741|       |
 1742|  7.08k|    return IGRAPH_SUCCESS;
 1743|  7.08k|}
cattributes.c:igraph_i_cattribute_find:
   69|   620k|) {
   70|   620k|    igraph_int_t index = igraph_i_cattribute_find_index(attrs, name);
   71|   620k|    igraph_attribute_record_t *rec;
   72|       |
   73|   620k|    if (index >= 0) {
  ------------------
  |  Branch (73:9): [True: 7.08k, False: 612k]
  ------------------
   74|  7.08k|        rec = igraph_attribute_record_list_get_ptr(attrs, index);
   75|  7.08k|        if (type == IGRAPH_ATTRIBUTE_UNSPECIFIED || type == rec->type) {
  ------------------
  |  Branch (75:13): [True: 7.08k, False: 0]
  |  Branch (75:53): [True: 0, False: 0]
  ------------------
   76|  7.08k|            return rec;
   77|  7.08k|        }
   78|  7.08k|    }
   79|       |
   80|   612k|    return NULL;
   81|   620k|}
cattributes.c:igraph_i_cattribute_find_or_create:
  147|   612k|) {
  148|   612k|    igraph_attribute_record_t *rec;
  149|       |
  150|   612k|    rec = igraph_i_cattribute_find(attrs, name, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  151|   612k|    if (rec) {
  ------------------
  |  Branch (151:9): [True: 0, False: 612k]
  ------------------
  152|      0|        if (type != IGRAPH_ATTRIBUTE_UNSPECIFIED) {
  ------------------
  |  Branch (152:13): [True: 0, False: 0]
  ------------------
  153|      0|            IGRAPH_CHECK(igraph_attribute_record_check_type(rec, type));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|      0|        }
  155|   612k|    } else {
  156|   612k|        IGRAPH_CHECK(igraph_attribute_record_list_push_back_new(attrs, &rec));
  ------------------
  |  |  656|   612k|    do { \
  |  |  657|   612k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   612k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   612k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   612k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 612k]
  |  |  ------------------
  ------------------
  157|   612k|        IGRAPH_CHECK(igraph_attribute_record_set_name(rec, name));
  ------------------
  |  |  656|   612k|    do { \
  |  |  657|   612k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   612k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   612k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   612k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 612k]
  |  |  ------------------
  ------------------
  158|   612k|        IGRAPH_CHECK(igraph_attribute_record_set_type(rec, type));
  ------------------
  |  |  656|   612k|    do { \
  |  |  657|   612k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   612k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   612k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   612k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 612k]
  |  |  ------------------
  ------------------
  159|   612k|    }
  160|       |
  161|   612k|    if (length > 0 && igraph_attribute_record_size(rec) < length) {
  ------------------
  |  Branch (161:9): [True: 317k, False: 295k]
  |  Branch (161:23): [True: 317k, False: 0]
  ------------------
  162|   317k|        IGRAPH_CHECK(igraph_attribute_record_resize(rec, length));
  ------------------
  |  |  656|   317k|    do { \
  |  |  657|   317k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   317k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   317k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 317k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   317k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 317k]
  |  |  ------------------
  ------------------
  163|   317k|    }
  164|       |
  165|   612k|    if (ptr) {
  ------------------
  |  Branch (165:9): [True: 612k, False: 0]
  ------------------
  166|   612k|        *ptr = rec;
  167|   612k|    }
  168|       |
  169|   612k|    return IGRAPH_SUCCESS;
  170|   612k|}
cattributes.c:igraph_i_cattribute_find_index:
   49|   620k|) {
   50|   620k|    igraph_int_t n = igraph_attribute_record_list_size(attrs);
   51|   620k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (51:30): [True: 7.08k, False: 612k]
  ------------------
   52|  7.08k|        const igraph_attribute_record_t *rec = igraph_attribute_record_list_get_ptr(attrs, i);
   53|  7.08k|        if (!strcmp(rec->name, name)) {
  ------------------
  |  Branch (53:13): [True: 7.08k, False: 0]
  ------------------
   54|  7.08k|            return i;
   55|  7.08k|        }
   56|  7.08k|    }
   57|   612k|    return -1;
   58|   620k|}

igraph_vss_all:
  115|  69.4k|igraph_vs_t igraph_vss_all(void) {
  116|  69.4k|    igraph_vs_t allvs;
  117|  69.4k|    allvs.type = IGRAPH_VS_ALL;
  118|  69.4k|    return allvs;
  119|  69.4k|}
igraph_vss_vector:
  344|   303k|igraph_vs_t igraph_vss_vector(const igraph_vector_int_t *v) {
  345|   303k|    igraph_vs_t vecvs;
  346|   303k|    vecvs.type = IGRAPH_VS_VECTORPTR;
  347|   303k|    vecvs.data.vecptr = v;
  348|   303k|    return vecvs;
  349|   303k|}
igraph_vs_is_all:
  544|   317k|igraph_bool_t igraph_vs_is_all(const igraph_vs_t *vs) {
  545|   317k|    return vs->type == IGRAPH_VS_ALL;
  546|   317k|}
igraph_vs_size:
  611|   302k|                   igraph_int_t *result) {
  612|   302k|    igraph_vector_int_t vec;
  613|   302k|    igraph_bool_t *seen;
  614|   302k|    igraph_int_t i;
  615|   302k|    igraph_int_t vec_len;
  616|       |
  617|   302k|    switch (vs->type) {
  ------------------
  |  Branch (617:13): [True: 302k, False: 0]
  ------------------
  618|      0|    case IGRAPH_VS_NONE:
  ------------------
  |  Branch (618:5): [True: 0, False: 302k]
  ------------------
  619|      0|        *result = 0; return IGRAPH_SUCCESS;
  620|       |
  621|      0|    case IGRAPH_VS_1:
  ------------------
  |  Branch (621:5): [True: 0, False: 302k]
  ------------------
  622|      0|        *result = 0;
  623|      0|        if (vs->data.vid < igraph_vcount(graph) && vs->data.vid >= 0) {
  ------------------
  |  Branch (623:13): [True: 0, False: 0]
  |  Branch (623:52): [True: 0, False: 0]
  ------------------
  624|      0|            *result = 1;
  625|      0|        }
  626|      0|        return IGRAPH_SUCCESS;
  627|       |
  628|      0|    case IGRAPH_VS_RANGE:
  ------------------
  |  Branch (628:5): [True: 0, False: 302k]
  ------------------
  629|      0|        *result = vs->data.range.end - vs->data.range.start;
  630|      0|        return IGRAPH_SUCCESS;
  631|       |
  632|      0|    case IGRAPH_VS_ALL:
  ------------------
  |  Branch (632:5): [True: 0, False: 302k]
  ------------------
  633|      0|        *result = igraph_vcount(graph); return IGRAPH_SUCCESS;
  634|       |
  635|      0|    case IGRAPH_VS_ADJ:
  ------------------
  |  Branch (635:5): [True: 0, False: 302k]
  ------------------
  636|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vec, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  637|      0|        IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  638|      0|            graph, &vec, vs->data.adj.vid, vs->data.adj.mode,
  639|      0|            vs->data.adj.loops, vs->data.adj.multiple
  640|      0|        ));
  641|      0|        *result = igraph_vector_int_size(&vec);
  642|      0|        igraph_vector_int_destroy(&vec);
  643|      0|        IGRAPH_FINALLY_CLEAN(1);
  644|      0|        return IGRAPH_SUCCESS;
  645|       |
  646|      0|    case IGRAPH_VS_NONADJ:
  ------------------
  |  Branch (646:5): [True: 0, False: 302k]
  ------------------
  647|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vec, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  648|      0|        IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  649|      0|            graph, &vec, vs->data.adj.vid, vs->data.adj.mode,
  650|      0|            vs->data.adj.loops, vs->data.adj.multiple
  651|      0|        ));
  652|      0|        vec_len = igraph_vector_int_size(&vec);
  653|      0|        *result = igraph_vcount(graph);
  654|      0|        seen = IGRAPH_CALLOC(*result, igraph_bool_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  655|      0|        IGRAPH_CHECK_OOM(seen, "Cannot calculate vertex selector length.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  656|      0|        IGRAPH_FINALLY(igraph_free, seen);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  657|      0|        for (i = 0; i < vec_len; i++) {
  ------------------
  |  Branch (657:21): [True: 0, False: 0]
  ------------------
  658|      0|            if (!seen[ VECTOR(vec)[i] ]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|                (*result)--;
  660|      0|                seen[ VECTOR(vec)[i] ] = true;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  661|      0|            }
  662|      0|        }
  663|      0|        igraph_free(seen);
  664|      0|        igraph_vector_int_destroy(&vec);
  665|      0|        IGRAPH_FINALLY_CLEAN(2);
  666|      0|        return IGRAPH_SUCCESS;
  667|       |
  668|      0|    case IGRAPH_VS_VECTOR:
  ------------------
  |  Branch (668:5): [True: 0, False: 302k]
  ------------------
  669|   302k|    case IGRAPH_VS_VECTORPTR:
  ------------------
  |  Branch (669:5): [True: 302k, False: 0]
  ------------------
  670|   302k|        *result = igraph_vector_int_size(vs->data.vecptr);
  671|   302k|        return IGRAPH_SUCCESS;
  672|   302k|    }
  673|       |
  674|      0|    IGRAPH_ERROR("Cannot calculate selector length, invalid selector type.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  675|      0|                 IGRAPH_EINVAL);
  676|      0|}
igraph_vit_create:
  712|   358k|igraph_error_t igraph_vit_create(const igraph_t *graph, igraph_vs_t vs, igraph_vit_t *vit) {
  713|   358k|    igraph_vector_int_t vec;
  714|   358k|    igraph_vector_int_t *vec_int;
  715|   358k|    igraph_bool_t *seen;
  716|   358k|    igraph_int_t i, j, n;
  717|   358k|    igraph_int_t vec_len;
  718|       |
  719|   358k|    switch (vs.type) {
  720|  55.3k|    case IGRAPH_VS_ALL:
  ------------------
  |  Branch (720:5): [True: 55.3k, False: 303k]
  ------------------
  721|  55.3k|        vit->type = IGRAPH_VIT_RANGE;
  722|  55.3k|        vit->pos = 0;
  723|  55.3k|        vit->start = 0;
  724|  55.3k|        vit->end = igraph_vcount(graph);
  725|  55.3k|        break;
  726|      0|    case IGRAPH_VS_ADJ:
  ------------------
  |  Branch (726:5): [True: 0, False: 358k]
  ------------------
  727|      0|        vec_int = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|      0|        IGRAPH_CHECK_OOM(vec_int, "Cannot create vertex iterator.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  729|      0|        IGRAPH_FINALLY(igraph_free, vec_int);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  730|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(vec_int, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  731|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vec, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  732|      0|        IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  733|      0|            graph, &vec, vs.data.adj.vid, vs.data.adj.mode,
  734|      0|            vs.data.adj.loops, vs.data.adj.multiple
  735|      0|        ));
  736|      0|        n = igraph_vector_int_size(&vec);
  737|      0|        IGRAPH_CHECK(igraph_vector_int_resize(vec_int, n));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  738|      0|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (738:21): [True: 0, False: 0]
  ------------------
  739|      0|            VECTOR(*vec_int)[i] = VECTOR(vec)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*vec_int)[i] = VECTOR(vec)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  740|      0|        }
  741|       |
  742|      0|        igraph_vector_int_destroy(&vec);
  743|      0|        IGRAPH_FINALLY_CLEAN(3);
  744|       |
  745|      0|        vit->type = IGRAPH_VIT_VECTOR;
  746|      0|        vit->pos = 0;
  747|      0|        vit->start = 0;
  748|      0|        vit->vec = vec_int;
  749|      0|        vit->end = n;
  750|       |
  751|      0|        break;
  752|      0|    case IGRAPH_VS_NONADJ:
  ------------------
  |  Branch (752:5): [True: 0, False: 358k]
  ------------------
  753|      0|        vec_int = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|      0|        IGRAPH_CHECK_OOM(vec_int, "Cannot create vertex iterator.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  755|      0|        IGRAPH_FINALLY(igraph_free, vec_int);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  756|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(vec_int, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  757|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vec, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  758|      0|        IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  759|      0|            graph, &vec, vs.data.adj.vid, vs.data.adj.mode,
  760|      0|            vs.data.adj.loops, vs.data.adj.multiple
  761|      0|        ));
  762|      0|        vec_len = igraph_vector_int_size(&vec);
  763|      0|        n = igraph_vcount(graph);
  764|      0|        seen = IGRAPH_CALLOC(n, igraph_bool_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|      0|        IGRAPH_CHECK_OOM(seen, "Cannot create vertex iterator.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  766|      0|        IGRAPH_FINALLY(igraph_free, seen);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  767|      0|        for (i = 0; i < vec_len; i++) {
  ------------------
  |  Branch (767:21): [True: 0, False: 0]
  ------------------
  768|      0|            if (! seen [ VECTOR(vec)[i] ] ) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (768:17): [True: 0, False: 0]
  ------------------
  769|      0|                n--;
  770|      0|                seen[ VECTOR(vec)[i] ] = true;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  771|      0|            }
  772|      0|        }
  773|      0|        IGRAPH_CHECK(igraph_vector_int_resize(vec_int, n));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  774|      0|        for (i = 0, j = 0; j < n; i++) {
  ------------------
  |  Branch (774:28): [True: 0, False: 0]
  ------------------
  775|      0|            if (!seen[i]) {
  ------------------
  |  Branch (775:17): [True: 0, False: 0]
  ------------------
  776|      0|                VECTOR(*vec_int)[j++] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  777|      0|            }
  778|      0|        }
  779|       |
  780|      0|        IGRAPH_FREE(seen);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  781|      0|        igraph_vector_int_destroy(&vec);
  782|      0|        IGRAPH_FINALLY_CLEAN(4);
  783|       |
  784|      0|        vit->type = IGRAPH_VIT_VECTOR;
  785|      0|        vit->pos = 0;
  786|      0|        vit->start = 0;
  787|      0|        vit->vec = vec_int;
  788|      0|        vit->end = n;
  789|      0|        break;
  790|      0|    case IGRAPH_VS_NONE:
  ------------------
  |  Branch (790:5): [True: 0, False: 358k]
  ------------------
  791|      0|        vit->type = IGRAPH_VIT_RANGE;
  792|      0|        vit->pos = 0;
  793|      0|        vit->start = 0;
  794|      0|        vit->end = 0;
  795|      0|        break;
  796|      0|    case IGRAPH_VS_1:
  ------------------
  |  Branch (796:5): [True: 0, False: 358k]
  ------------------
  797|      0|        if (vs.data.vid < 0 || vs.data.vid >= igraph_vcount(graph)) {
  ------------------
  |  Branch (797:13): [True: 0, False: 0]
  |  Branch (797:32): [True: 0, False: 0]
  ------------------
  798|      0|            IGRAPH_ERROR("Cannot create iterator, invalid vertex ID.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  799|      0|        }
  800|      0|        vit->type = IGRAPH_VIT_RANGE;
  801|      0|        vit->pos = vs.data.vid;
  802|      0|        vit->start = vs.data.vid;
  803|      0|        vit->end = vs.data.vid + 1;
  804|      0|        break;
  805|   303k|    case IGRAPH_VS_VECTORPTR:
  ------------------
  |  Branch (805:5): [True: 303k, False: 55.3k]
  ------------------
  806|   303k|    case IGRAPH_VS_VECTOR:
  ------------------
  |  Branch (806:5): [True: 0, False: 358k]
  ------------------
  807|   303k|        vit->type = IGRAPH_VIT_VECTORPTR;
  808|   303k|        vit->pos = 0;
  809|   303k|        vit->start = 0;
  810|   303k|        vit->vec = vs.data.vecptr;
  811|   303k|        vit->end = igraph_vector_int_size(vit->vec);
  812|   303k|        if (!igraph_vector_int_isininterval(vit->vec, 0, igraph_vcount(graph) - 1)) {
  ------------------
  |  Branch (812:13): [True: 0, False: 303k]
  ------------------
  813|      0|            IGRAPH_ERROR("Cannot create iterator, invalid vertex ID.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  814|      0|        }
  815|   303k|        break;
  816|   303k|    case IGRAPH_VS_RANGE:
  ------------------
  |  Branch (816:5): [True: 0, False: 358k]
  ------------------
  817|      0|        {
  818|      0|            igraph_int_t no_of_nodes = igraph_vcount(graph);
  819|      0|            if (vs.data.range.start < 0 ||
  ------------------
  |  Branch (819:17): [True: 0, False: 0]
  ------------------
  820|      0|                vs.data.range.start > no_of_nodes ||
  ------------------
  |  Branch (820:17): [True: 0, False: 0]
  ------------------
  821|      0|                (no_of_nodes > 0 && vs.data.range.start == no_of_nodes)) {
  ------------------
  |  Branch (821:18): [True: 0, False: 0]
  |  Branch (821:37): [True: 0, False: 0]
  ------------------
  822|      0|                IGRAPH_ERROR("Cannot create range iterator, starting vertex ID out of range.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  823|      0|            }
  824|      0|            if (vs.data.range.end < 0 || vs.data.range.end > no_of_nodes) {
  ------------------
  |  Branch (824:17): [True: 0, False: 0]
  |  Branch (824:42): [True: 0, False: 0]
  ------------------
  825|      0|                IGRAPH_ERROR("Cannot create range iterator, ending vertex ID out of range.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  826|      0|            }
  827|      0|        }
  828|      0|        vit->type = IGRAPH_VIT_RANGE;
  829|      0|        vit->pos = vs.data.range.start;
  830|      0|        vit->start = vs.data.range.start;
  831|      0|        vit->end = vs.data.range.end;
  832|      0|        break;
  833|      0|    default:
  ------------------
  |  Branch (833:5): [True: 0, False: 358k]
  ------------------
  834|      0|        IGRAPH_ERROR("Cannot create iterator, invalid selector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  835|      0|        break;
  836|   358k|    }
  837|   358k|    return IGRAPH_SUCCESS;
  838|   358k|}
igraph_vit_destroy:
  853|   358k|void igraph_vit_destroy(const igraph_vit_t *vit) {
  854|   358k|    switch (vit->type) {
  855|  55.3k|    case IGRAPH_VIT_RANGE:
  ------------------
  |  Branch (855:5): [True: 55.3k, False: 303k]
  ------------------
  856|   358k|    case IGRAPH_VIT_VECTORPTR:
  ------------------
  |  Branch (856:5): [True: 303k, False: 55.3k]
  ------------------
  857|   358k|        break;
  858|      0|    case IGRAPH_VIT_VECTOR:
  ------------------
  |  Branch (858:5): [True: 0, False: 358k]
  ------------------
  859|      0|        igraph_vector_int_destroy((igraph_vector_int_t*) vit->vec);
  860|      0|        igraph_free((igraph_vector_int_t*) vit->vec);
  861|      0|        break;
  862|      0|    default:
  ------------------
  |  Branch (862:5): [True: 0, False: 358k]
  ------------------
  863|       |        /*     IGRAPH_ERROR("Cannot destroy iterator, unknown type", IGRAPH_EINVAL); */
  864|      0|        break;
  865|   358k|    }
  866|   358k|}
igraph_vit_as_vector:
  868|   302k|igraph_error_t igraph_vit_as_vector(const igraph_vit_t *vit, igraph_vector_int_t *v) {
  869|   302k|    igraph_int_t i;
  870|       |
  871|   302k|    IGRAPH_CHECK(igraph_vector_int_resize(v, IGRAPH_VIT_SIZE(*vit)));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  872|       |
  873|   302k|    switch (vit->type) {
  874|      0|    case IGRAPH_VIT_RANGE:
  ------------------
  |  Branch (874:5): [True: 0, False: 302k]
  ------------------
  875|      0|        for (i = 0; i < IGRAPH_VIT_SIZE(*vit); i++) {
  ------------------
  |  |  190|      0|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
  |  Branch (875:21): [True: 0, False: 0]
  ------------------
  876|      0|            VECTOR(*v)[i] = vit->start + i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  877|      0|        }
  878|      0|        break;
  879|      0|    case IGRAPH_VIT_VECTOR:
  ------------------
  |  Branch (879:5): [True: 0, False: 302k]
  ------------------
  880|   302k|    case IGRAPH_VIT_VECTORPTR:
  ------------------
  |  Branch (880:5): [True: 302k, False: 0]
  ------------------
  881|   611k|        for (i = 0; i < IGRAPH_VIT_SIZE(*vit); i++) {
  ------------------
  |  |  190|   611k|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
  |  Branch (881:21): [True: 308k, False: 302k]
  ------------------
  882|   308k|            VECTOR(*v)[i] = VECTOR(*vit->vec)[i];
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*v)[i] = VECTOR(*vit->vec)[i];
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  883|   308k|        }
  884|   302k|        break;
  885|      0|    default:
  ------------------
  |  Branch (885:5): [True: 0, False: 302k]
  ------------------
  886|      0|        IGRAPH_ERROR("Cannot convert to vector, unknown iterator type.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  887|      0|                     IGRAPH_EINVAL);
  888|      0|        break;
  889|   302k|    }
  890|       |
  891|   302k|    return IGRAPH_SUCCESS;
  892|   302k|}
igraph_es_all:
  921|  28.9k|                  igraph_edgeorder_type_t order) {
  922|  28.9k|    switch (order) {
  923|  25.4k|    case IGRAPH_EDGEORDER_ID:
  ------------------
  |  Branch (923:5): [True: 25.4k, False: 3.54k]
  ------------------
  924|  25.4k|        es->type = IGRAPH_ES_ALL;
  925|  25.4k|        break;
  926|  3.54k|    case IGRAPH_EDGEORDER_FROM:
  ------------------
  |  Branch (926:5): [True: 3.54k, False: 25.4k]
  ------------------
  927|  3.54k|        es->type = IGRAPH_ES_ALLFROM;
  928|  3.54k|        break;
  929|      0|    case IGRAPH_EDGEORDER_TO:
  ------------------
  |  Branch (929:5): [True: 0, False: 28.9k]
  ------------------
  930|      0|        es->type = IGRAPH_ES_ALLTO;
  931|      0|        break;
  932|      0|    default:
  ------------------
  |  Branch (932:5): [True: 0, False: 28.9k]
  ------------------
  933|      0|        IGRAPH_ERROR("Invalid edge order, cannot create selector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  934|      0|        break;
  935|  28.9k|    }
  936|  28.9k|    return IGRAPH_SUCCESS;
  937|  28.9k|}
igraph_ess_all:
  953|  25.4k|igraph_es_t igraph_ess_all(igraph_edgeorder_type_t order) {
  954|  25.4k|    igraph_es_t es;
  955|  25.4k|    igraph_es_all(&es, order); /* cannot fail */
  956|  25.4k|    return es;
  957|  25.4k|}
igraph_es_destroy:
 1408|  3.54k|void igraph_es_destroy(igraph_es_t *es) {
 1409|  3.54k|    switch (es->type) {
 1410|      0|    case IGRAPH_ES_ALL:
  ------------------
  |  Branch (1410:5): [True: 0, False: 3.54k]
  ------------------
 1411|  3.54k|    case IGRAPH_ES_ALLFROM:
  ------------------
  |  Branch (1411:5): [True: 3.54k, False: 0]
  ------------------
 1412|  3.54k|    case IGRAPH_ES_ALLTO:
  ------------------
  |  Branch (1412:5): [True: 0, False: 3.54k]
  ------------------
 1413|  3.54k|    case IGRAPH_ES_INCIDENT:
  ------------------
  |  Branch (1413:5): [True: 0, False: 3.54k]
  ------------------
 1414|  3.54k|    case IGRAPH_ES_NONE:
  ------------------
  |  Branch (1414:5): [True: 0, False: 3.54k]
  ------------------
 1415|  3.54k|    case IGRAPH_ES_1:
  ------------------
  |  Branch (1415:5): [True: 0, False: 3.54k]
  ------------------
 1416|  3.54k|    case IGRAPH_ES_VECTORPTR:
  ------------------
  |  Branch (1416:5): [True: 0, False: 3.54k]
  ------------------
 1417|  3.54k|    case IGRAPH_ES_RANGE:
  ------------------
  |  Branch (1417:5): [True: 0, False: 3.54k]
  ------------------
 1418|  3.54k|    case IGRAPH_ES_ALL_BETWEEN:
  ------------------
  |  Branch (1418:5): [True: 0, False: 3.54k]
  ------------------
 1419|  3.54k|        break;
 1420|      0|    case IGRAPH_ES_VECTOR:
  ------------------
  |  Branch (1420:5): [True: 0, False: 3.54k]
  ------------------
 1421|      0|        igraph_vector_int_destroy((igraph_vector_int_t*)es->data.vecptr);
 1422|      0|        IGRAPH_FREE(es->data.vecptr);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1423|      0|        break;
 1424|      0|    case IGRAPH_ES_PAIRS:
  ------------------
  |  Branch (1424:5): [True: 0, False: 3.54k]
  ------------------
 1425|      0|    case IGRAPH_ES_PATH:
  ------------------
  |  Branch (1425:5): [True: 0, False: 3.54k]
  ------------------
 1426|      0|        igraph_vector_int_destroy((igraph_vector_int_t*)es->data.path.ptr);
 1427|      0|        IGRAPH_FREE(es->data.path.ptr);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1428|      0|        break;
 1429|      0|    default:
  ------------------
  |  Branch (1429:5): [True: 0, False: 3.54k]
  ------------------
 1430|      0|        break;
 1431|  3.54k|    }
 1432|  3.54k|}
igraph_es_is_all:
 1445|  10.5k|igraph_bool_t igraph_es_is_all(const igraph_es_t *es) {
 1446|  10.5k|    return es->type == IGRAPH_ES_ALL;
 1447|  10.5k|}
igraph_eit_create:
 1922|  21.8k|igraph_error_t igraph_eit_create(const igraph_t *graph, igraph_es_t es, igraph_eit_t *eit) {
 1923|  21.8k|    switch (es.type) {
 1924|  18.3k|    case IGRAPH_ES_ALL:
  ------------------
  |  Branch (1924:5): [True: 18.3k, False: 3.54k]
  ------------------
 1925|  18.3k|        eit->type = IGRAPH_EIT_RANGE;
 1926|  18.3k|        eit->pos = 0;
 1927|  18.3k|        eit->start = 0;
 1928|  18.3k|        eit->end = igraph_ecount(graph);
 1929|  18.3k|        break;
 1930|  3.54k|    case IGRAPH_ES_ALLFROM:
  ------------------
  |  Branch (1930:5): [True: 3.54k, False: 18.3k]
  ------------------
 1931|  3.54k|        IGRAPH_CHECK(igraph_i_eit_create_allfromto(graph, eit, IGRAPH_OUT));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1932|  3.54k|        break;
 1933|  3.54k|    case IGRAPH_ES_ALLTO:
  ------------------
  |  Branch (1933:5): [True: 0, False: 21.8k]
  ------------------
 1934|      0|        IGRAPH_CHECK(igraph_i_eit_create_allfromto(graph, eit, IGRAPH_IN));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1935|      0|        break;
 1936|      0|    case IGRAPH_ES_INCIDENT:
  ------------------
  |  Branch (1936:5): [True: 0, False: 21.8k]
  ------------------
 1937|      0|        IGRAPH_CHECK(igraph_i_eit_create_incident(graph, es, eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1938|      0|        break;
 1939|      0|    case IGRAPH_ES_NONE:
  ------------------
  |  Branch (1939:5): [True: 0, False: 21.8k]
  ------------------
 1940|      0|        eit->type = IGRAPH_EIT_RANGE;
 1941|      0|        eit->pos = 0;
 1942|      0|        eit->start = 0;
 1943|      0|        eit->end = 0;
 1944|      0|        break;
 1945|      0|    case IGRAPH_ES_1:
  ------------------
  |  Branch (1945:5): [True: 0, False: 21.8k]
  ------------------
 1946|      0|        if (es.data.eid < 0 || es.data.eid >= igraph_ecount(graph)) {
  ------------------
  |  Branch (1946:13): [True: 0, False: 0]
  |  Branch (1946:32): [True: 0, False: 0]
  ------------------
 1947|      0|            IGRAPH_ERROR("Cannot create iterator, invalid edge ID.", IGRAPH_EINVEID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1948|      0|        }
 1949|      0|        eit->type = IGRAPH_EIT_RANGE;
 1950|      0|        eit->pos = es.data.eid;
 1951|      0|        eit->start = es.data.eid;
 1952|      0|        eit->end = es.data.eid + 1;
 1953|      0|        break;
 1954|      0|    case IGRAPH_ES_VECTOR:
  ------------------
  |  Branch (1954:5): [True: 0, False: 21.8k]
  ------------------
 1955|      0|    case IGRAPH_ES_VECTORPTR:
  ------------------
  |  Branch (1955:5): [True: 0, False: 21.8k]
  ------------------
 1956|      0|        eit->type = IGRAPH_EIT_VECTORPTR;
 1957|      0|        eit->pos = 0;
 1958|      0|        eit->start = 0;
 1959|      0|        eit->vec = es.data.vecptr;
 1960|      0|        eit->end = igraph_vector_int_size(eit->vec);
 1961|      0|        if (!igraph_vector_int_isininterval(eit->vec, 0, igraph_ecount(graph) - 1)) {
  ------------------
  |  Branch (1961:13): [True: 0, False: 0]
  ------------------
 1962|      0|            IGRAPH_ERROR("Cannot create iterator.", IGRAPH_EINVEID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1963|      0|        }
 1964|      0|        break;
 1965|      0|    case IGRAPH_ES_RANGE:
  ------------------
  |  Branch (1965:5): [True: 0, False: 21.8k]
  ------------------
 1966|      0|        {
 1967|      0|            igraph_int_t no_of_edges = igraph_ecount(graph);
 1968|      0|            if (es.data.range.start < 0 ||
  ------------------
  |  Branch (1968:17): [True: 0, False: 0]
  ------------------
 1969|      0|                es.data.range.start > no_of_edges ||
  ------------------
  |  Branch (1969:17): [True: 0, False: 0]
  ------------------
 1970|      0|                (no_of_edges > 0 && es.data.range.start == no_of_edges)) {
  ------------------
  |  Branch (1970:18): [True: 0, False: 0]
  |  Branch (1970:37): [True: 0, False: 0]
  ------------------
 1971|      0|                IGRAPH_ERROR("Cannot create range iterator, starting edge ID out of range.", IGRAPH_EINVEID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1972|      0|            }
 1973|      0|            if (es.data.range.end < 0 || es.data.range.end > no_of_edges) {
  ------------------
  |  Branch (1973:17): [True: 0, False: 0]
  |  Branch (1973:42): [True: 0, False: 0]
  ------------------
 1974|      0|                IGRAPH_ERROR("Cannot create range iterator, ending edge ID out of range.", IGRAPH_EINVEID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1975|      0|            }
 1976|      0|        }
 1977|      0|        eit->type = IGRAPH_EIT_RANGE;
 1978|      0|        eit->pos = es.data.range.start;
 1979|      0|        eit->start = es.data.range.start;
 1980|      0|        eit->end = es.data.range.end;
 1981|      0|        break;
 1982|      0|    case IGRAPH_ES_PAIRS:
  ------------------
  |  Branch (1982:5): [True: 0, False: 21.8k]
  ------------------
 1983|      0|        IGRAPH_CHECK(igraph_i_eit_pairs(graph, es, eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1984|      0|        break;
 1985|      0|    case IGRAPH_ES_PATH:
  ------------------
  |  Branch (1985:5): [True: 0, False: 21.8k]
  ------------------
 1986|      0|        IGRAPH_CHECK(igraph_i_eit_path(graph, es, eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1987|      0|        break;
 1988|      0|    case IGRAPH_ES_ALL_BETWEEN:
  ------------------
  |  Branch (1988:5): [True: 0, False: 21.8k]
  ------------------
 1989|      0|        IGRAPH_CHECK(igraph_i_eit_all_between(graph, es, eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1990|      0|        break;
 1991|      0|    default:
  ------------------
  |  Branch (1991:5): [True: 0, False: 21.8k]
  ------------------
 1992|      0|        IGRAPH_ERROR("Cannot create iterator, invalid selector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1993|      0|        break;
 1994|  21.8k|    }
 1995|  21.8k|    return IGRAPH_SUCCESS;
 1996|  21.8k|}
igraph_eit_destroy:
 2008|  21.8k|void igraph_eit_destroy(const igraph_eit_t *eit) {
 2009|  21.8k|    switch (eit->type) {
 2010|  18.3k|    case IGRAPH_EIT_RANGE:
  ------------------
  |  Branch (2010:5): [True: 18.3k, False: 3.54k]
  ------------------
 2011|  18.3k|    case IGRAPH_EIT_VECTORPTR:
  ------------------
  |  Branch (2011:5): [True: 0, False: 21.8k]
  ------------------
 2012|  18.3k|        break;
 2013|  3.54k|    case IGRAPH_EIT_VECTOR:
  ------------------
  |  Branch (2013:5): [True: 3.54k, False: 18.3k]
  ------------------
 2014|  3.54k|        igraph_vector_int_destroy((igraph_vector_int_t*)eit->vec);
 2015|  3.54k|        igraph_free((igraph_vector_int_t*)eit->vec);
 2016|  3.54k|        break;
 2017|      0|    default:
  ------------------
  |  Branch (2017:5): [True: 0, False: 21.8k]
  ------------------
 2018|       |        /*     IGRAPH_ERROR("Cannot destroy iterator, unknown type", IGRAPH_EINVAL); */
 2019|      0|        break;
 2020|  21.8k|    }
 2021|  21.8k|}
iterators.c:igraph_i_eit_create_allfromto:
 1696|  3.54k|                                         igraph_neimode_t mode) {
 1697|  3.54k|    igraph_vector_int_t *vec;
 1698|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
 1699|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
 1700|       |
 1701|  3.54k|    vec = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|  3.54k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  7.08k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 3.54k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1702|  3.54k|    IGRAPH_CHECK_OOM(vec, "Cannot create edge iterator.");
  ------------------
  |  |  709|  3.54k|    do { \
  |  |  710|  3.54k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1703|  3.54k|    IGRAPH_FINALLY(igraph_free, vec);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1704|       |
 1705|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(vec, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1706|  3.54k|    IGRAPH_CHECK(igraph_vector_int_reserve(vec, no_of_edges));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1707|       |
 1708|  3.54k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (1708:9): [True: 3.54k, False: 0]
  ------------------
 1709|  3.54k|        igraph_vector_int_t adj;
 1710|  3.54k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&adj, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 1711|   158k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (1711:34): [True: 154k, False: 3.54k]
  ------------------
 1712|   154k|            IGRAPH_CHECK(igraph_incident(graph, &adj, i, mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
 1713|   154k|            igraph_vector_int_append(vec, &adj);  /* reserved */
 1714|   154k|        }
 1715|  3.54k|        igraph_vector_int_destroy(&adj);
 1716|  3.54k|        IGRAPH_FINALLY_CLEAN(1);
 1717|  3.54k|    } else {
 1718|      0|        igraph_vector_int_t adj;
 1719|      0|        igraph_bool_t *added;
 1720|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&adj, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1721|      0|        added = IGRAPH_CALLOC(no_of_edges, igraph_bool_t);
  ------------------
  |  |   33|      0|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|      0|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 0, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1722|      0|        IGRAPH_CHECK_OOM(added, "Cannot create edge iterator.");
  ------------------
  |  |  709|      0|    do { \
  |  |  710|      0|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1723|      0|        IGRAPH_FINALLY(igraph_free, added);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1724|      0|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (1724:34): [True: 0, False: 0]
  ------------------
 1725|      0|            IGRAPH_CHECK(igraph_incident(graph, &adj, i, IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1726|      0|            const igraph_int_t length = igraph_vector_int_size(&adj);
 1727|      0|            for (igraph_int_t j = 0; j < length; j++) {
  ------------------
  |  Branch (1727:38): [True: 0, False: 0]
  ------------------
 1728|      0|                if (!added[ VECTOR(adj)[j] ]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1728:21): [True: 0, False: 0]
  ------------------
 1729|      0|                    igraph_vector_int_push_back(vec, VECTOR(adj)[j]);  /* reserved */
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1730|      0|                    added[ VECTOR(adj)[j] ] = true;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1731|      0|                }
 1732|      0|            }
 1733|      0|        }
 1734|      0|        igraph_vector_int_destroy(&adj);
 1735|      0|        IGRAPH_FREE(added);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1736|      0|        IGRAPH_FINALLY_CLEAN(2);
 1737|      0|    }
 1738|       |
 1739|  3.54k|    eit->type = IGRAPH_EIT_VECTOR;
 1740|  3.54k|    eit->pos = 0;
 1741|  3.54k|    eit->start = 0;
 1742|  3.54k|    eit->vec = vec;
 1743|  3.54k|    eit->end = igraph_vector_int_size(eit->vec);
 1744|       |
 1745|  3.54k|    IGRAPH_FINALLY_CLEAN(2);
 1746|  3.54k|    return IGRAPH_SUCCESS;
 1747|  3.54k|}

igraph_empty:
   64|   352k|igraph_error_t igraph_empty(igraph_t *graph, igraph_int_t n, igraph_bool_t directed) {
   65|   352k|    return igraph_empty_attrs(graph, n, directed, 0);
   66|   352k|}
igraph_edge:
  132|  96.0k|) {
  133|       |
  134|  96.0k|    if (eid < 0 || eid >= igraph_ecount(graph)) {
  ------------------
  |  Branch (134:9): [True: 0, False: 96.0k]
  |  Branch (134:20): [True: 0, False: 96.0k]
  ------------------
  135|      0|        IGRAPH_ERROR("Cannot retrieve edge endpoints.", IGRAPH_EINVEID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|    }
  137|       |
  138|  96.0k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (138:9): [True: 96.0k, False: 0]
  ------------------
  139|  96.0k|        *from = IGRAPH_FROM(graph, eid);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  140|  96.0k|        *to   = IGRAPH_TO(graph, eid);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  141|  96.0k|    } else {
  142|      0|        *from = IGRAPH_TO(graph, eid);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  143|      0|        *to   = IGRAPH_FROM(graph, eid);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  144|      0|    }
  145|       |
  146|  96.0k|    return IGRAPH_SUCCESS;
  147|  96.0k|}
igraph_edges:
  173|  7.81k|) {
  174|  7.81k|    igraph_eit_t eit;
  175|  7.81k|    igraph_int_t n, ptr = 0, ptr2;
  176|       |
  177|  7.81k|    IGRAPH_CHECK(igraph_eit_create(graph, eids, &eit));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  178|  7.81k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  7.81k|    do { \
  |  |  604|  7.81k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.81k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.81k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.81k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.81k]
  |  |  ------------------
  |  |  608|  7.81k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  179|  7.81k|    n = IGRAPH_EIT_SIZE(eit);
  ------------------
  |  |  382|  7.81k|#define IGRAPH_EIT_SIZE(eit)  ((eit).end - (eit).start)
  ------------------
  180|  7.81k|    IGRAPH_CHECK(igraph_vector_int_resize(edges, n * 2));
  ------------------
  |  |  656|  7.81k|    do { \
  |  |  657|  7.81k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.81k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.81k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.81k]
  |  |  ------------------
  ------------------
  181|       |
  182|  7.81k|    if (bycol) {
  ------------------
  |  Branch (182:9): [True: 0, False: 7.81k]
  ------------------
  183|      0|        ptr2 = n;
  184|      0|        if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  ------------------
  185|      0|            for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                          for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (185:20): [True: 0, False: 0]
  ------------------
  186|      0|                igraph_int_t e = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  187|      0|                VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  188|      0|                VECTOR(*edges)[ptr2++] = IGRAPH_TO(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr2++] = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  189|      0|            }
  190|      0|        } else {
  191|      0|            for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                          for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (191:20): [True: 0, False: 0]
  ------------------
  192|      0|                igraph_int_t e = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  193|      0|                VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  194|      0|                VECTOR(*edges)[ptr2++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr2++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  195|      0|            }
  196|      0|        }
  197|  7.81k|    } else {
  198|  7.81k|        if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (198:13): [True: 0, False: 7.81k]
  ------------------
  199|      0|            for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                          for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (199:20): [True: 0, False: 0]
  ------------------
  200|      0|                igraph_int_t e = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  201|      0|                VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  202|      0|                VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  203|      0|            }
  204|  7.81k|        } else {
  205|  96.1k|            for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|  96.1k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                          for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|  88.3k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (205:20): [True: 88.3k, False: 7.81k]
  ------------------
  206|  88.3k|                igraph_int_t e = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  88.3k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 88.3k, False: 0]
  |  |  ------------------
  |  |  406|  88.3k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  207|  88.3k|                VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|  88.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  208|  88.3k|                VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|  88.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  88.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  209|  88.3k|            }
  210|  7.81k|        }
  211|  7.81k|    }
  212|       |
  213|  7.81k|    igraph_eit_destroy(&eit);
  214|  7.81k|    IGRAPH_FINALLY_CLEAN(1);
  215|       |
  216|  7.81k|    return IGRAPH_SUCCESS;
  217|  7.81k|}

igraph_empty_attrs:
  102|   352k|) {
  103|       |
  104|   352k|    if (n < 0) {
  ------------------
  |  Branch (104:9): [True: 0, False: 352k]
  ------------------
  105|      0|        IGRAPH_ERROR("Number of vertices must not be negative.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  106|      0|    }
  107|       |
  108|   352k|    memset(graph, 0, sizeof(igraph_t));
  109|       |
  110|   352k|    graph->n = 0;
  111|   352k|    graph->directed = directed;
  112|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->from, 0);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  113|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->to, 0);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  114|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->oi, 0);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  115|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->ii, 0);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  116|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->os, 1);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  117|   352k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->is, 1);
  ------------------
  |  |  119|   352k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   352k|    do { \
  |  |  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   352k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   352k|    do { \
  |  |  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   352k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  118|       |
  119|       |    /* init cache */
  120|   352k|    graph->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|   352k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   705k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 352k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|   352k|    IGRAPH_CHECK_OOM(graph->cache, "Cannot create graph.");
  ------------------
  |  |  709|   352k|    do { \
  |  |  710|   352k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  122|   352k|    IGRAPH_FINALLY(igraph_free, graph->cache);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  123|   352k|    IGRAPH_CHECK(igraph_i_property_cache_init(graph->cache));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  124|   352k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, graph->cache);
  ------------------
  |  |  603|   352k|    do { \
  |  |  604|   352k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   352k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   352k|         * incorrect destructor function with the pointer */ \
  |  |  607|   352k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 352k]
  |  |  ------------------
  |  |  608|   352k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  125|       |
  126|   352k|    VECTOR(graph->os)[0] = 0;
  ------------------
  |  |   60|   352k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  127|   352k|    VECTOR(graph->is)[0] = 0;
  ------------------
  |  |   60|   352k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  128|       |
  129|       |    /* init attributes */
  130|   352k|    IGRAPH_CHECK(igraph_i_attribute_init(graph, attr));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  131|       |
  132|       |    /* add the vertices */
  133|   352k|    IGRAPH_CHECK(igraph_add_vertices(graph, n, 0));
  ------------------
  |  |  656|   352k|    do { \
  |  |  657|   352k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   352k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   352k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   352k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 352k]
  |  |  ------------------
  ------------------
  134|       |
  135|   352k|    IGRAPH_FINALLY_CLEAN(8);
  136|   352k|    return IGRAPH_SUCCESS;
  137|   352k|}
igraph_destroy:
  155|   360k|void igraph_destroy(igraph_t *graph) {
  156|   360k|    igraph_i_attribute_destroy(graph);
  157|       |
  158|   360k|    igraph_i_property_cache_destroy(graph->cache);
  159|   360k|    IGRAPH_FREE(graph->cache);
  ------------------
  |  |   36|   360k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  160|       |
  161|   360k|    igraph_vector_int_destroy(&graph->from);
  162|   360k|    igraph_vector_int_destroy(&graph->to);
  163|   360k|    igraph_vector_int_destroy(&graph->oi);
  164|   360k|    igraph_vector_int_destroy(&graph->ii);
  165|   360k|    igraph_vector_int_destroy(&graph->os);
  166|   360k|    igraph_vector_int_destroy(&graph->is);
  167|   360k|}
igraph_copy:
  195|  7.45k|igraph_error_t igraph_copy(igraph_t *to, const igraph_t *from) {
  196|  7.45k|    memset(to, 0, sizeof(igraph_t));
  197|       |
  198|  7.45k|    to->n = from->n;
  199|  7.45k|    to->directed = from->directed;
  200|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->from, &from->from));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  201|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->from);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  202|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->to, &from->to));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  203|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->to);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  204|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->oi, &from->oi));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  205|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->oi);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  206|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->ii, &from->ii));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  207|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->ii);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  208|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->os, &from->os));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  209|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->os);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  210|  7.45k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->is, &from->is));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  211|  7.45k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->is);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  212|       |
  213|  7.45k|    to->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|  7.45k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  14.9k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 7.45k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  7.45k|    IGRAPH_CHECK_OOM(to->cache, "Cannot copy graph.");
  ------------------
  |  |  709|  7.45k|    do { \
  |  |  710|  7.45k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  215|  7.45k|    IGRAPH_FINALLY(igraph_free, to->cache);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  216|  7.45k|    IGRAPH_CHECK(igraph_i_property_cache_copy(to->cache, from->cache));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  217|  7.45k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, to->cache);
  ------------------
  |  |  603|  7.45k|    do { \
  |  |  604|  7.45k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.45k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.45k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.45k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.45k]
  |  |  ------------------
  |  |  608|  7.45k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  218|       |
  219|  7.45k|    IGRAPH_CHECK(igraph_i_attribute_copy(to, from, true, true, true));
  ------------------
  |  |  656|  7.45k|    do { \
  |  |  657|  7.45k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.45k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.45k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  7.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  220|       |
  221|  7.45k|    IGRAPH_FINALLY_CLEAN(8);
  222|  7.45k|    return IGRAPH_SUCCESS;
  223|  7.45k|}
igraph_add_edges:
  257|  41.7k|) {
  258|  41.7k|    igraph_int_t no_of_edges = igraph_vector_int_size(&graph->from);
  259|  41.7k|    igraph_int_t edges_to_add = igraph_vector_int_size(edges) / 2;
  260|  41.7k|    igraph_int_t new_no_of_edges;
  261|  41.7k|    igraph_int_t i = 0;
  262|  41.7k|    igraph_vector_int_t newoi, newii;
  263|  41.7k|    igraph_bool_t directed = igraph_is_directed(graph);
  264|       |
  265|  41.7k|    if (igraph_vector_int_size(edges) % 2 != 0) {
  ------------------
  |  Branch (265:9): [True: 0, False: 41.7k]
  ------------------
  266|      0|        IGRAPH_ERROR("Invalid (odd) length of edges vector.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  267|      0|    }
  268|  41.7k|    if (!igraph_vector_int_isininterval(edges, 0, igraph_vcount(graph) - 1)) {
  ------------------
  |  Branch (268:9): [True: 0, False: 41.7k]
  ------------------
  269|      0|        IGRAPH_ERROR("Out-of-range vertex IDs when adding edges.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  270|      0|    }
  271|       |
  272|       |    /* from & to */
  273|  41.7k|    IGRAPH_SAFE_ADD(no_of_edges, edges_to_add, &new_no_of_edges);
  ------------------
  |  |   47|  41.7k|    do { \
  |  |   48|  41.7k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  41.7k|        igraph_int_t _safe_sum; \
  |  |   50|  41.7k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |   51|      0|            IGRAPH_ERRORF("Overflow when adding %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|        } \
  |  |   53|  41.7k|        *(res) = _safe_sum; \
  |  |   54|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  274|  41.7k|    if (new_no_of_edges > IGRAPH_ECOUNT_MAX) {
  ------------------
  |  |  118|  41.7k|#define IGRAPH_ECOUNT_MAX (IGRAPH_INTEGER_MAX/2)
  |  |  ------------------
  |  |  |  |   72|  41.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 41.7k]
  ------------------
  275|      0|        IGRAPH_ERRORF("Maximum edge count (%" IGRAPH_PRId ") exceeded.", IGRAPH_ERANGE,
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  276|      0|                      IGRAPH_ECOUNT_MAX);
  277|      0|    }
  278|  41.7k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->from, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  41.7k|    do { \
  |  |  657|  41.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  279|  41.7k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->to, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  41.7k|    do { \
  |  |  657|  41.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  41.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  41.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 41.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  280|       |
  281|   625k|    while (i < edges_to_add * 2) {
  ------------------
  |  Branch (281:12): [True: 583k, False: 41.7k]
  ------------------
  282|   583k|        if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   282k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   282k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (282:13): [True: 301k, False: 282k]
  |  Branch (282:25): [True: 87.4k, False: 194k]
  ------------------
  283|   388k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   388k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  284|   388k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   388k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  285|   388k|        } else {
  286|   194k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   194k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  287|   194k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   194k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  288|   194k|        }
  289|   583k|    }
  290|       |
  291|       |    /* If an error occurs while the edges are being added, we make the necessary fixup
  292|       |     * to ensure that the graph is still in a consistent state when this function returns.
  293|       |     * The graph may already be on the finally stack when calling this function. We use
  294|       |     * a separate finally stack level to avoid its destructor from being called on error,
  295|       |     * so that the fixup can succeed.
  296|       |     */
  297|       |
  298|  41.7k|#define CHECK_ERR(expr) \
  299|  41.7k|    do { \
  300|  41.7k|        igraph_error_t err = (expr); \
  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  302|  41.7k|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  303|  41.7k|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  304|  41.7k|            IGRAPH_FINALLY_EXIT(); \
  305|  41.7k|            IGRAPH_ERROR("Cannot add edges.", err); \
  306|  41.7k|        } \
  307|  41.7k|    } while (0)
  308|       |
  309|       |    /* oi & ii */
  310|  41.7k|    IGRAPH_FINALLY_ENTER();
  311|  41.7k|    {
  312|  41.7k|        CHECK_ERR(igraph_vector_int_init(&newoi, no_of_edges));
  ------------------
  |  |  299|  41.7k|    do { \
  |  |  300|  41.7k|        igraph_error_t err = (expr); \
  |  |  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |  302|      0|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  |  |  303|      0|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  |  |  304|      0|            IGRAPH_FINALLY_EXIT(); \
  |  |  305|      0|            IGRAPH_ERROR("Cannot add edges.", err); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|      0|        } \
  |  |  307|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  313|  41.7k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newoi);
  ------------------
  |  |  603|  41.7k|    do { \
  |  |  604|  41.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  41.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  41.7k|         * incorrect destructor function with the pointer */ \
  |  |  607|  41.7k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 41.7k]
  |  |  ------------------
  |  |  608|  41.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  314|  41.7k|        CHECK_ERR(igraph_vector_int_init(&newii, no_of_edges));
  ------------------
  |  |  299|  41.7k|    do { \
  |  |  300|  41.7k|        igraph_error_t err = (expr); \
  |  |  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |  302|      0|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  |  |  303|      0|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  |  |  304|      0|            IGRAPH_FINALLY_EXIT(); \
  |  |  305|      0|            IGRAPH_ERROR("Cannot add edges.", err); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|      0|        } \
  |  |  307|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  315|  41.7k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newii);
  ------------------
  |  |  603|  41.7k|    do { \
  |  |  604|  41.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  41.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  41.7k|         * incorrect destructor function with the pointer */ \
  |  |  607|  41.7k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 41.7k]
  |  |  ------------------
  |  |  608|  41.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  316|  41.7k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->from, &graph->to, &newoi, graph->n));
  ------------------
  |  |  299|  41.7k|    do { \
  |  |  300|  41.7k|        igraph_error_t err = (expr); \
  |  |  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |  302|      0|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  |  |  303|      0|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  |  |  304|      0|            IGRAPH_FINALLY_EXIT(); \
  |  |  305|      0|            IGRAPH_ERROR("Cannot add edges.", err); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|      0|        } \
  |  |  307|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  317|  41.7k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->to, &graph->from, &newii, graph->n));
  ------------------
  |  |  299|  41.7k|    do { \
  |  |  300|  41.7k|        igraph_error_t err = (expr); \
  |  |  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |  302|      0|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  |  |  303|      0|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  |  |  304|      0|            IGRAPH_FINALLY_EXIT(); \
  |  |  305|      0|            IGRAPH_ERROR("Cannot add edges.", err); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|      0|        } \
  |  |  307|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  318|       |
  319|       |        /* Attributes */
  320|  41.7k|        if (graph->attr) {
  ------------------
  |  Branch (320:13): [True: 41.7k, False: 0]
  ------------------
  321|       |            /* TODO: Does this keep the attribute table in a consistent state upon failure? */
  322|  41.7k|            CHECK_ERR(igraph_i_attribute_add_edges(graph, edges, attr));
  ------------------
  |  |  299|  41.7k|    do { \
  |  |  300|  41.7k|        igraph_error_t err = (expr); \
  |  |  301|  41.7k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 41.7k]
  |  |  ------------------
  |  |  302|      0|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  |  |  303|      0|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  |  |  304|      0|            IGRAPH_FINALLY_EXIT(); \
  |  |  305|      0|            IGRAPH_ERROR("Cannot add edges.", err); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|      0|        } \
  |  |  307|  41.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 41.7k]
  |  |  ------------------
  ------------------
  323|  41.7k|        }
  324|       |
  325|       |        /* os & is, its length does not change, error safe */
  326|  41.7k|        igraph_i_create_start_vectors(&graph->os, &graph->from, &newoi, graph->n);
  327|  41.7k|        igraph_i_create_start_vectors(&graph->is, &graph->to, &newii, graph->n);
  328|       |
  329|       |        /* everything went fine */
  330|  41.7k|        igraph_vector_int_destroy(&graph->oi);
  331|  41.7k|        igraph_vector_int_destroy(&graph->ii);
  332|  41.7k|        IGRAPH_FINALLY_CLEAN(2);
  333|       |
  334|  41.7k|        graph->oi = newoi;
  335|  41.7k|        graph->ii = newii;
  336|  41.7k|    }
  337|      0|    IGRAPH_FINALLY_EXIT();
  338|       |
  339|  41.7k|#undef CHECK_ERR
  340|       |
  341|       |    /* modification successful, clear the cached properties of the graph.
  342|       |     *
  343|       |     * Adding one or more edges cannot make a strongly or weakly connected
  344|       |     * graph disconnected, so we keep those flags if they are cached as true.
  345|       |     *
  346|       |     * Adding one or more edges may turn a DAG into a non-DAG or a forest into
  347|       |     * a non-forest, so we can keep those flags only if they are cached as
  348|       |     * false.
  349|       |     *
  350|       |     * Also, adding one or more edges does not change HAS_LOOP, HAS_MULTI and
  351|       |     * HAS_MUTUAL if they were already true.
  352|       |     */
  353|  41.7k|    igraph_i_property_cache_invalidate_conditionally(
  354|  41.7k|        graph,
  355|  41.7k|        /* keep_always = */ 0,
  356|       |        /* keep_when_false = */
  357|  41.7k|        (1 << IGRAPH_PROP_IS_DAG) | (1 << IGRAPH_PROP_IS_FOREST),
  358|       |        /* keep_when_true = */
  359|  41.7k|        (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED) |
  360|  41.7k|        (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  361|  41.7k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  362|  41.7k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  363|  41.7k|        (1 << IGRAPH_PROP_HAS_MUTUAL)
  364|  41.7k|    );
  365|       |
  366|  41.7k|    return IGRAPH_SUCCESS;
  367|  41.7k|}
igraph_add_vertices:
  391|   355k|) {
  392|   355k|    igraph_int_t ec = igraph_ecount(graph);
  393|   355k|    igraph_int_t vc = igraph_vcount(graph);
  394|   355k|    igraph_int_t new_vc;
  395|   355k|    igraph_int_t i;
  396|       |
  397|   355k|    if (nv < 0) {
  ------------------
  |  Branch (397:9): [True: 0, False: 355k]
  ------------------
  398|      0|        IGRAPH_ERROR("Cannot add negative number of vertices.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  399|      0|    }
  400|       |
  401|   355k|    IGRAPH_SAFE_ADD(graph->n, nv, &new_vc);
  ------------------
  |  |   47|   355k|    do { \
  |  |   48|   355k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|   355k|        igraph_int_t _safe_sum; \
  |  |   50|   355k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 355k]
  |  |  ------------------
  |  |   51|      0|            IGRAPH_ERRORF("Overflow when adding %" IGRAPH_PRId " and %" IGRAPH_PRId ".", IGRAPH_EOVERFLOW, _safe_a, _safe_b); \
  |  |  ------------------
  |  |  |  |  464|      0|    do { \
  |  |  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  |  |  467|      0|        return igraph_errno; \
  |  |  |  |  468|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|        } \
  |  |   53|   355k|        *(res) = _safe_sum; \
  |  |   54|   355k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 355k]
  |  |  ------------------
  ------------------
  402|   355k|    if (new_vc > IGRAPH_VCOUNT_MAX) {
  ------------------
  |  |  100|   355k|#define IGRAPH_VCOUNT_MAX (IGRAPH_INTEGER_MAX-1)
  |  |  ------------------
  |  |  |  |   72|   355k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (402:9): [True: 0, False: 355k]
  ------------------
  403|      0|        IGRAPH_ERRORF("Maximum vertex count (%" IGRAPH_PRId ") exceeded.", IGRAPH_ERANGE,
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  404|      0|                      IGRAPH_VCOUNT_MAX);
  405|      0|    }
  406|   355k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->os, new_vc + 1));
  ------------------
  |  |  656|   355k|    do { \
  |  |  657|   355k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   355k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   355k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 355k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   355k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 355k]
  |  |  ------------------
  ------------------
  407|   355k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->is, new_vc + 1));
  ------------------
  |  |  656|   355k|    do { \
  |  |  657|   355k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   355k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   355k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 355k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   355k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 355k]
  |  |  ------------------
  ------------------
  408|       |
  409|   355k|    igraph_vector_int_resize(&graph->os, new_vc + 1); /* reserved */
  410|   355k|    igraph_vector_int_resize(&graph->is, new_vc + 1); /* reserved */
  411|  2.06M|    for (i = graph->n + 1; i < new_vc + 1; i++) {
  ------------------
  |  Branch (411:28): [True: 1.70M, False: 355k]
  ------------------
  412|  1.70M|        VECTOR(graph->os)[i] = ec;
  ------------------
  |  |   60|  1.70M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  413|  1.70M|        VECTOR(graph->is)[i] = ec;
  ------------------
  |  |   60|  1.70M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  414|  1.70M|    }
  415|       |
  416|   355k|    graph->n += nv;
  417|       |
  418|       |    /* Add attributes if necessary. This section is protected with
  419|       |     * FINALLY_ENTER/EXIT so that the graph would not be accidentally
  420|       |     * free upon error until it could be restored to a consistent state. */
  421|       |
  422|   355k|    if (graph->attr) {
  ------------------
  |  Branch (422:9): [True: 355k, False: 0]
  ------------------
  423|   355k|        igraph_error_t err;
  424|   355k|        IGRAPH_FINALLY_ENTER();
  425|   355k|        err = igraph_i_attribute_add_vertices(graph, nv, attr);
  426|   355k|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (426:13): [True: 0, False: 355k]
  ------------------
  427|       |            /* Restore original vertex count on failure */
  428|      0|            graph->n = vc;
  429|      0|            igraph_vector_int_resize(&graph->os, vc + 1); /* shrinks */
  430|      0|            igraph_vector_int_resize(&graph->is, vc + 1); /* shrinks */
  431|      0|        }
  432|   355k|        IGRAPH_FINALLY_EXIT();
  433|   355k|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (433:13): [True: 0, False: 355k]
  ------------------
  434|      0|            IGRAPH_ERROR("Cannot add vertices.", err);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  435|      0|        }
  436|   355k|    }
  437|       |
  438|       |    /* modification successful, clear the cached properties of the graph.
  439|       |     *
  440|       |     * Adding one or more nodes does not change the following cached properties:
  441|       |     *
  442|       |     * - IGRAPH_PROP_HAS_LOOP
  443|       |     * - IGRAPH_PROP_HAS_MULTI
  444|       |     * - IGRAPH_PROP_HAS_MUTUAL
  445|       |     * - IGRAPH_PROP_IS_DAG (adding a node does not create/destroy cycles)
  446|       |     * - IGRAPH_PROP_IS_FOREST (same)
  447|       |     *
  448|       |     * Adding one or more nodes without any edges incident on them is sure to
  449|       |     * make the graph disconnected (weakly or strongly), so we can keep the
  450|       |     * connectivity-related properties if they are currently cached as false.
  451|       |     * (Actually, even if they weren't cached as false, we could still set them
  452|       |     * to false, but we don't have that functionality yet). The only exception
  453|       |     * is when the graph had zero vertices and gained only one vertex, because
  454|       |     * it then becomes connected. That's why we have the condition below in the
  455|       |     * keep_when_false section.
  456|       |     */
  457|   355k|    igraph_i_property_cache_invalidate_conditionally(
  458|   355k|        graph,
  459|       |        /* keep_always = */
  460|   355k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  461|   355k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  462|   355k|        (1 << IGRAPH_PROP_HAS_MUTUAL) |
  463|   355k|        (1 << IGRAPH_PROP_IS_DAG) |
  464|   355k|        (1 << IGRAPH_PROP_IS_FOREST),
  465|       |        /* keep_when_false = */
  466|   355k|        igraph_vcount(graph) >= 2 ? (
  ------------------
  |  Branch (466:9): [True: 41.6k, False: 314k]
  ------------------
  467|  41.6k|            (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  468|  41.6k|            (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED)
  469|   314k|        ) : 0,
  470|       |        /* keep_when_true = */
  471|   355k|        0
  472|   355k|    );
  473|       |
  474|   355k|    return IGRAPH_SUCCESS;
  475|   355k|}
igraph_delete_vertices_map:
  648|    375|) {
  649|    375|    igraph_int_t no_of_edges = igraph_ecount(graph);
  650|    375|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  651|    375|    igraph_vector_int_t edge_recoding, vertex_recoding;
  652|    375|    igraph_vector_int_t *my_vertex_recoding = &vertex_recoding;
  653|    375|    igraph_vit_t vit;
  654|    375|    igraph_t newgraph;
  655|    375|    igraph_int_t i, j;
  656|    375|    igraph_int_t remaining_vertices, remaining_edges;
  657|       |
  658|    375|    if (map) {
  ------------------
  |  Branch (658:9): [True: 0, False: 375]
  ------------------
  659|      0|        my_vertex_recoding = map;
  660|      0|        IGRAPH_CHECK(igraph_vector_int_resize(map, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  661|      0|        igraph_vector_int_null(map);
  662|    375|    } else {
  663|    375|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vertex_recoding, no_of_nodes);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  664|    375|    }
  665|       |
  666|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edge_recoding, no_of_edges);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  667|       |
  668|    375|    IGRAPH_CHECK(igraph_vit_create(graph, vertices, &vit));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  669|    375|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  670|       |
  671|       |    /* mark the vertices to delete */
  672|    750|    for (; !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit) ) {
  ------------------
  |  |  179|    750|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
                  for (; !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit) ) {
  ------------------
  |  |  167|    375|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
  |  Branch (672:12): [True: 375, False: 375]
  ------------------
  673|    375|        igraph_int_t vertex = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|    375|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 0, False: 375]
  |  |  ------------------
  |  |  215|    375|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|    375|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  674|    375|        if (vertex < 0 || vertex >= no_of_nodes) {
  ------------------
  |  Branch (674:13): [True: 0, False: 375]
  |  Branch (674:27): [True: 0, False: 375]
  ------------------
  675|      0|            IGRAPH_ERROR("Cannot delete vertices.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  676|      0|        }
  677|    375|        VECTOR(*my_vertex_recoding)[vertex] = 1;
  ------------------
  |  |   60|    375|#define VECTOR(v) ((v).stor_begin)
  ------------------
  678|    375|    }
  679|       |    /* create vertex recoding vector */
  680|  1.75k|    for (remaining_vertices = 0, i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (680:41): [True: 1.38k, False: 375]
  ------------------
  681|  1.38k|        if (VECTOR(*my_vertex_recoding)[i] == 0) {
  ------------------
  |  |   60|  1.38k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (681:13): [True: 1.00k, False: 375]
  ------------------
  682|  1.00k|            VECTOR(*my_vertex_recoding)[i] = remaining_vertices;
  ------------------
  |  |   60|  1.00k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  683|  1.00k|            remaining_vertices++;
  684|  1.00k|        } else {
  685|    375|            VECTOR(*my_vertex_recoding)[i] = -1;
  ------------------
  |  |   60|    375|#define VECTOR(v) ((v).stor_begin)
  ------------------
  686|    375|        }
  687|  1.38k|    }
  688|       |    /* create edge recoding vector */
  689|  5.34k|    for (remaining_edges = 0, i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (689:38): [True: 4.97k, False: 375]
  ------------------
  690|  4.97k|        igraph_int_t from = VECTOR(graph->from)[i];
  ------------------
  |  |   60|  4.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  691|  4.97k|        igraph_int_t to = VECTOR(graph->to)[i];
  ------------------
  |  |   60|  4.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  692|  4.97k|        if (VECTOR(*my_vertex_recoding)[from] >= 0 &&
  ------------------
  |  |   60|  4.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (692:13): [True: 4.30k, False: 666]
  ------------------
  693|  4.30k|            VECTOR(*my_vertex_recoding)[to  ] >= 0) {
  ------------------
  |  |   60|  4.30k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (693:13): [True: 3.93k, False: 372]
  ------------------
  694|  3.93k|            VECTOR(edge_recoding)[i] = remaining_edges + 1;
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  695|  3.93k|            remaining_edges++;
  696|  3.93k|        }
  697|  4.97k|    }
  698|       |
  699|       |    /* start creating the graph */
  700|    375|    memset(&newgraph, 0, sizeof(igraph_t));
  701|    375|    newgraph.n = remaining_vertices;
  702|    375|    newgraph.directed = graph->directed;
  703|       |
  704|       |    /* allocate vectors */
  705|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.from, remaining_edges);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  706|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.to, remaining_edges);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  707|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.oi, remaining_edges);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  708|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.ii, remaining_edges);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  709|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.os, remaining_vertices + 1);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  710|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&newgraph.is, remaining_vertices + 1);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  711|       |
  712|       |    /* Add the edges */
  713|  5.16k|    for (i = 0, j = 0; j < remaining_edges; i++) {
  ------------------
  |  Branch (713:24): [True: 4.79k, False: 375]
  ------------------
  714|  4.79k|        if (VECTOR(edge_recoding)[i] > 0) {
  ------------------
  |  |   60|  4.79k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (714:13): [True: 3.93k, False: 856]
  ------------------
  715|  3.93k|            igraph_int_t from = VECTOR(graph->from)[i];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  716|  3.93k|            igraph_int_t to = VECTOR(graph->to  )[i];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  717|  3.93k|            VECTOR(newgraph.from)[j] = VECTOR(*my_vertex_recoding)[from];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(newgraph.from)[j] = VECTOR(*my_vertex_recoding)[from];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  718|  3.93k|            VECTOR(newgraph.to  )[j] = VECTOR(*my_vertex_recoding)[to];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(newgraph.to  )[j] = VECTOR(*my_vertex_recoding)[to];
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  719|  3.93k|            j++;
  720|  3.93k|        }
  721|  4.79k|    }
  722|       |
  723|       |    /* update oi & ii */
  724|    375|    IGRAPH_CHECK(igraph_vector_int_pair_order(&newgraph.from, &newgraph.to, &newgraph.oi,
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  725|    375|                                         remaining_vertices));
  726|    375|    IGRAPH_CHECK(igraph_vector_int_pair_order(&newgraph.to, &newgraph.from, &newgraph.ii,
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  727|    375|                                         remaining_vertices));
  728|       |
  729|    375|    IGRAPH_CHECK(igraph_i_create_start_vectors(&newgraph.os, &newgraph.from,
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  730|    375|                                       &newgraph.oi, remaining_vertices));
  731|    375|    IGRAPH_CHECK(igraph_i_create_start_vectors(&newgraph.is, &newgraph.to,
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  732|    375|                                       &newgraph.ii, remaining_vertices));
  733|       |
  734|    375|    newgraph.cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|    375|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|    750|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 375, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  735|    375|    IGRAPH_CHECK_OOM(newgraph.cache, "Cannot delete vertices.");
  ------------------
  |  |  709|    375|    do { \
  |  |  710|    375|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  711|      0|            IGRAPH_ERROR(message, IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */ \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  712|      0|        } \
  |  |  713|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  736|    375|    IGRAPH_FINALLY(igraph_free, newgraph.cache);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  737|    375|    IGRAPH_CHECK(igraph_i_property_cache_init(newgraph.cache));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  738|    375|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, newgraph.cache);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  739|       |
  740|       |    /* attributes */
  741|    375|    IGRAPH_CHECK(igraph_i_attribute_copy(
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  742|    375|        &newgraph, graph, /* graph= */ true, /* vertex= */ false, /* edge= */ false
  743|    375|    ));
  744|       |
  745|       |    /* at this point igraph_destroy can take over the responsibility of
  746|       |     * deallocating the graph */
  747|    375|    IGRAPH_FINALLY_CLEAN(8);    /* 2 for the property cache, 6 for the vectors */
  748|    375|    IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  749|       |
  750|    375|    if (newgraph.attr) {
  ------------------
  |  Branch (750:9): [True: 375, False: 0]
  ------------------
  751|    375|        igraph_vector_int_t iidx;
  752|    375|        IGRAPH_VECTOR_INT_INIT_FINALLY(&iidx, remaining_vertices);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
  753|  1.75k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (753:21): [True: 1.38k, False: 375]
  ------------------
  754|  1.38k|            igraph_int_t jj = VECTOR(*my_vertex_recoding)[i];
  ------------------
  |  |   60|  1.38k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  755|  1.38k|            if (jj >= 0) {
  ------------------
  |  Branch (755:17): [True: 1.00k, False: 375]
  ------------------
  756|  1.00k|                VECTOR(iidx)[ jj ] = i;
  ------------------
  |  |   60|  1.00k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  757|  1.00k|            }
  758|  1.38k|        }
  759|    375|        IGRAPH_CHECK(igraph_i_attribute_permute_vertices(graph, &newgraph, &iidx));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  760|    375|        IGRAPH_CHECK(igraph_vector_int_resize(&iidx, remaining_edges));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  761|  5.34k|        for (i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (761:21): [True: 4.97k, False: 375]
  ------------------
  762|  4.97k|            igraph_int_t jj = VECTOR(edge_recoding)[i];
  ------------------
  |  |   60|  4.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  763|  4.97k|            if (jj != 0) {
  ------------------
  |  Branch (763:17): [True: 3.93k, False: 1.03k]
  ------------------
  764|  3.93k|                VECTOR(iidx)[ jj - 1 ] = i;
  ------------------
  |  |   60|  3.93k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  765|  3.93k|            }
  766|  4.97k|        }
  767|    375|        IGRAPH_CHECK(igraph_i_attribute_permute_edges(graph, &newgraph, &iidx));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
  768|    375|        igraph_vector_int_destroy(&iidx);
  769|    375|        IGRAPH_FINALLY_CLEAN(1);
  770|    375|    }
  771|       |
  772|    375|    igraph_vit_destroy(&vit);
  773|    375|    igraph_vector_int_destroy(&edge_recoding);
  774|    375|    igraph_destroy(graph);
  775|    375|    *graph = newgraph;
  776|       |
  777|    375|    IGRAPH_FINALLY_CLEAN(3);
  778|       |
  779|    375|    if (invmap) {
  ------------------
  |  Branch (779:9): [True: 0, False: 375]
  ------------------
  780|      0|        IGRAPH_CHECK(igraph_vector_int_resize(invmap, remaining_vertices));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  781|      0|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (781:21): [True: 0, False: 0]
  ------------------
  782|      0|            igraph_int_t newid = VECTOR(*my_vertex_recoding)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  783|      0|            if (newid >= 0) {
  ------------------
  |  Branch (783:17): [True: 0, False: 0]
  ------------------
  784|      0|                VECTOR(*invmap)[newid] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  785|      0|            }
  786|      0|        }
  787|      0|    }
  788|       |
  789|    375|    if (!map) {
  ------------------
  |  Branch (789:9): [True: 375, False: 0]
  ------------------
  790|    375|        igraph_vector_int_destroy(my_vertex_recoding);
  791|    375|        IGRAPH_FINALLY_CLEAN(1);
  792|    375|    }
  793|       |
  794|       |    /* modification successful, clear the cached properties of the graph.
  795|       |     *
  796|       |     * Deleting one or more vertices cannot make a directed acyclic graph cyclic,
  797|       |     * or an undirected forest into a cyclic graph, so we keep those flags if
  798|       |     * they are cached as true.
  799|       |     *
  800|       |     * Also, if the graph had no loop edges before the deletion, it will have
  801|       |     * no loop edges after the deletion either. The same applies to reciprocal
  802|       |     * edges or multiple edges as well.
  803|       |     */
  804|    375|    igraph_i_property_cache_invalidate_conditionally(
  805|    375|        graph,
  806|    375|        /* keep_always = */ 0,
  807|       |        /* keep_when_false = */
  808|    375|        (1 << IGRAPH_PROP_HAS_LOOP) |
  809|    375|        (1 << IGRAPH_PROP_HAS_MULTI) |
  810|    375|        (1 << IGRAPH_PROP_HAS_MUTUAL),
  811|       |        /* keep_when_true = */
  812|    375|        (1 << IGRAPH_PROP_IS_DAG) |
  813|    375|        (1 << IGRAPH_PROP_IS_FOREST)
  814|    375|    );
  815|       |
  816|    375|    return IGRAPH_SUCCESS;
  817|    375|}
igraph_vcount:
  829|  7.32M|igraph_int_t igraph_vcount(const igraph_t *graph) {
  830|  7.32M|    return graph->n;
  831|  7.32M|}
igraph_ecount:
  843|   715k|igraph_int_t igraph_ecount(const igraph_t *graph) {
  844|   715k|    return igraph_vector_int_size(&graph->from);
  845|   715k|}
igraph_neighbors:
  894|   777k|) {
  895|       |
  896|   777k|#define DEDUPLICATE_IF_NEEDED(vertex, n)                                          \
  897|   777k|    if (should_filter_duplicates) {                                               \
  898|   777k|        if (vertex == pnode) {                                                    \
  899|       |            /* This is a loop edge */                                             \
  900|   777k|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  901|       |                /* Filtering loop edges unconditionally */                        \
  902|   777k|                length -= n;                                                      \
  903|   777k|                continue;                                                         \
  904|   777k|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  905|       |                /* Filtering every second endpoint of loop edges */               \
  906|   777k|                length -= n;                                                      \
  907|   777k|                last_added = -1;                                                  \
  908|   777k|                seen_loop = true;                                                 \
  909|   777k|                continue;                                                         \
  910|   777k|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  911|       |                /* Filtering multi-loop edges */                                  \
  912|   777k|                length -= n;                                                      \
  913|   777k|                continue;                                                         \
  914|   777k|            } else {                                                              \
  915|   777k|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  916|   777k|                last_added = vertex;                                              \
  917|   777k|            }                                                                     \
  918|   777k|        } else {                                                                  \
  919|       |            /* Not a loop edge */                                                 \
  920|   777k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  921|       |                /* Filtering multi-edges */                                       \
  922|   777k|                length -= n;                                                      \
  923|   777k|                continue;                                                         \
  924|   777k|            } else {                                                              \
  925|   777k|                last_added = vertex;                                              \
  926|   777k|            }                                                                     \
  927|   777k|        }                                                                         \
  928|   777k|    }
  929|       |
  930|   777k|    igraph_int_t length = 0, idx = 0;
  931|   777k|    igraph_int_t i, j;
  932|       |
  933|   777k|    igraph_int_t node = pnode;
  934|   777k|    igraph_int_t last_added = -1;
  935|   777k|    igraph_bool_t should_filter_duplicates;
  936|       |
  937|       |    /* seen_loop stores whether we have already seen at least one full loop
  938|       |     * edge while iterating over the neighbor lists. This is needed to handle
  939|       |     * multi-loop edges properly. Since internally we always store loop edges
  940|       |     * twice, this flag should become true only if we processed both endpoints
  941|       |     * for a loop edge */
  942|   777k|    igraph_bool_t seen_loop = false;
  943|       |
  944|       |    /* normalize Boolean value to enable == comparisons below and in DEDUPLICATE_IF_NEEDED */
  945|   777k|    multiple = !!multiple;
  946|       |
  947|   777k|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (947:9): [True: 0, False: 777k]
  |  Branch (947:21): [True: 0, False: 777k]
  ------------------
  948|      0|        IGRAPH_ERRORF("Vertex %" IGRAPH_PRId " is not in the graph.", IGRAPH_EINVVID, node);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  949|      0|    }
  950|   777k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (950:9): [True: 625k, False: 151k]
  |  Branch (950:31): [True: 625k, False: 0]
  |  Branch (950:52): [True: 0, False: 625k]
  ------------------
  951|      0|        IGRAPH_ERROR("Mode should be either IGRAPH_OUT, IGRAPH_IN or IGRAPH_ALL.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  952|      0|    }
  953|       |
  954|   777k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (954:9): [True: 167k, False: 609k]
  ------------------
  955|   167k|        mode = IGRAPH_ALL;
  956|   167k|    }
  957|       |
  958|   777k|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (958:9): [True: 0, False: 777k]
  |  Branch (958:31): [True: 0, False: 0]
  ------------------
  959|       |        /*
  960|       |        IGRAPH_ERROR("For a directed graph (with directions not ignored), "
  961|       |                     "IGRAPH_LOOPS_TWICE does not make sense.", IGRAPH_EINVAL);
  962|       |        */
  963|      0|        loops = IGRAPH_LOOPS_ONCE;
  964|      0|    }
  965|       |
  966|       |    /* Calculate needed space first & allocate it */
  967|       |    /* Note that 'mode' is treated as a bit field here; it's okay because
  968|       |     * IGRAPH_ALL = IGRAPH_IN | IGRAPH_OUT, bit-wise */
  969|   777k|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (969:9): [True: 777k, False: 0]
  ------------------
  970|   777k|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|   777k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|   777k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  971|   777k|    }
  972|   777k|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (972:9): [True: 777k, False: 0]
  ------------------
  973|   777k|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|   777k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|   777k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  974|   777k|    }
  975|       |
  976|   777k|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|   777k|    do { \
  |  |  657|   777k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   777k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   777k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 777k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   777k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 777k]
  |  |  ------------------
  ------------------
  977|       |
  978|       |    /* We are dealing with two sorted lists; one for the successors and one
  979|       |     * for the predecessors. If we have requested only one of them, we have
  980|       |     * an easy job. If we have requested both, we need to merge the two lists
  981|       |     * to ensure that the output is sorted by the vertex IDs of the "other"
  982|       |     * endpoint of the affected edges. We don't need to merge if the graph
  983|       |     * is undirected, because in that case the data structure guarantees that
  984|       |     * the "out-edges" contain only (u, v) pairs where u <= v and the
  985|       |     * "in-edges" contains the rest, so the result is sorted even without
  986|       |     * merging. */
  987|   777k|    if (!igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (987:9): [True: 167k, False: 609k]
  |  Branch (987:39): [True: 0, False: 609k]
  ------------------
  988|       |        /* graph is undirected or we did not ask for both directions in a
  989|       |         * directed graph; this is the easy case */
  990|       |
  991|   167k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (991:38): [True: 167k, False: 0]
  ------------------
  992|   167k|                ((!igraph_is_directed(graph) && loops == IGRAPH_LOOPS_TWICE) ||
  ------------------
  |  Branch (992:19): [True: 167k, False: 0]
  |  Branch (992:49): [True: 151k, False: 15.9k]
  ------------------
  993|  15.9k|                 (igraph_is_directed(graph) && loops != IGRAPH_NO_LOOPS)));
  ------------------
  |  Branch (993:19): [True: 0, False: 15.9k]
  |  Branch (993:48): [True: 0, False: 0]
  ------------------
  994|       |
  995|   167k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (995:13): [True: 167k, False: 0]
  ------------------
  996|   167k|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  997|   244k|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (997:47): [True: 76.4k, False: 167k]
  ------------------
  998|  76.4k|                igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|  76.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|  76.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  999|  76.4k|                DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|  76.4k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 20.5k, False: 55.8k]
  |  |  ------------------
  |  |  898|  20.5k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 20.5k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  20.5k|        } else {                                                                  \
  |  |  919|  20.5k|            /* Not a loop edge */                                                 \
  |  |  920|  20.5k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 20.5k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  20.5k|            } else {                                                              \
  |  |  925|  20.5k|                last_added = vertex;                                              \
  |  |  926|  20.5k|            }                                                                     \
  |  |  927|  20.5k|        }                                                                         \
  |  |  928|  20.5k|    }
  ------------------
 1000|  76.4k|                VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|  76.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1001|  76.4k|            }
 1002|   167k|        }
 1003|       |
 1004|   167k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1004:13): [True: 167k, False: 0]
  ------------------
 1005|   167k|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1006|   250k|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1006:47): [True: 83.0k, False: 167k]
  ------------------
 1007|  83.0k|                igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|  83.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|  83.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1008|  83.0k|                DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|  83.0k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 27.1k, False: 55.8k]
  |  |  ------------------
  |  |  898|  27.1k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 27.1k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  27.1k|        } else {                                                                  \
  |  |  919|  27.1k|            /* Not a loop edge */                                                 \
  |  |  920|  27.1k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 27.1k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  27.1k|            } else {                                                              \
  |  |  925|  27.1k|                last_added = vertex;                                              \
  |  |  926|  27.1k|            }                                                                     \
  |  |  927|  27.1k|        }                                                                         \
  |  |  928|  27.1k|    }
  ------------------
 1009|  83.0k|                VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|  83.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1010|  83.0k|            }
 1011|   167k|        }
 1012|   609k|    } else {
 1013|       |        /* Both in- and out- neighbors in a directed graph,
 1014|       |           we need to merge the two 'vectors' so the result is
 1015|       |           correctly ordered. */
 1016|   609k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   609k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1017|   609k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   609k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1018|   609k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   609k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1019|   609k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   609k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1020|   609k|        igraph_int_t eid1, eid2;
 1021|   609k|        igraph_int_t n1, n2;
 1022|       |
 1023|   609k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (1023:38): [True: 609k, False: 0]
  ------------------
 1024|   609k|                loops == IGRAPH_LOOPS_TWICE);
  ------------------
  |  Branch (1024:17): [True: 303k, False: 306k]
  ------------------
 1025|       |
 1026|   875k|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1026:16): [True: 360k, False: 515k]
  |  Branch (1026:27): [True: 266k, False: 93.9k]
  ------------------
 1027|   266k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   266k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1028|   266k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   266k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1029|   266k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   266k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1030|   266k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   266k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1031|   266k|            if (n1 < n2) {
  ------------------
  |  Branch (1031:17): [True: 101k, False: 164k]
  ------------------
 1032|   101k|                i1++;
 1033|   101k|                DEDUPLICATE_IF_NEEDED(n1, 1);
  ------------------
  |  |  897|   101k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 56.0k, False: 45.8k]
  |  |  ------------------
  |  |  898|  56.0k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 56.0k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  56.0k|        } else {                                                                  \
  |  |  919|  56.0k|            /* Not a loop edge */                                                 \
  |  |  920|  56.0k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 56.0k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  56.0k|            } else {                                                              \
  |  |  925|  56.0k|                last_added = vertex;                                              \
  |  |  926|  56.0k|            }                                                                     \
  |  |  927|  56.0k|        }                                                                         \
  |  |  928|  56.0k|    }
  ------------------
 1034|   101k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1035|   164k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1035:24): [True: 100k, False: 63.9k]
  ------------------
 1036|   100k|                i2++;
 1037|   100k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|   100k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 54.2k, False: 46.3k]
  |  |  ------------------
  |  |  898|  54.2k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 54.2k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  54.2k|        } else {                                                                  \
  |  |  919|  54.2k|            /* Not a loop edge */                                                 \
  |  |  920|  54.2k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 54.2k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  54.2k|            } else {                                                              \
  |  |  925|  54.2k|                last_added = vertex;                                              \
  |  |  926|  54.2k|            }                                                                     \
  |  |  927|  54.2k|        }                                                                         \
  |  |  928|  54.2k|    }
  ------------------
 1038|   100k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|   100k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1039|   100k|            } else {
 1040|  63.9k|                i1++;
 1041|  63.9k|                i2++;
 1042|  63.9k|                DEDUPLICATE_IF_NEEDED(n1, 2);
  ------------------
  |  |  897|  63.9k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 57.7k, False: 6.18k]
  |  |  ------------------
  |  |  898|  57.7k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 48.0k, False: 9.76k]
  |  |  ------------------
  |  |  899|  48.0k|            /* This is a loop edge */                                             \
  |  |  900|  48.0k|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 48.0k, False: 0]
  |  |  ------------------
  |  |  901|  48.0k|                /* Filtering loop edges unconditionally */                        \
  |  |  902|  48.0k|                length -= n;                                                      \
  |  |  903|  48.0k|                continue;                                                         \
  |  |  904|  48.0k|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  48.0k|        } else {                                                                  \
  |  |  919|  9.76k|            /* Not a loop edge */                                                 \
  |  |  920|  9.76k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 9.76k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  9.76k|            } else {                                                              \
  |  |  925|  9.76k|                last_added = vertex;                                              \
  |  |  926|  9.76k|            }                                                                     \
  |  |  927|  9.76k|        }                                                                         \
  |  |  928|  57.7k|    }
  ------------------
 1043|  15.9k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|  15.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1044|  15.9k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|  15.9k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 9.76k, False: 6.18k]
  |  |  ------------------
  |  |  898|  9.76k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 9.76k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  9.76k|        } else {                                                                  \
  |  |  919|  9.76k|            /* Not a loop edge */                                                 \
  |  |  920|  9.76k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 9.76k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  9.76k|            } else {                                                              \
  |  |  925|  9.76k|                last_added = vertex;                                              \
  |  |  926|  9.76k|            }                                                                     \
  |  |  927|  9.76k|        }                                                                         \
  |  |  928|  9.76k|    }
  ------------------
 1045|  15.9k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|  15.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1046|  15.9k|            }
 1047|   266k|        }
 1048|       |
 1049|   746k|        while (i1 < j1) {
  ------------------
  |  Branch (1049:16): [True: 137k, False: 609k]
  ------------------
 1050|   137k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1051|   137k|            igraph_int_t to = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1052|   137k|            DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|   137k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 74.5k, False: 62.7k]
  |  |  ------------------
  |  |  898|  74.5k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 74.5k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  74.5k|        } else {                                                                  \
  |  |  919|  74.5k|            /* Not a loop edge */                                                 \
  |  |  920|  74.5k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 74.5k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  74.5k|            } else {                                                              \
  |  |  925|  74.5k|                last_added = vertex;                                              \
  |  |  926|  74.5k|            }                                                                     \
  |  |  927|  74.5k|        }                                                                         \
  |  |  928|  74.5k|    }
  ------------------
 1053|   137k|            VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1054|   137k|        }
 1055|       |
 1056|   747k|        while (i2 < j2) {
  ------------------
  |  Branch (1056:16): [True: 137k, False: 609k]
  ------------------
 1057|   137k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1058|   137k|            igraph_int_t from = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1059|   137k|            DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|   137k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 75.5k, False: 62.2k]
  |  |  ------------------
  |  |  898|  75.5k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 75.5k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  75.5k|        } else {                                                                  \
  |  |  919|  75.5k|            /* Not a loop edge */                                                 \
  |  |  920|  75.5k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 75.5k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  75.5k|            } else {                                                              \
  |  |  925|  75.5k|                last_added = vertex;                                              \
  |  |  926|  75.5k|            }                                                                     \
  |  |  927|  75.5k|        }                                                                         \
  |  |  928|  75.5k|    }
  ------------------
 1060|   137k|            VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|   137k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1061|   137k|        }
 1062|       |
 1063|   609k|    }
 1064|   777k|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|   777k|    do { \
  |  |  657|   777k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   777k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   777k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 777k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   777k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 777k]
  |  |  ------------------
  ------------------
 1065|       |
 1066|   777k|    return IGRAPH_SUCCESS;
 1067|   777k|#undef DEDUPLICATE_IF_NEEDED
 1068|   777k|}
igraph_is_directed:
 1133|  6.46M|igraph_bool_t igraph_is_directed(const igraph_t *graph) {
 1134|  6.46M|    return graph->directed;
 1135|  6.46M|}
igraph_degree:
 1272|  51.9k|) {
 1273|       |
 1274|  51.9k|    igraph_int_t nodes_to_calc;
 1275|  51.9k|    igraph_int_t i, j;
 1276|  51.9k|    igraph_vit_t vit;
 1277|       |
 1278|  51.9k|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|  51.9k|    do { \
  |  |  657|  51.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  51.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  51.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 51.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  51.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 51.9k]
  |  |  ------------------
  ------------------
 1279|  51.9k|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|  51.9k|    do { \
  |  |  604|  51.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  51.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  51.9k|         * incorrect destructor function with the pointer */ \
  |  |  607|  51.9k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 51.9k]
  |  |  ------------------
  |  |  608|  51.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  51.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 51.9k]
  |  |  ------------------
  ------------------
 1280|       |
 1281|  51.9k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1281:9): [True: 41.5k, False: 10.4k]
  |  Branch (1281:31): [True: 38.0k, False: 3.54k]
  |  Branch (1281:52): [True: 0, False: 38.0k]
  ------------------
 1282|      0|        IGRAPH_ERROR("Invalid mode for degree calculation.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1283|      0|    }
 1284|       |
 1285|  51.9k|    if (loops == IGRAPH_NO_LOOPS || loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1285:9): [True: 0, False: 51.9k]
  |  Branch (1285:37): [True: 0, False: 51.9k]
  ------------------
 1286|       |        /* If the graph is known not to have loops, we can use the faster
 1287|       |         * loops == IGRAPH_LOOPS_TWICE code path, which has O(1) complexity
 1288|       |         * instead of of O(d). */
 1289|      0|        if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1289:13): [True: 0, False: 0]
  ------------------
 1290|      0|            !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1290:13): [True: 0, False: 0]
  ------------------
 1291|      0|            loops = IGRAPH_LOOPS_TWICE;
 1292|      0|        }
 1293|      0|    }
 1294|       |
 1295|  51.9k|    if (loops == IGRAPH_LOOPS_ONCE && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1295:9): [True: 0, False: 51.9k]
  |  Branch (1295:39): [True: 0, False: 0]
  ------------------
 1296|       |        /* We can use the faster loops == IGRAPH_LOOPS_TWICE path again */
 1297|      0|        loops = IGRAPH_LOOPS_TWICE;
 1298|      0|    }
 1299|       |
 1300|  51.9k|    nodes_to_calc = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|  51.9k|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
 1301|  51.9k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1301:9): [True: 12.1k, False: 39.8k]
  ------------------
 1302|  12.1k|        mode = IGRAPH_ALL;
 1303|  12.1k|    }
 1304|       |
 1305|  51.9k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes_to_calc));
  ------------------
  |  |  656|  51.9k|    do { \
  |  |  657|  51.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  51.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  51.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 51.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  51.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 51.9k]
  |  |  ------------------
  ------------------
 1306|  51.9k|    igraph_vector_int_null(res);
 1307|       |
 1308|  51.9k|    if (loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1308:9): [True: 51.9k, False: 0]
  ------------------
 1309|  51.9k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1309:13): [True: 48.4k, False: 3.54k]
  ------------------
 1310|  48.4k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  48.4k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1311|  2.15M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  2.15M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1311:18): [True: 2.10M, False: 48.4k]
  ------------------
 1312|  2.10M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  2.10M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1313|  2.10M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  2.10M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 2.10M, False: 0]
  |  |  ------------------
  |  |  215|  2.10M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1314|  2.10M|                VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.10M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.10M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.10M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1315|  2.10M|            }
 1316|  48.4k|        }
 1317|  51.9k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1317:13): [True: 41.5k, False: 10.4k]
  ------------------
 1318|  41.5k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  41.5k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1319|  1.84M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  1.84M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1319:18): [True: 1.80M, False: 41.5k]
  ------------------
 1320|  1.80M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  1.80M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1321|  1.80M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  1.80M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 1.80M, False: 0]
  |  |  ------------------
  |  |  215|  1.80M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1322|  1.80M|                VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.80M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.80M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.80M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1323|  1.80M|            }
 1324|  41.5k|        }
 1325|  51.9k|    } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1325:16): [True: 0, False: 0]
  ------------------
 1326|      0|        IGRAPH_ASSERT((mode & IGRAPH_ALL) == IGRAPH_ALL);
  ------------------
  |  |  924|      0|    do { \
  |  |  925|      0|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1327|       |
 1328|       |        /* We arbitrarily count loop edges in the (mode & IGRAPH_OUT) branch but
 1329|       |         * not in the (mode & IGRAPH_IN) branch */
 1330|       |
 1331|      0|        if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (1331:13): [True: 0, False: 0]
  ------------------
 1332|       |            // When calculating degree for all vertices, iterating over edges is faster
 1333|      0|            igraph_int_t no_of_edges = igraph_ecount(graph);
 1334|       |
 1335|       |            /* mode & IGRAPH_OUT branch */
 1336|      0|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1336:41): [True: 0, False: 0]
  ------------------
 1337|      0|                igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1338|      0|                VECTOR(*res)[from]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1339|      0|            }
 1340|       |
 1341|       |            /* mode & IGRAPH_IN branch */
 1342|      0|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1342:41): [True: 0, False: 0]
  ------------------
 1343|      0|                igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1344|      0|                if (IGRAPH_FROM(graph, edge) != to) {
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1344:21): [True: 0, False: 0]
  ------------------
 1345|      0|                    VECTOR(*res)[to]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1346|      0|                }
 1347|      0|            }
 1348|      0|        } else {
 1349|       |            /* mode & IGRAPH_OUT branch */
 1350|      0|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1351|      0|                !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1351:17): [True: 0, False: 0]
  ------------------
 1352|      0|                IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1353|      0|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|      0|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  215|      0|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1354|      0|                VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1355|      0|            }
 1356|       |
 1357|       |            /* mode & IGRAPH_IN branch */
 1358|      0|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1359|      0|                !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1359:17): [True: 0, False: 0]
  ------------------
 1360|      0|                IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1361|      0|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|      0|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  215|      0|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1362|      0|                VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1363|      0|                for (j = VECTOR(graph->is)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1364|      0|                    j < VECTOR(graph->is)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1364:21): [True: 0, False: 0]
  ------------------
 1365|      0|                    if (VECTOR(graph->from)[ VECTOR(graph->ii)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  if (VECTOR(graph->from)[ VECTOR(graph->ii)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1365:25): [True: 0, False: 0]
  ------------------
 1366|      0|                        VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1367|      0|                    }
 1368|      0|                }
 1369|      0|            }
 1370|      0|        }
 1371|      0|    } else {
 1372|       |        /* no loops should be counted */
 1373|      0|        if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (1373:13): [True: 0, False: 0]
  ------------------
 1374|       |            // When calculating degree for all vertices, iterating over edges is faster
 1375|      0|            igraph_int_t no_of_edges = igraph_ecount(graph);
 1376|       |
 1377|      0|            if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1377:17): [True: 0, False: 0]
  ------------------
 1378|      0|                for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1378:45): [True: 0, False: 0]
  ------------------
 1379|      0|                    igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1380|      0|                    if (from != IGRAPH_TO(graph, edge)) {
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1380:25): [True: 0, False: 0]
  ------------------
 1381|      0|                        VECTOR(*res)[from]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1382|      0|                    }
 1383|      0|                }
 1384|      0|            }
 1385|      0|            if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1385:17): [True: 0, False: 0]
  ------------------
 1386|      0|                for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1386:45): [True: 0, False: 0]
  ------------------
 1387|      0|                    igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1388|      0|                    if (IGRAPH_FROM(graph, edge) != to) {
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1388:25): [True: 0, False: 0]
  ------------------
 1389|      0|                        VECTOR(*res)[to]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1390|      0|                    }
 1391|      0|                }
 1392|      0|            }
 1393|      0|        } else {
 1394|      0|            if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1394:17): [True: 0, False: 0]
  ------------------
 1395|      0|                for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1396|      0|                    !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1396:21): [True: 0, False: 0]
  ------------------
 1397|      0|                    IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1398|      0|                    igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|      0|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  215|      0|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1399|      0|                    VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1400|      0|                    for (j = VECTOR(graph->os)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1401|      0|                        j < VECTOR(graph->os)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1401:25): [True: 0, False: 0]
  ------------------
 1402|      0|                        if (VECTOR(graph->to)[ VECTOR(graph->oi)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      if (VECTOR(graph->to)[ VECTOR(graph->oi)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1402:29): [True: 0, False: 0]
  ------------------
 1403|      0|                            VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1404|      0|                        }
 1405|      0|                    }
 1406|      0|                }
 1407|      0|            }
 1408|      0|            if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1408:17): [True: 0, False: 0]
  ------------------
 1409|      0|                for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1410|      0|                    !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1410:21): [True: 0, False: 0]
  ------------------
 1411|      0|                    IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1412|      0|                    igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|      0|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  215|      0|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1413|      0|                    VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1414|      0|                    for (j = VECTOR(graph->is)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1415|      0|                        j < VECTOR(graph->is)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1415:25): [True: 0, False: 0]
  ------------------
 1416|      0|                        if (VECTOR(graph->from)[ VECTOR(graph->ii)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      if (VECTOR(graph->from)[ VECTOR(graph->ii)[j] ] == vid) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1416:29): [True: 0, False: 0]
  ------------------
 1417|      0|                            VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1418|      0|                        }
 1419|      0|                    }
 1420|      0|                }
 1421|      0|            }
 1422|      0|        }
 1423|      0|    }
 1424|       |
 1425|  51.9k|    igraph_vit_destroy(&vit);
 1426|  51.9k|    IGRAPH_FINALLY_CLEAN(1);
 1427|       |
 1428|  51.9k|    return IGRAPH_SUCCESS;
 1429|  51.9k|}
igraph_incident:
 1782|  3.71M|) {
 1783|  3.71M|    igraph_int_t length = 0, idx = 0;
 1784|  3.71M|    igraph_int_t i, j;
 1785|  3.71M|    igraph_int_t node = pnode;
 1786|  3.71M|    igraph_bool_t directed = igraph_is_directed(graph);
 1787|       |
 1788|  3.71M|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (1788:9): [True: 0, False: 3.71M]
  |  Branch (1788:21): [True: 0, False: 3.71M]
  ------------------
 1789|      0|        IGRAPH_ERRORF("Vertex %" IGRAPH_PRId " is not in the graph.", IGRAPH_EINVVID, node);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1790|      0|    }
 1791|  3.71M|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN &&
  ------------------
  |  Branch (1791:9): [True: 2.64M, False: 1.07M]
  |  Branch (1791:31): [True: 2.33M, False: 309k]
  ------------------
 1792|  2.33M|        mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1792:9): [True: 0, False: 2.33M]
  ------------------
 1793|      0|        IGRAPH_ERROR("Mode should be either IGRAPH_OUT, IGRAPH_IN or IGRAPH_ALL.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1794|      0|    }
 1795|       |
 1796|  3.71M|    if (!directed) {
  ------------------
  |  Branch (1796:9): [True: 1.65M, False: 2.05M]
  ------------------
 1797|  1.65M|        mode = IGRAPH_ALL;
 1798|  1.65M|    }
 1799|       |
 1800|  3.71M|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1800:9): [True: 1.23M, False: 2.48M]
  |  Branch (1800:31): [True: 922k, False: 309k]
  ------------------
 1801|       |        /*
 1802|       |        IGRAPH_ERROR("For a directed graph (with directions not ignored), "
 1803|       |                     "IGRAPH_LOOPS_TWICE does not make sense.", IGRAPH_EINVAL);
 1804|       |        */
 1805|   922k|        loops = IGRAPH_LOOPS_ONCE;
 1806|   922k|    }
 1807|       |
 1808|       |    /* Calculate needed space first & allocate it */
 1809|       |    /* Note that 'mode' is treated as a bit field here; it's okay because
 1810|       |     * IGRAPH_ALL = IGRAPH_IN | IGRAPH_OUT, bit-wise */
 1811|  3.71M|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1811:9): [True: 3.40M, False: 309k]
  ------------------
 1812|  3.40M|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  3.40M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  3.40M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1813|  3.40M|    }
 1814|  3.71M|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1814:9): [True: 2.79M, False: 922k]
  ------------------
 1815|  2.79M|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  2.79M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  2.79M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1816|  2.79M|    }
 1817|       |
 1818|  3.71M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  3.71M|    do { \
  |  |  657|  3.71M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.71M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.71M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.71M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.71M]
  |  |  ------------------
  ------------------
 1819|       |
 1820|       |    /* The loops below produce an ordering what is consistent with the
 1821|       |     * ordering returned by igraph_neighbors(), and this should be preserved.
 1822|       |     * We are dealing with two sorted lists; one for the successors and one
 1823|       |     * for the predecessors. If we have requested only one of them, we have
 1824|       |     * an easy job. If we have requested both, we need to merge the two lists
 1825|       |     * to ensure that the output is sorted by the vertex IDs of the "other"
 1826|       |     * endpoint of the affected edges */
 1827|  3.71M|    if (!directed || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1827:9): [True: 1.65M, False: 2.05M]
  |  Branch (1827:22): [True: 1.23M, False: 825k]
  ------------------
 1828|       |        /* We did not ask for both directions; this is the easy case */
 1829|       |
 1830|  2.89M|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1830:13): [True: 2.58M, False: 309k]
  ------------------
 1831|  2.58M|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|  2.58M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1832|  3.60M|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|  2.58M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1832:47): [True: 1.02M, False: 2.58M]
  ------------------
 1833|  1.02M|                igraph_int_t edge = VECTOR(graph->oi)[i];
  ------------------
  |  |   60|  1.02M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1834|  1.02M|                igraph_int_t other = VECTOR(graph->to)[edge];
  ------------------
  |  |   60|  1.02M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1835|  1.02M|                if (loops == IGRAPH_NO_LOOPS && other == pnode) {
  ------------------
  |  Branch (1835:21): [True: 0, False: 1.02M]
  |  Branch (1835:49): [True: 0, False: 0]
  ------------------
 1836|      0|                    length--;
 1837|  1.02M|                } else {
 1838|  1.02M|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|  1.02M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1839|  1.02M|                }
 1840|  1.02M|            }
 1841|  2.58M|        }
 1842|       |
 1843|  2.89M|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1843:13): [True: 1.96M, False: 922k]
  ------------------
 1844|  1.96M|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|  1.96M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1845|  2.68M|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|  1.96M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1845:47): [True: 720k, False: 1.96M]
  ------------------
 1846|   720k|                igraph_int_t edge = VECTOR(graph->ii)[i];
  ------------------
  |  |   60|   720k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1847|   720k|                igraph_int_t other = VECTOR(graph->from)[edge];
  ------------------
  |  |   60|   720k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1848|   720k|                if ((loops == IGRAPH_NO_LOOPS || (loops == IGRAPH_LOOPS_ONCE && !directed)) && other == pnode) {
  ------------------
  |  Branch (1848:22): [True: 0, False: 720k]
  |  Branch (1848:51): [True: 153k, False: 566k]
  |  Branch (1848:81): [True: 0, False: 153k]
  |  Branch (1848:96): [True: 0, False: 0]
  ------------------
 1849|      0|                    length--;
 1850|   720k|                } else {
 1851|   720k|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|   720k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1852|   720k|                }
 1853|   720k|            }
 1854|  1.96M|        }
 1855|  2.89M|    } else {
 1856|       |        /* both in- and out- neighbors in a directed graph,
 1857|       |           we need to merge the two 'vectors' */
 1858|   825k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   825k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1859|   825k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   825k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1860|   825k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   825k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1861|   825k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   825k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1862|   825k|        igraph_int_t eid1, eid2;
 1863|   825k|        igraph_int_t n1, n2;
 1864|   825k|        igraph_bool_t seen_loop_edge = false;
 1865|       |
 1866|  1.27M|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1866:16): [True: 573k, False: 697k]
  |  Branch (1866:27): [True: 444k, False: 128k]
  ------------------
 1867|   444k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   444k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1868|   444k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   444k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1869|   444k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   444k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1870|   444k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   444k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1871|   444k|            if (n1 < n2) {
  ------------------
  |  Branch (1871:17): [True: 147k, False: 296k]
  ------------------
 1872|   147k|                i1++;
 1873|   147k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|   147k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1874|   296k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1874:24): [True: 151k, False: 144k]
  ------------------
 1875|   151k|                i2++;
 1876|   151k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1877|   151k|            } else if (n1 != pnode) {
  ------------------
  |  Branch (1877:24): [True: 23.4k, False: 121k]
  ------------------
 1878|       |                /* multiple edge */
 1879|  23.4k|                i1++;
 1880|  23.4k|                i2++;
 1881|  23.4k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  23.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1882|  23.4k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  23.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1883|   121k|            } else {
 1884|       |                /* loop edge */
 1885|   121k|                i1++;
 1886|   121k|                i2++;
 1887|   121k|                if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (1887:21): [True: 0, False: 121k]
  ------------------
 1888|      0|                    length -= 2;
 1889|   121k|                } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1889:28): [True: 72.8k, False: 48.5k]
  ------------------
 1890|  72.8k|                    length--;
 1891|  72.8k|                    if (!seen_loop_edge) {
  ------------------
  |  Branch (1891:25): [True: 37.6k, False: 35.1k]
  ------------------
 1892|  37.6k|                        VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  37.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1893|  37.6k|                    } else {
 1894|  35.1k|                        VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  35.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1895|  35.1k|                    }
 1896|  72.8k|                    seen_loop_edge = !seen_loop_edge;
 1897|  72.8k|                } else {
 1898|  48.5k|                    VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  48.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1899|  48.5k|                    VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  48.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1900|  48.5k|                }
 1901|   121k|            }
 1902|   444k|        }
 1903|       |
 1904|  1.03M|        while (i1 < j1) {
  ------------------
  |  Branch (1904:16): [True: 207k, False: 825k]
  ------------------
 1905|   207k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|   207k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1906|   207k|            VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|   207k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1907|   207k|        }
 1908|       |
 1909|  1.02M|        while (i2 < j2) {
  ------------------
  |  Branch (1909:16): [True: 203k, False: 825k]
  ------------------
 1910|   203k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|   203k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1911|   203k|            VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|   203k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1912|   203k|        }
 1913|   825k|    }
 1914|  3.71M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  3.71M|    do { \
  |  |  657|  3.71M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.71M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.71M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.71M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.71M]
  |  |  ------------------
  ------------------
 1915|  3.71M|    return IGRAPH_SUCCESS;
 1916|  3.71M|}
type_indexededgelist.c:igraph_i_create_start_vectors:
 1076|  84.2k|        igraph_vector_int_t *iindex, igraph_int_t nodes) {
 1077|       |
 1078|  84.2k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
 1079|       |
 1080|  84.2k|    igraph_int_t no_of_nodes;
 1081|  84.2k|    igraph_int_t no_of_edges;
 1082|  84.2k|    igraph_int_t i, j, idx;
 1083|       |
 1084|  84.2k|    no_of_nodes = nodes;
 1085|  84.2k|    no_of_edges = igraph_vector_int_size(el);
 1086|       |
 1087|       |    /* result */
 1088|       |
 1089|  84.2k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes + 1));
  ------------------
  |  |  656|  84.2k|    do { \
  |  |  657|  84.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  84.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  84.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  84.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 84.2k]
  |  |  ------------------
  ------------------
 1090|       |
 1091|       |    /* create the index */
 1092|       |
 1093|  84.2k|    if (no_of_edges == 0) {
  ------------------
  |  Branch (1093:9): [True: 38, False: 84.1k]
  ------------------
 1094|       |        /* empty graph */
 1095|     38|        igraph_vector_int_null(res);
 1096|  84.1k|    } else {
 1097|  84.1k|        idx = -1;
 1098|   440k|        for (i = 0; i <= EDGE(0); i++) {
  ------------------
  |  | 1078|   440k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   440k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   440k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1098:21): [True: 355k, False: 84.1k]
  ------------------
 1099|   355k|            idx++; VECTOR(*res)[idx] = 0;
  ------------------
  |  |   60|   355k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1100|   355k|        }
 1101|  1.17M|        for (i = 1; i < no_of_edges; i++) {
  ------------------
  |  Branch (1101:21): [True: 1.09M, False: 84.1k]
  ------------------
 1102|  1.09M|            igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|  1.09M|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|  1.09M|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  1.09M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1103|  2.63M|            for (j = 0; j < n; j++) {
  ------------------
  |  Branch (1103:25): [True: 1.54M, False: 1.09M]
  ------------------
 1104|  1.54M|                idx++; VECTOR(*res)[idx] = i;
  ------------------
  |  |   60|  1.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1105|  1.54M|            }
 1106|  1.09M|        }
 1107|  84.1k|        j = EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|  84.1k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  84.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  84.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1108|  1.02M|        for (i = 0; i < no_of_nodes - j; i++) {
  ------------------
  |  Branch (1108:21): [True: 938k, False: 84.1k]
  ------------------
 1109|   938k|            idx++; VECTOR(*res)[idx] = no_of_edges;
  ------------------
  |  |   60|   938k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1110|   938k|        }
 1111|  84.1k|    }
 1112|       |
 1113|       |    /* clean */
 1114|       |
 1115|  84.2k|# undef EDGE
 1116|  84.2k|    return IGRAPH_SUCCESS;
 1117|  84.2k|}

igraph_qsort:
  264|  1.49M|{
  265|       |	local_qsort(a, n, es, cmp, NULL);
  266|  1.49M|}
qsort.c:local_qsort:
  121|  1.79M|{
  122|  1.79M|	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
  123|  1.79M|	size_t d1, d2;
  124|  1.79M|	int cmp_result;
  125|  1.79M|	int swap_cnt;
  126|       |
  127|       |    /* if there are less than 2 elements, then sorting is not needed */
  128|  1.79M|    if (IGRAPH_UNLIKELY(n < 2))
  ------------------
  |  |  612|  1.79M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 1.30M, False: 498k]
  |  |  ------------------
  ------------------
  129|  1.30M|        return;
  130|   856k|loop:
  131|   856k|	swap_cnt = 0;
  132|   856k|	if (n < 7) {
  ------------------
  |  Branch (132:6): [True: 454k, False: 402k]
  ------------------
  133|  1.59M|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (133:29): [True: 1.13M, False: 454k]
  ------------------
  134|  1.13M|			for (pl = pm;
  135|  2.10M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|  1.79M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (135:9): [True: 1.79M, False: 311k]
  |  Branch (135:27): [True: 969k, False: 828k]
  ------------------
  136|  1.13M|			     pl -= es)
  137|   969k|				swapfunc(pl, pl - es, es);
  138|   454k|		return;
  139|   454k|	}
  140|   402k|	pm = (char *)a + (n / 2) * es;
  141|   402k|	if (n > 7) {
  ------------------
  |  Branch (141:6): [True: 358k, False: 43.3k]
  ------------------
  142|   358k|		pl = a;
  143|   358k|		pn = (char *)a + (n - 1) * es;
  144|   358k|		if (n > 40) {
  ------------------
  |  Branch (144:7): [True: 48.0k, False: 310k]
  ------------------
  145|  48.0k|			size_t d = (n / 8) * es;
  146|       |
  147|  48.0k|			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
  148|  48.0k|			pm = med3(pm - d, pm, pm + d, cmp, thunk);
  149|  48.0k|			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
  150|  48.0k|		}
  151|   358k|		pm = med3(pl, pm, pn, cmp, thunk);
  152|   358k|	}
  153|   402k|	swapfunc(a, pm, es);
  154|   402k|	pa = pb = (char *)a + es;
  155|       |
  156|   402k|	pc = pd = (char *)a + (n - 1) * es;
  157|  1.43M|	for (;;) {
  158|  5.69M|		while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {
  ------------------
  |  |   95|  5.43M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (158:10): [True: 5.43M, False: 261k]
  |  Branch (158:22): [True: 4.25M, False: 1.17M]
  ------------------
  159|  4.25M|			if (cmp_result == 0) {
  ------------------
  |  Branch (159:8): [True: 607k, False: 3.64M]
  ------------------
  160|   607k|				swap_cnt = 1;
  161|   607k|				swapfunc(pa, pb, es);
  162|   607k|				pa += es;
  163|   607k|			}
  164|  4.25M|			pb += es;
  165|  4.25M|		}
  166|  3.23M|		while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {
  ------------------
  |  |   95|  2.82M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (166:10): [True: 2.82M, False: 402k]
  |  Branch (166:22): [True: 1.79M, False: 1.03M]
  ------------------
  167|  1.79M|			if (cmp_result == 0) {
  ------------------
  |  Branch (167:8): [True: 86.2k, False: 1.70M]
  ------------------
  168|  86.2k|				swap_cnt = 1;
  169|  86.2k|				swapfunc(pc, pd, es);
  170|  86.2k|				pd -= es;
  171|  86.2k|			}
  172|  1.79M|			pc -= es;
  173|  1.79M|		}
  174|  1.43M|		if (pb > pc)
  ------------------
  |  Branch (174:7): [True: 402k, False: 1.03M]
  ------------------
  175|   402k|			break;
  176|  1.03M|		swapfunc(pb, pc, es);
  177|  1.03M|		swap_cnt = 1;
  178|  1.03M|		pb += es;
  179|  1.03M|		pc -= es;
  180|  1.03M|	}
  181|   402k|	if (swap_cnt == 0) {  /* Switch to insertion sort */
  ------------------
  |  Branch (181:6): [True: 32.1k, False: 370k]
  ------------------
  182|   483k|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (182:29): [True: 451k, False: 32.1k]
  ------------------
  183|   451k|			for (pl = pm;
  184|  1.05M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|   999k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (184:9): [True: 999k, False: 55.7k]
  |  Branch (184:27): [True: 603k, False: 396k]
  ------------------
  185|   603k|			     pl -= es)
  186|   603k|				swapfunc(pl, pl - es, es);
  187|  32.1k|		return;
  188|  32.1k|	}
  189|       |
  190|   370k|	pn = (char *)a + n * es;
  191|   370k|	d1 = MIN(pa - (char *)a, pb - pa);
  ------------------
  |  |   69|   370k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 316k, False: 53.3k]
  |  |  ------------------
  ------------------
  192|   370k|	vecswap(a, pb - d1, d1);
  ------------------
  |  |   88|   370k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 351k, False: 19.0k]
  |  |  ------------------
  ------------------
  193|       |	/*
  194|       |	 * Cast es to preserve signedness of right-hand side of MIN()
  195|       |	 * expression, to avoid sign ambiguity in the implied comparison.  es
  196|       |	 * is safely within [0, SSIZE_MAX].
  197|       |	 */
  198|   370k|	d1 = MIN(pd - pc, pn - pd - (ptrdiff_t)es);
  ------------------
  |  |   69|   370k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 6.33k, False: 363k]
  |  |  ------------------
  ------------------
  199|   370k|	vecswap(pb, pn - d1, d1);
  ------------------
  |  |   88|   370k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 36.4k, False: 333k]
  |  |  ------------------
  ------------------
  200|       |
  201|   370k|	d1 = pb - pa;
  202|   370k|	d2 = pd - pc;
  203|   370k|	if (d1 <= d2) {
  ------------------
  |  Branch (203:6): [True: 133k, False: 236k]
  ------------------
  204|       |		/* Recurse on left partition, then iterate on right partition */
  205|   133k|		if (d1 > es) {
  ------------------
  |  Branch (205:7): [True: 101k, False: 32.2k]
  ------------------
  206|   101k|			local_qsort(a, d1 / es, es, cmp, thunk);
  207|   101k|		}
  208|   133k|		if (d2 > es) {
  ------------------
  |  Branch (208:7): [True: 123k, False: 10.2k]
  ------------------
  209|       |			/* Iterate rather than recurse to save stack space */
  210|       |			/* qsort(pn - d2, d2 / es, es, cmp); */
  211|   123k|			a = pn - d2;
  212|   123k|			n = d2 / es;
  213|   123k|			goto loop;
  214|   123k|		}
  215|   236k|	} else {
  216|       |		/* Recurse on right partition, then iterate on left partition */
  217|   236k|		if (d2 > es) {
  ------------------
  |  Branch (217:7): [True: 200k, False: 36.1k]
  ------------------
  218|   200k|			local_qsort(pn - d2, d2 / es, es, cmp, thunk);
  219|   200k|		}
  220|   236k|		if (d1 > es) {
  ------------------
  |  Branch (220:7): [True: 235k, False: 1.30k]
  ------------------
  221|       |			/* Iterate rather than recurse to save stack space */
  222|       |			/* qsort(a, d1 / es, es, cmp); */
  223|   235k|			n = d1 / es;
  224|   235k|			goto loop;
  225|   235k|		}
  226|   236k|	}
  227|   370k|}
qsort.c:swapfunc:
   77|  4.08M|{
   78|  4.08M|	char t;
   79|       |
   80|  38.9M|	do {
   81|  38.9M|		t = *a;
   82|  38.9M|		*a++ = *b;
   83|  38.9M|		*b++ = t;
   84|  38.9M|	} while (--es > 0);
  ------------------
  |  Branch (84:11): [True: 34.8M, False: 4.08M]
  ------------------
   85|  4.08M|}
qsort.c:med3:
  104|   503k|{
  105|   503k|	return CMP(thunk, a, b) < 0 ?
  ------------------
  |  |   95|   503k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (105:9): [True: 197k, False: 305k]
  ------------------
  106|   197k|	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|   197k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|  96.3k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (106:10): [True: 100k, False: 96.3k]
  |  Branch (106:38): [True: 43.4k, False: 52.8k]
  ------------------
  107|   503k|	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   305k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   267k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (107:10): [True: 38.7k, False: 267k]
  |  Branch (107:38): [True: 42.2k, False: 224k]
  ------------------
  108|   503k|}

igraph_cmp_epsilon:
   97|   268k|int igraph_cmp_epsilon(double a, double b, double eps) {
   98|   268k|    double diff;
   99|   268k|    double abs_diff;
  100|   268k|    double sum;
  101|       |
  102|   268k|    if (a == b) {
  ------------------
  |  Branch (102:9): [True: 72.2k, False: 196k]
  ------------------
  103|       |        /* shortcut, handles infinities */
  104|  72.2k|        return 0;
  105|  72.2k|    }
  106|       |
  107|   196k|    diff = a - b;
  108|   196k|    abs_diff = fabs(diff);
  109|   196k|    sum = fabs(a) + fabs(b);
  110|       |
  111|   196k|    if (a == 0 || b == 0 || sum < DBL_MIN) {
  ------------------
  |  Branch (111:9): [True: 143k, False: 52.6k]
  |  Branch (111:19): [True: 18.8k, False: 33.8k]
  |  Branch (111:29): [True: 0, False: 33.8k]
  ------------------
  112|       |        /* a or b is zero or both are extremely close to it; relative
  113|       |         * error is less meaningful here so just compare it with
  114|       |         * epsilon */
  115|   162k|        return abs_diff < (eps * DBL_MIN) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (115:16): [True: 0, False: 162k]
  |  Branch (115:50): [True: 143k, False: 18.8k]
  ------------------
  116|   162k|    } else if (!isfinite(sum)) {
  ------------------
  |  Branch (116:16): [True: 14.6k, False: 19.1k]
  ------------------
  117|       |        /* addition overflow, so presumably |a| and |b| are both large; use a
  118|       |         * different formulation */
  119|  14.6k|        return (abs_diff < (eps * fabs(a) + eps * fabs(b))) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (119:16): [True: 0, False: 14.6k]
  |  Branch (119:68): [True: 14.6k, False: 0]
  ------------------
  120|  19.1k|    } else {
  121|  19.1k|        return (abs_diff / sum < eps) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (121:16): [True: 71, False: 19.1k]
  |  Branch (121:46): [True: 9.41k, False: 9.69k]
  ------------------
  122|  19.1k|    }
  123|   196k|}

igraph_get_edgelist:
  327|  7.81k|igraph_error_t igraph_get_edgelist(const igraph_t *graph, igraph_vector_int_t *res, igraph_bool_t bycol) {
  328|  7.81k|    return igraph_edges(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), res, bycol);
  329|  7.81k|}
igraph_to_undirected:
  498|  3.54k|                         const igraph_attribute_combination_t *edge_comb) {
  499|       |
  500|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  501|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  502|  3.54k|    igraph_vector_int_t edges;
  503|  3.54k|    igraph_t newgraph;
  504|  3.54k|    igraph_bool_t attr = edge_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (504:26): [True: 3.54k, False: 0]
  |  Branch (504:39): [True: 3.54k, False: 0]
  ------------------
  505|       |
  506|  3.54k|    if (mode != IGRAPH_TO_UNDIRECTED_EACH &&
  ------------------
  |  Branch (506:9): [True: 3.54k, False: 0]
  ------------------
  507|  3.54k|        mode != IGRAPH_TO_UNDIRECTED_COLLAPSE &&
  ------------------
  |  Branch (507:9): [True: 0, False: 3.54k]
  ------------------
  508|      0|        mode != IGRAPH_TO_UNDIRECTED_MUTUAL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 0]
  ------------------
  509|      0|        IGRAPH_ERROR("Cannot undirect graph, invalid mode.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  510|      0|    }
  511|       |
  512|  3.54k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (512:9): [True: 0, False: 3.54k]
  ------------------
  513|      0|        return IGRAPH_SUCCESS;
  514|      0|    }
  515|       |
  516|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  517|       |
  518|  3.54k|    if (mode == IGRAPH_TO_UNDIRECTED_EACH) {
  ------------------
  |  Branch (518:9): [True: 0, False: 3.54k]
  ------------------
  519|      0|        igraph_es_t es;
  520|      0|        igraph_eit_t eit;
  521|       |
  522|      0|        IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  523|      0|        IGRAPH_CHECK(igraph_es_all(&es, IGRAPH_EDGEORDER_ID));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  524|      0|        IGRAPH_FINALLY(igraph_es_destroy, &es);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  525|      0|        IGRAPH_CHECK(igraph_eit_create(graph, es, &eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  526|      0|        IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  527|       |
  528|      0|        while (!IGRAPH_EIT_END(eit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
  |  Branch (528:16): [True: 0, False: 0]
  ------------------
  529|      0|            igraph_int_t edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  530|      0|            IGRAPH_CHECK(igraph_vector_int_push_back(&edges, IGRAPH_FROM(graph, edge)));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  531|      0|            IGRAPH_CHECK(igraph_vector_int_push_back(&edges, IGRAPH_TO(graph, edge)));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  532|      0|            IGRAPH_EIT_NEXT(eit);
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  533|      0|        }
  534|       |
  535|      0|        igraph_eit_destroy(&eit);
  536|      0|        igraph_es_destroy(&es);
  537|      0|        IGRAPH_FINALLY_CLEAN(2);
  538|       |
  539|      0|        IGRAPH_CHECK(igraph_create(&newgraph, &edges,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  540|      0|                                   no_of_nodes,
  541|      0|                                   IGRAPH_UNDIRECTED));
  542|      0|        IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  543|      0|        igraph_vector_int_destroy(&edges);
  544|      0|        IGRAPH_CHECK(igraph_i_attribute_copy(&newgraph, graph, true, true, true));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  545|      0|        IGRAPH_FINALLY_CLEAN(2);
  546|      0|        igraph_destroy(graph);
  547|      0|        *graph = newgraph;
  548|       |
  549|  3.54k|    } else if (mode == IGRAPH_TO_UNDIRECTED_COLLAPSE) {
  ------------------
  |  Branch (549:16): [True: 3.54k, False: 0]
  ------------------
  550|  3.54k|        igraph_vector_int_t inadj, outadj;
  551|  3.54k|        igraph_vector_int_t mergeinto;
  552|  3.54k|        igraph_int_t actedge = 0;
  553|       |
  554|  3.54k|        if (attr) {
  ------------------
  |  Branch (554:13): [True: 3.54k, False: 0]
  ------------------
  555|  3.54k|            IGRAPH_VECTOR_INT_INIT_FINALLY(&mergeinto, no_of_edges);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  556|  3.54k|        }
  557|       |
  558|  3.54k|        IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  559|  3.54k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&inadj, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  560|  3.54k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&outadj, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  561|       |
  562|   158k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (562:34): [True: 154k, False: 3.54k]
  ------------------
  563|   154k|            igraph_int_t n_out, n_in;
  564|   154k|            igraph_int_t p1 = -1, p2 = -1;
  565|   154k|            igraph_int_t e1 = 0, e2 = 0, n1 = 0, n2 = 0, last;
  566|   154k|            IGRAPH_CHECK(igraph_incident(graph, &outadj, i, IGRAPH_OUT, IGRAPH_LOOPS));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  567|   154k|            IGRAPH_CHECK(igraph_incident(graph, &inadj, i, IGRAPH_IN, IGRAPH_LOOPS));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  568|   154k|            n_out = igraph_vector_int_size(&outadj);
  569|   154k|            n_in = igraph_vector_int_size(&inadj);
  570|       |
  571|   154k|#define STEPOUT() if ( (++p1) < n_out) {    \
  572|   154k|        e1 = VECTOR(outadj)[p1]; \
  573|   154k|        n1 = IGRAPH_TO(graph, e1);      \
  574|   154k|    }
  575|   154k|#define STEPIN()  if ( (++p2) < n_in) {         \
  576|   154k|        e2 = VECTOR(inadj )[p2]; \
  577|   154k|        n2 = IGRAPH_FROM(graph, e2);        \
  578|   154k|    }
  579|   154k|#define ADD_NEW_EDGE() { \
  580|   154k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  581|   154k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  582|   154k|}
  583|   154k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  584|   154k|    if (attr) { \
  585|   154k|        VECTOR(mergeinto)[which] = actedge; \
  586|   154k|    } \
  587|   154k|}
  588|       |
  589|   154k|            STEPOUT();
  ------------------
  |  |  571|   154k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 31.9k, False: 123k]
  |  |  ------------------
  |  |  572|  31.9k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  31.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  31.9k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  31.9k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  31.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  31.9k|    }
  ------------------
  590|   154k|            STEPIN();
  ------------------
  |  |  575|   154k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 31.9k, False: 123k]
  |  |  ------------------
  |  |  576|  31.9k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  31.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  31.9k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  31.9k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  31.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  31.9k|    }
  ------------------
  591|       |
  592|   170k|            while (p1 < n_out && n1 <= i && p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (592:20): [True: 44.5k, False: 125k]
  |  Branch (592:34): [True: 32.5k, False: 12.0k]
  |  Branch (592:45): [True: 18.8k, False: 13.7k]
  |  Branch (592:58): [True: 15.2k, False: 3.56k]
  ------------------
  593|  15.2k|                last = (n1 <= n2) ? n1 : n2;
  ------------------
  |  Branch (593:24): [True: 8.07k, False: 7.19k]
  ------------------
  594|  15.2k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  15.2k|#define ADD_NEW_EDGE() { \
  |  |  580|  15.2k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  15.2k|    do { \
  |  |  |  |  657|  15.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  15.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  15.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 15.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  15.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 15.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  15.2k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  15.2k|    do { \
  |  |  |  |  657|  15.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  15.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  15.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 15.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  15.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 15.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  15.2k|}
  ------------------
  595|  23.3k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (595:24): [True: 20.7k, False: 2.63k]
  |  Branch (595:38): [True: 8.07k, False: 12.6k]
  ------------------
  596|  8.07k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  583|  8.07k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  8.07k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 8.07k, False: 0]
  |  |  ------------------
  |  |  585|  8.07k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  8.07k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  8.07k|    } \
  |  |  587|  8.07k|}
  ------------------
  597|  8.07k|                    STEPOUT();
  ------------------
  |  |  571|  8.07k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 5.44k, False: 2.63k]
  |  |  ------------------
  |  |  572|  5.44k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  5.44k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  5.44k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  5.44k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  5.44k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  5.44k|    }
  ------------------
  598|  8.07k|                }
  599|  24.0k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (599:24): [True: 21.3k, False: 2.70k]
  |  Branch (599:37): [True: 8.74k, False: 12.5k]
  ------------------
  600|  8.74k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  8.74k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  8.74k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 8.74k, False: 0]
  |  |  ------------------
  |  |  585|  8.74k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  8.74k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  8.74k|    } \
  |  |  587|  8.74k|}
  ------------------
  601|  8.74k|                    STEPIN();
  ------------------
  |  |  575|  8.74k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 6.03k, False: 2.70k]
  |  |  ------------------
  |  |  576|  6.03k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  6.03k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  6.03k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  6.03k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.03k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  6.03k|    }
  ------------------
  602|  8.74k|                }
  603|  15.2k|                actedge++;
  604|  15.2k|            }
  605|       |
  606|   175k|            while (p1 < n_out && n1 <= i) {
  ------------------
  |  Branch (606:20): [True: 35.9k, False: 139k]
  |  Branch (606:34): [True: 20.6k, False: 15.2k]
  ------------------
  607|  20.6k|                last = n1;
  608|  20.6k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  20.6k|#define ADD_NEW_EDGE() { \
  |  |  580|  20.6k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  20.6k|    do { \
  |  |  |  |  657|  20.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  20.6k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  20.6k|    do { \
  |  |  |  |  657|  20.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  20.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  20.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  20.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 20.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  20.6k|}
  ------------------
  609|  41.3k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (609:24): [True: 27.3k, False: 14.0k]
  |  Branch (609:38): [True: 20.6k, False: 6.64k]
  ------------------
  610|  20.6k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  583|  20.6k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  20.6k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 20.6k, False: 0]
  |  |  ------------------
  |  |  585|  20.6k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  20.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  20.6k|    } \
  |  |  587|  20.6k|}
  ------------------
  611|  20.6k|                    STEPOUT();
  ------------------
  |  |  571|  20.6k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 6.64k, False: 14.0k]
  |  |  ------------------
  |  |  572|  6.64k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  6.64k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  6.64k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  6.64k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.64k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  6.64k|    }
  ------------------
  612|  20.6k|                }
  613|  20.6k|                actedge++;
  614|  20.6k|            }
  615|       |
  616|   174k|            while (p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (616:20): [True: 35.4k, False: 139k]
  |  Branch (616:33): [True: 19.8k, False: 15.6k]
  ------------------
  617|  19.8k|                last = n2;
  618|  19.8k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  19.8k|#define ADD_NEW_EDGE() { \
  |  |  580|  19.8k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  19.8k|    do { \
  |  |  |  |  657|  19.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  19.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  19.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  19.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 19.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  19.8k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  19.8k|    do { \
  |  |  |  |  657|  19.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  19.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  19.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  19.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 19.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  19.8k|}
  ------------------
  619|  39.7k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (619:24): [True: 26.1k, False: 13.6k]
  |  Branch (619:37): [True: 19.8k, False: 6.28k]
  ------------------
  620|  19.8k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  19.8k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  19.8k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 19.8k, False: 0]
  |  |  ------------------
  |  |  585|  19.8k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  19.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  19.8k|    } \
  |  |  587|  19.8k|}
  ------------------
  621|  19.8k|                    STEPIN();
  ------------------
  |  |  575|  19.8k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 6.28k, False: 13.6k]
  |  |  ------------------
  |  |  576|  6.28k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  6.28k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  6.28k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  6.28k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.28k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  6.28k|    }
  ------------------
  622|  19.8k|                }
  623|  19.8k|                actedge++;
  624|  19.8k|            }
  625|   154k|        }
  626|       |
  627|  3.54k|#undef MERGE_INTO_CURRENT_EDGE
  628|  3.54k|#undef ADD_NEW_EDGE
  629|  3.54k|#undef STEPOUT
  630|  3.54k|#undef STEPIN
  631|       |
  632|  3.54k|        igraph_vector_int_destroy(&outadj);
  633|  3.54k|        igraph_vector_int_destroy(&inadj);
  634|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  635|       |
  636|  3.54k|        IGRAPH_CHECK(igraph_create(&newgraph, &edges,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  637|  3.54k|                                   no_of_nodes,
  638|  3.54k|                                   IGRAPH_UNDIRECTED));
  639|  3.54k|        IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  640|  3.54k|        igraph_vector_int_destroy(&edges);
  641|  3.54k|        IGRAPH_CHECK(igraph_i_attribute_copy(&newgraph, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  642|       |
  643|  3.54k|        if (attr) {
  ------------------
  |  Branch (643:13): [True: 3.54k, False: 0]
  ------------------
  644|  3.54k|            igraph_fixed_vectorlist_t vl;
  645|  3.54k|            IGRAPH_CHECK(igraph_fixed_vectorlist_convert(&vl, &mergeinto, actedge));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  646|  3.54k|            IGRAPH_FINALLY(igraph_fixed_vectorlist_destroy, &vl);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  647|       |
  648|  3.54k|            IGRAPH_CHECK(igraph_i_attribute_combine_edges(graph, &newgraph, &vl.vecs, edge_comb));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  649|       |
  650|  3.54k|            igraph_fixed_vectorlist_destroy(&vl);
  651|  3.54k|            IGRAPH_FINALLY_CLEAN(1);
  652|  3.54k|        }
  653|       |
  654|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  655|  3.54k|        igraph_destroy(graph);
  656|  3.54k|        *graph = newgraph;
  657|       |
  658|  3.54k|        if (attr) {
  ------------------
  |  Branch (658:13): [True: 3.54k, False: 0]
  ------------------
  659|  3.54k|            igraph_vector_int_destroy(&mergeinto);
  660|  3.54k|            IGRAPH_FINALLY_CLEAN(1);
  661|  3.54k|        }
  662|  3.54k|    } else if (mode == IGRAPH_TO_UNDIRECTED_MUTUAL) {
  ------------------
  |  Branch (662:16): [True: 0, False: 0]
  ------------------
  663|      0|        igraph_vector_int_t inadj, outadj;
  664|      0|        igraph_vector_int_t mergeinto;
  665|      0|        igraph_int_t actedge = 0;
  666|       |
  667|      0|        if (attr) {
  ------------------
  |  Branch (667:13): [True: 0, False: 0]
  ------------------
  668|      0|            IGRAPH_VECTOR_INT_INIT_FINALLY(&mergeinto, no_of_edges);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  669|      0|            igraph_vector_int_fill(&mergeinto, -1);
  670|      0|        }
  671|       |
  672|      0|        IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  673|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&inadj, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  674|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&outadj, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  675|       |
  676|      0|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (676:34): [True: 0, False: 0]
  ------------------
  677|      0|            igraph_int_t n_out, n_in;
  678|      0|            igraph_int_t p1 = -1, p2 = -1;
  679|      0|            igraph_int_t e1 = 0, e2 = 0, n1 = 0, n2 = 0;
  680|      0|            IGRAPH_CHECK(igraph_incident(graph, &outadj, i, IGRAPH_OUT, IGRAPH_LOOPS));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  681|      0|            IGRAPH_CHECK(igraph_incident(graph, &inadj,  i, IGRAPH_IN, IGRAPH_LOOPS));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  682|      0|            n_out = igraph_vector_int_size(&outadj);
  683|      0|            n_in = igraph_vector_int_size(&inadj);
  684|       |
  685|      0|#define STEPOUT() if ( (++p1) < n_out) {    \
  686|      0|        e1 = VECTOR(outadj)[p1]; \
  687|      0|        n1 = IGRAPH_TO(graph, e1);      \
  688|      0|    }
  689|      0|#define STEPIN()  if ( (++p2) < n_in) {         \
  690|      0|        e2 = VECTOR(inadj )[p2]; \
  691|      0|        n2 = IGRAPH_FROM(graph, e2);        \
  692|      0|    }
  693|       |
  694|      0|            STEPOUT();
  ------------------
  |  |  685|      0|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (685:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  686|      0|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  687|      0|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  688|      0|    }
  ------------------
  695|      0|            STEPIN();
  ------------------
  |  |  689|      0|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (689:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  690|      0|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  691|      0|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|    }
  ------------------
  696|       |
  697|      0|            while (p1 < n_out && n1 <= i && p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (697:20): [True: 0, False: 0]
  |  Branch (697:34): [True: 0, False: 0]
  |  Branch (697:45): [True: 0, False: 0]
  |  Branch (697:58): [True: 0, False: 0]
  ------------------
  698|      0|                if (n1 == n2) {
  ------------------
  |  Branch (698:21): [True: 0, False: 0]
  ------------------
  699|      0|                    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  700|      0|                    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, n1));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  701|      0|                    if (attr) {
  ------------------
  |  Branch (701:25): [True: 0, False: 0]
  ------------------
  702|      0|                        VECTOR(mergeinto)[e1] = actedge;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  703|      0|                        VECTOR(mergeinto)[e2] = actedge;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  704|      0|                        actedge++;
  705|      0|                    }
  706|      0|                    STEPOUT();
  ------------------
  |  |  685|      0|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (685:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  686|      0|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  687|      0|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  688|      0|    }
  ------------------
  707|      0|                    STEPIN();
  ------------------
  |  |  689|      0|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (689:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  690|      0|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  691|      0|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|    }
  ------------------
  708|      0|                } else if (n1 < n2) {
  ------------------
  |  Branch (708:28): [True: 0, False: 0]
  ------------------
  709|      0|                    STEPOUT();
  ------------------
  |  |  685|      0|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (685:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  686|      0|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  687|      0|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  688|      0|    }
  ------------------
  710|      0|                } else { /* n2<n1 */
  711|      0|                    STEPIN();
  ------------------
  |  |  689|      0|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (689:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  690|      0|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  691|      0|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|    }
  ------------------
  712|      0|                }
  713|      0|            }
  714|      0|        }
  715|       |
  716|      0|#undef STEPOUT
  717|      0|#undef STEPIN
  718|       |
  719|      0|        igraph_vector_int_destroy(&outadj);
  720|      0|        igraph_vector_int_destroy(&inadj);
  721|      0|        IGRAPH_FINALLY_CLEAN(2);
  722|       |
  723|      0|        IGRAPH_CHECK(igraph_create(&newgraph, &edges,
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  724|      0|                                   no_of_nodes,
  725|      0|                                   IGRAPH_UNDIRECTED));
  726|      0|        IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  727|      0|        igraph_vector_int_destroy(&edges);
  728|      0|        IGRAPH_CHECK(igraph_i_attribute_copy(&newgraph, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  729|       |
  730|      0|        if (attr) {
  ------------------
  |  Branch (730:13): [True: 0, False: 0]
  ------------------
  731|      0|            igraph_fixed_vectorlist_t vl;
  732|      0|            IGRAPH_CHECK(igraph_fixed_vectorlist_convert(&vl, &mergeinto, actedge));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  733|      0|            IGRAPH_FINALLY(igraph_fixed_vectorlist_destroy, &vl);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  734|       |
  735|      0|            IGRAPH_CHECK(igraph_i_attribute_combine_edges(graph, &newgraph, &vl.vecs, edge_comb));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  736|       |
  737|      0|            igraph_fixed_vectorlist_destroy(&vl);
  738|      0|            IGRAPH_FINALLY_CLEAN(1);
  739|      0|        }
  740|       |
  741|      0|        IGRAPH_FINALLY_CLEAN(2);
  742|      0|        igraph_destroy(graph);
  743|      0|        *graph = newgraph;
  744|       |
  745|      0|        if (attr) {
  ------------------
  |  Branch (745:13): [True: 0, False: 0]
  ------------------
  746|      0|            igraph_vector_int_destroy(&mergeinto);
  747|      0|            IGRAPH_FINALLY_CLEAN(1);
  748|      0|        }
  749|      0|    }
  750|       |
  751|  3.54k|    return IGRAPH_SUCCESS;
  752|  3.54k|}

igraph_contract_vertices:
   64|  3.54k|                             const igraph_attribute_combination_t *vertex_comb) {
   65|  3.54k|    igraph_vector_int_t edges;
   66|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   67|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
   68|  3.54k|    igraph_bool_t vattr = vertex_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (68:27): [True: 3.54k, False: 0]
  |  Branch (68:42): [True: 3.54k, False: 0]
  ------------------
   69|  3.54k|    igraph_t res;
   70|  3.54k|    igraph_int_t last;
   71|  3.54k|    igraph_int_t no_new_vertices;
   72|       |
   73|  3.54k|    if (igraph_vector_int_size(mapping) != no_of_nodes) {
  ------------------
  |  Branch (73:9): [True: 0, False: 3.54k]
  ------------------
   74|      0|        IGRAPH_ERRORF("Mapping vector length (%" IGRAPH_PRId ") "
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   75|      0|                "not equal to number of nodes (%" IGRAPH_PRId ").",
   76|      0|                IGRAPH_EINVAL, igraph_vector_int_size(mapping), no_of_nodes);
   77|      0|    }
   78|       |
   79|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
   80|  3.54k|    IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
   81|       |
   82|  3.54k|    if (no_of_nodes > 0) {
  ------------------
  |  Branch (82:9): [True: 3.53k, False: 1]
  ------------------
   83|  3.53k|        last = igraph_vector_int_max(mapping);
   84|  3.53k|    } else {
   85|       |        /* Ensure that no_new_vertices will be zero
   86|       |         * when the input graph has no vertices. */
   87|      1|        last = -1;
   88|      1|    }
   89|       |
   90|  99.5k|    for (igraph_int_t edge = 0; edge < no_of_edges; edge++) {
  ------------------
  |  Branch (90:33): [True: 96.0k, False: 3.54k]
  ------------------
   91|  96.0k|        igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   92|  96.0k|        igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   93|       |
   94|  96.0k|        igraph_int_t nfrom = VECTOR(*mapping)[from];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   95|  96.0k|        igraph_int_t nto = VECTOR(*mapping)[to];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   96|       |
   97|  96.0k|        igraph_vector_int_push_back(&edges, nfrom); /* reserved */
   98|  96.0k|        igraph_vector_int_push_back(&edges, nto); /* reserved */
   99|       |
  100|  96.0k|        if (nfrom > last) {
  ------------------
  |  Branch (100:13): [True: 0, False: 96.0k]
  ------------------
  101|      0|            last = nfrom;
  102|      0|        }
  103|  96.0k|        if (nto   > last) {
  ------------------
  |  Branch (103:13): [True: 0, False: 96.0k]
  ------------------
  104|      0|            last = nto;
  105|      0|        }
  106|  96.0k|    }
  107|       |
  108|  3.54k|    no_new_vertices = last + 1;
  109|       |
  110|  3.54k|    IGRAPH_CHECK(igraph_create(&res, &edges, no_new_vertices,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  111|  3.54k|                               igraph_is_directed(graph)));
  112|       |
  113|  3.54k|    igraph_vector_int_destroy(&edges);
  114|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  115|       |
  116|  3.54k|    IGRAPH_FINALLY(igraph_destroy, &res);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  117|       |
  118|  3.54k|    IGRAPH_CHECK(igraph_i_attribute_copy(&res, graph, true, /* vertex= */ false, true));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  119|       |
  120|  3.54k|    if (vattr) {
  ------------------
  |  Branch (120:9): [True: 3.54k, False: 0]
  ------------------
  121|  3.54k|        igraph_vector_int_list_t merges;
  122|  3.54k|        igraph_vector_int_t sizes;
  123|       |
  124|  3.54k|        IGRAPH_VECTOR_INT_LIST_INIT_FINALLY(&merges, no_new_vertices);
  ------------------
  |  |   58|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_list_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_list_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (59:69): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  125|  3.54k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&sizes, no_new_vertices);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  126|       |
  127|   158k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (127:34): [True: 154k, False: 3.54k]
  ------------------
  128|   154k|            igraph_int_t to = VECTOR(*mapping)[i];
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  129|   154k|            igraph_vector_int_t *v = igraph_vector_int_list_get_ptr(&merges, to);
  130|   154k|            VECTOR(sizes)[to] += 1;
  ------------------
  |  |   60|   154k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  131|   154k|            IGRAPH_CHECK(igraph_vector_int_push_back(v, i));
  ------------------
  |  |  656|   154k|    do { \
  |  |  657|   154k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   154k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   154k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  132|   154k|        }
  133|       |
  134|  3.54k|        IGRAPH_CHECK(igraph_i_attribute_combine_vertices(graph, &res,
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  135|  3.54k|                     &merges,
  136|  3.54k|                     vertex_comb));
  137|       |
  138|  3.54k|        igraph_vector_int_destroy(&sizes);
  139|  3.54k|        igraph_vector_int_list_destroy(&merges);
  140|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  141|  3.54k|    }
  142|       |
  143|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  144|  3.54k|    igraph_destroy(graph);
  145|  3.54k|    *graph = res;
  146|       |
  147|  3.54k|    return IGRAPH_SUCCESS;
  148|  3.54k|}

igraph_simplify:
   56|  3.54k|                               const igraph_attribute_combination_t *edge_comb) {
   57|       |
   58|  3.54k|    igraph_vector_int_t edges;
   59|  3.54k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   60|  3.54k|    igraph_int_t no_of_edges = igraph_ecount(graph);
   61|  3.54k|    igraph_int_t edge;
   62|  3.54k|    igraph_bool_t attr = edge_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (62:26): [True: 3.54k, False: 0]
  |  Branch (62:39): [True: 3.54k, False: 0]
  ------------------
   63|  3.54k|    igraph_int_t from, to, pfrom = -1, pto = -2;
   64|  3.54k|    igraph_t res;
   65|  3.54k|    igraph_es_t es;
   66|  3.54k|    igraph_eit_t eit;
   67|  3.54k|    igraph_vector_int_t mergeinto;
   68|  3.54k|    igraph_int_t actedge;
   69|       |
   70|       |    /* if we already know there are no multi-edges, they don't need to be removed */
   71|  3.54k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (71:9): [True: 0, False: 3.54k]
  ------------------
   72|      0|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  ------------------
   73|      0|        remove_multiple = false;
   74|      0|    }
   75|       |
   76|       |    /* if we already know there are no loops, they don't need to be removed */
   77|  3.54k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (77:9): [True: 0, False: 3.54k]
  ------------------
   78|      0|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 0]
  ------------------
   79|      0|        remove_loops = false;
   80|      0|    }
   81|       |
   82|  3.54k|    if (!remove_multiple && !remove_loops)
  ------------------
  |  Branch (82:9): [True: 0, False: 3.54k]
  |  Branch (82:29): [True: 0, False: 0]
  ------------------
   83|       |        /* nothing to do */
   84|      0|    {
   85|      0|        return IGRAPH_SUCCESS;
   86|      0|    }
   87|       |
   88|  3.54k|    if (!remove_multiple) {
  ------------------
  |  Branch (88:9): [True: 0, False: 3.54k]
  ------------------
   89|      0|        igraph_vector_int_t edges_to_delete;
   90|       |
   91|       |        /* removing loop edges only, this is simple. No need to combine anything
   92|       |         * and the whole process can be done in-place */
   93|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&edges_to_delete, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
   94|      0|        IGRAPH_CHECK(igraph_es_all(&es, IGRAPH_EDGEORDER_ID));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   95|      0|        IGRAPH_FINALLY(igraph_es_destroy, &es);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   96|      0|        IGRAPH_CHECK(igraph_eit_create(graph, es, &eit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   97|      0|        IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   98|       |
   99|      0|        while (!IGRAPH_EIT_END(eit)) {
  ------------------
  |  |  371|      0|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
  |  Branch (99:16): [True: 0, False: 0]
  ------------------
  100|      0|            edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|      0|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  406|      0|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  101|      0|            from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  102|      0|            to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|      0|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  103|      0|            if (from == to) {
  ------------------
  |  Branch (103:17): [True: 0, False: 0]
  ------------------
  104|      0|                IGRAPH_CHECK(igraph_vector_int_push_back(&edges_to_delete, edge));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  105|      0|            }
  106|      0|            IGRAPH_EIT_NEXT(eit);
  ------------------
  |  |  359|      0|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  107|      0|        }
  108|       |
  109|      0|        igraph_eit_destroy(&eit);
  110|      0|        igraph_es_destroy(&es);
  111|      0|        IGRAPH_FINALLY_CLEAN(2);
  112|       |
  113|      0|        if (igraph_vector_int_size(&edges_to_delete) > 0) {
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            IGRAPH_CHECK(igraph_delete_edges(graph, igraph_ess_vector(&edges_to_delete)));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  115|      0|        }
  116|       |
  117|      0|        igraph_vector_int_destroy(&edges_to_delete);
  118|      0|        IGRAPH_FINALLY_CLEAN(1);
  119|       |
  120|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, false);
  121|       |
  122|      0|        return IGRAPH_SUCCESS;
  123|      0|    }
  124|       |
  125|  3.54k|    if (attr) {
  ------------------
  |  Branch (125:9): [True: 3.54k, False: 0]
  ------------------
  126|  3.54k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&mergeinto, no_of_edges);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  127|  3.54k|    }
  128|  3.54k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.54k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.54k|    do { \
  |  |  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.54k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.54k|    do { \
  |  |  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.54k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  129|  3.54k|    IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  130|       |
  131|  3.54k|    IGRAPH_CHECK(igraph_es_all(&es, IGRAPH_EDGEORDER_FROM));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  132|  3.54k|    IGRAPH_FINALLY(igraph_es_destroy, &es);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  133|  3.54k|    IGRAPH_CHECK(igraph_eit_create(graph, es, &eit));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  134|  3.54k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  135|       |
  136|  99.5k|    for (actedge = -1; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|  99.5k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                  for (actedge = -1; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|  96.0k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (136:24): [True: 96.0k, False: 3.54k]
  ------------------
  137|  96.0k|        edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  96.0k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 96.0k]
  |  |  ------------------
  |  |  406|  96.0k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  138|  96.0k|        from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  96.0k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  139|  96.0k|        to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  140|       |
  141|  96.0k|        if (remove_loops && from == to) {
  ------------------
  |  Branch (141:13): [True: 96.0k, False: 0]
  |  Branch (141:29): [True: 24.2k, False: 71.7k]
  ------------------
  142|       |            /* Loop edge to be removed */
  143|  24.2k|            if (attr) {
  ------------------
  |  Branch (143:17): [True: 24.2k, False: 0]
  ------------------
  144|  24.2k|                VECTOR(mergeinto)[edge] = -1;
  ------------------
  |  |   60|  24.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|  24.2k|            }
  146|  71.7k|        } else if (remove_multiple && from == pfrom && to == pto) {
  ------------------
  |  Branch (146:20): [True: 71.7k, False: 0]
  |  Branch (146:39): [True: 40.3k, False: 31.3k]
  |  Branch (146:56): [True: 14.3k, False: 26.0k]
  ------------------
  147|       |            /* Multiple edge to be contracted */
  148|  14.3k|            if (attr) {
  ------------------
  |  Branch (148:17): [True: 14.3k, False: 0]
  ------------------
  149|  14.3k|                VECTOR(mergeinto)[edge] = actedge;
  ------------------
  |  |   60|  14.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  150|  14.3k|            }
  151|  57.3k|        } else {
  152|       |            /* Edge to be kept */
  153|  57.3k|            igraph_vector_int_push_back(&edges, from);  /* reserved */
  154|  57.3k|            igraph_vector_int_push_back(&edges, to);  /* reserved */
  155|  57.3k|            if (attr) {
  ------------------
  |  Branch (155:17): [True: 57.3k, False: 0]
  ------------------
  156|  57.3k|                actedge++;
  157|  57.3k|                VECTOR(mergeinto)[edge] = actedge;
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|  57.3k|            }
  159|  57.3k|        }
  160|  96.0k|        pfrom = from; pto = to;
  161|  96.0k|    }
  162|       |
  163|  3.54k|    igraph_eit_destroy(&eit);
  164|  3.54k|    igraph_es_destroy(&es);
  165|  3.54k|    IGRAPH_FINALLY_CLEAN(2);
  166|       |
  167|  3.54k|    IGRAPH_CHECK(igraph_create(&res, &edges, no_of_nodes, igraph_is_directed(graph)));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  168|       |
  169|  3.54k|    igraph_vector_int_destroy(&edges);
  170|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  171|       |
  172|  3.54k|    IGRAPH_FINALLY(igraph_destroy, &res);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  173|       |
  174|  3.54k|    IGRAPH_CHECK(igraph_i_attribute_copy(&res, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  175|       |
  176|  3.54k|    if (attr) {
  ------------------
  |  Branch (176:9): [True: 3.54k, False: 0]
  ------------------
  177|  3.54k|        igraph_fixed_vectorlist_t vl;
  178|  3.54k|        IGRAPH_CHECK(igraph_fixed_vectorlist_convert(&vl, &mergeinto, actedge + 1));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  179|  3.54k|        IGRAPH_FINALLY(igraph_fixed_vectorlist_destroy, &vl);
  ------------------
  |  |  603|  3.54k|    do { \
  |  |  604|  3.54k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.54k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.54k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.54k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  608|  3.54k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  180|       |
  181|  3.54k|        IGRAPH_CHECK(igraph_i_attribute_combine_edges(graph, &res, &vl.vecs, edge_comb));
  ------------------
  |  |  656|  3.54k|    do { \
  |  |  657|  3.54k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.54k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.54k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  182|       |
  183|  3.54k|        igraph_fixed_vectorlist_destroy(&vl);
  184|  3.54k|        igraph_vector_int_destroy(&mergeinto);
  185|  3.54k|        IGRAPH_FINALLY_CLEAN(2);
  186|  3.54k|    }
  187|       |
  188|  3.54k|    IGRAPH_FINALLY_CLEAN(1);
  189|  3.54k|    igraph_destroy(graph);
  190|  3.54k|    *graph = res;
  191|       |
  192|       |    /* The cache must be set as the very last step, only after all functions that can
  193|       |     * potentially return with an error have finished. */
  194|       |
  195|  3.54k|    if (remove_loops) {
  ------------------
  |  Branch (195:9): [True: 3.54k, False: 0]
  ------------------
  196|       |        /* Loop edges were removed so we know for sure that there aren't any
  197|       |         * loop edges now */
  198|  3.54k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, false);
  199|  3.54k|    }
  200|       |
  201|  3.54k|    if (remove_multiple) {
  ------------------
  |  Branch (201:9): [True: 3.54k, False: 0]
  ------------------
  202|       |        /* Multi-edges were removed so we know for sure that there aren't any
  203|       |         * multi-edges now */
  204|  3.54k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, false);
  205|  3.54k|    }
  206|       |
  207|  3.54k|    return IGRAPH_SUCCESS;
  208|  3.54k|}

igraph_induced_subgraph:
  320|   302k|                                       igraph_subgraph_implementation_t impl) {
  321|   302k|    return igraph_induced_subgraph_map(graph, res, vids, impl,
  322|   302k|                                       /* map= */ NULL, /* invmap= */ NULL);
  323|   302k|}
igraph_i_induced_subgraph_map:
  355|   302k|                                  igraph_bool_t map_is_prepared) {
  356|       |
  357|   302k|    if (impl == IGRAPH_SUBGRAPH_AUTO) {
  ------------------
  |  Branch (357:9): [True: 302k, False: 0]
  ------------------
  358|   302k|        IGRAPH_CHECK(igraph_i_induced_subgraph_suggest_implementation(graph, vids, &impl));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  359|   302k|    }
  360|       |
  361|   302k|    switch (impl) {
  362|    375|    case IGRAPH_SUBGRAPH_COPY_AND_DELETE:
  ------------------
  |  Branch (362:5): [True: 375, False: 302k]
  ------------------
  363|    375|        return igraph_i_induced_subgraph_copy_and_delete(graph, res, vids, map, invmap);
  364|       |
  365|   302k|    case IGRAPH_SUBGRAPH_CREATE_FROM_SCRATCH:
  ------------------
  |  Branch (365:5): [True: 302k, False: 375]
  ------------------
  366|   302k|        return igraph_i_induced_subgraph_create_from_scratch(graph, res, vids, map,
  367|   302k|                invmap, /* map_is_prepared = */ map_is_prepared);
  368|       |
  369|      0|    default:
  ------------------
  |  Branch (369:5): [True: 0, False: 302k]
  ------------------
  370|      0|        IGRAPH_ERROR("Unknown subgraph implementation type.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  371|   302k|    }
  372|   302k|}
igraph_induced_subgraph_map:
  430|   302k|                                           igraph_vector_int_t *invmap) {
  431|   302k|    return igraph_i_induced_subgraph_map(graph, res, vids, impl,
  432|   302k|                                         map, invmap,
  433|       |                                         /* map_is_prepared = */ false);
  434|   302k|}
subgraph.c:igraph_i_induced_subgraph_suggest_implementation:
  327|   302k|        igraph_subgraph_implementation_t *result) {
  328|   302k|    double ratio;
  329|   302k|    igraph_int_t num_vs;
  330|       |
  331|   302k|    if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (331:9): [True: 0, False: 302k]
  ------------------
  332|      0|        ratio = 1.0;
  333|   302k|    } else {
  334|   302k|        IGRAPH_CHECK(igraph_vs_size(graph, &vids, &num_vs));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  335|   302k|        ratio = (igraph_real_t) num_vs / igraph_vcount(graph);
  336|   302k|    }
  337|       |
  338|       |    /* The threshold of 0.5 is justified by the benchmarking done in
  339|       |     * https://github.com/igraph/igraph/pull/2708
  340|       |     * Small improvements may be possible by using better heuristics. */
  341|   302k|    if (ratio > 0.5) {
  ------------------
  |  Branch (341:9): [True: 375, False: 302k]
  ------------------
  342|    375|        *result = IGRAPH_SUBGRAPH_COPY_AND_DELETE;
  343|   302k|    } else {
  344|   302k|        *result = IGRAPH_SUBGRAPH_CREATE_FROM_SCRATCH;
  345|   302k|    }
  346|       |
  347|   302k|    return IGRAPH_SUCCESS;
  348|   302k|}
subgraph.c:igraph_i_induced_subgraph_copy_and_delete:
   36|    375|        igraph_vector_int_t *map, igraph_vector_int_t *invmap) {
   37|       |
   38|    375|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   39|    375|    igraph_int_t no_of_new_nodes_estimate;
   40|    375|    igraph_vector_int_t delete;
   41|    375|    igraph_bitset_t remain;
   42|    375|    igraph_vit_t vit;
   43|       |
   44|    375|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   45|    375|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   46|       |
   47|    375|    IGRAPH_VECTOR_INT_INIT_FINALLY(&delete, 0);
  ------------------
  |  |  119|    375|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    375|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 375]
  |  |  ------------------
  ------------------
   48|    375|    IGRAPH_BITSET_INIT_FINALLY(&remain, no_of_nodes);
  ------------------
  |  |  259|    375|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|    375|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|    375|    do { \
  |  |  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|    375|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|    375|    do { \
  |  |  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    375|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 375]
  |  |  ------------------
  ------------------
   49|       |
   50|       |    /* Calculate how many nodes there will be in the new graph. The result is
   51|       |     * a lower bound only as 'vit' may contain the same vertex more than once. */
   52|    375|    no_of_new_nodes_estimate = no_of_nodes - IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|    375|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
   53|    375|    if (no_of_new_nodes_estimate < 0) {
  ------------------
  |  Branch (53:9): [True: 0, False: 375]
  ------------------
   54|      0|        no_of_new_nodes_estimate = 0;
   55|      0|    }
   56|       |
   57|    375|    IGRAPH_CHECK(igraph_vector_int_reserve(&delete, no_of_new_nodes_estimate));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   58|       |
   59|  1.38k|    for (IGRAPH_VIT_RESET(vit); !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit)) {
  ------------------
  |  |  201|    375|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
                  for (IGRAPH_VIT_RESET(vit); !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit)) {
  ------------------
  |  |  179|  1.38k|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
                  for (IGRAPH_VIT_RESET(vit); !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit)) {
  ------------------
  |  |  167|  1.00k|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
  |  Branch (59:33): [True: 1.00k, False: 375]
  ------------------
   60|  1.00k|        IGRAPH_BIT_SET(remain, IGRAPH_VIT_GET(vit));
  ------------------
  |  |  103|  1.00k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  1.00k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  2.01k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.00k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:30): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  2.01k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.00k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:53): [True: 0, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  1.00k|    }
   62|       |
   63|  1.75k|    for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (63:30): [True: 1.38k, False: 375]
  ------------------
   64|  1.38k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  1.38k|    do { \
  |  |   47|  1.38k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 1.38k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  1.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
   65|       |
   66|  1.38k|        if (! IGRAPH_BIT_TEST(remain, i)) {
  ------------------
  |  |  142|  1.38k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  1.38k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  1.38k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.38k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  1.38k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  1.38k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 375, False: 1.00k]
  ------------------
   67|    375|            IGRAPH_CHECK(igraph_vector_int_push_back(&delete, i));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   68|    375|        }
   69|  1.38k|    }
   70|       |
   71|    375|    igraph_bitset_destroy(&remain);
   72|    375|    IGRAPH_FINALLY_CLEAN(1);
   73|       |
   74|    375|    IGRAPH_CHECK(igraph_copy(res, graph));
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   75|    375|    IGRAPH_FINALLY(igraph_destroy, res);
  ------------------
  |  |  603|    375|    do { \
  |  |  604|    375|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    375|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    375|         * incorrect destructor function with the pointer */ \
  |  |  607|    375|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 375]
  |  |  ------------------
  |  |  608|    375|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   76|    375|    IGRAPH_CHECK(igraph_delete_vertices_map(res, igraph_vss_vector(&delete),
  ------------------
  |  |  656|    375|    do { \
  |  |  657|    375|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    375|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    375|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    375|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
   77|    375|                                            map, invmap));
   78|       |
   79|    375|    igraph_vector_int_destroy(&delete);
   80|    375|    igraph_vit_destroy(&vit);
   81|    375|    IGRAPH_FINALLY_CLEAN(3);
   82|       |
   83|    375|    return IGRAPH_SUCCESS;
   84|    375|}
subgraph.c:igraph_i_induced_subgraph_create_from_scratch:
   99|   302k|        igraph_bool_t map_is_prepared) {
  100|       |
  101|   302k|    const igraph_bool_t directed = igraph_is_directed(graph);
  102|   302k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  103|   302k|    igraph_int_t no_of_new_nodes = 0;
  104|   302k|    igraph_int_t n;
  105|   302k|    igraph_int_t to;
  106|   302k|    igraph_int_t eid;
  107|   302k|    igraph_vector_int_t vids_old2new, vids_new2old;
  108|   302k|    igraph_vector_int_t eids_new2old;
  109|   302k|    igraph_vector_int_t vids_vec;
  110|   302k|    igraph_vector_int_t nei_edges;
  111|   302k|    igraph_vector_int_t new_edges;
  112|   302k|    igraph_vit_t vit;
  113|   302k|    igraph_vector_int_t *my_vids_old2new = &vids_old2new,
  114|   302k|                        *my_vids_new2old = &vids_new2old;
  115|       |
  116|       |    /* The order of initialization is important here, they will be destroyed in the
  117|       |     * opposite order */
  118|   302k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&eids_new2old, 0);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  119|   302k|    if (invmap) {
  ------------------
  |  Branch (119:9): [True: 0, False: 302k]
  ------------------
  120|      0|        my_vids_new2old = invmap;
  121|      0|        igraph_vector_int_clear(my_vids_new2old);
  122|   302k|    } else {
  123|   302k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vids_new2old, 0);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  124|   302k|    }
  125|   302k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&new_edges, 0);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  126|   302k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nei_edges, 0);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  127|   302k|    if (map) {
  ------------------
  |  Branch (127:9): [True: 0, False: 302k]
  ------------------
  128|      0|        my_vids_old2new = map;
  129|      0|        if (!map_is_prepared) {
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            IGRAPH_CHECK(igraph_vector_int_resize(map, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  131|      0|            igraph_vector_int_fill(map, -1);
  132|      0|        }
  133|   302k|    } else {
  134|   302k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&vids_old2new, no_of_nodes);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  135|   302k|        igraph_vector_int_fill(&vids_old2new, -1);
  136|   302k|    }
  137|   302k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&vids_vec, 0);
  ------------------
  |  |  119|   302k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|   302k|    do { \
  |  |  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|   302k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|   302k|    do { \
  |  |  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|   302k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  138|       |
  139|   302k|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  140|   302k|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|   302k|    do { \
  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  ------------------
  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  141|       |
  142|       |    /* Calculate the mapping from the old node IDs to the new ones. The other
  143|       |     * igraph_simplify implementation in igraph_i_simplify_copy_and_delete
  144|       |     * ensures that the order of vertex IDs is kept during remapping (i.e.
  145|       |     * if the old ID of vertex A is less than the old ID of vertex B, then
  146|       |     * the same will also be true for the new IDs). To ensure compatibility
  147|       |     * with the other implementation, we have to fetch the vertex IDs into
  148|       |     * a vector first and then sort it.
  149|       |     */
  150|   302k|    IGRAPH_CHECK(igraph_vit_as_vector(&vit, &vids_vec));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  151|   302k|    igraph_vit_destroy(&vit);
  152|   302k|    IGRAPH_FINALLY_CLEAN(1);
  153|       |
  154|   302k|    igraph_vector_int_sort(&vids_vec);
  155|   302k|    n = igraph_vector_int_size(&vids_vec);
  156|   611k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (156:30): [True: 308k, False: 302k]
  ------------------
  157|   308k|        igraph_int_t vid = VECTOR(vids_vec)[i];
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|       |
  159|       |        /* Cater for duplicate vertex IDs in the input vertex selector; we use
  160|       |         * the first occurrence of each vertex ID and ignore the rest */
  161|   308k|        if (VECTOR(*my_vids_old2new)[vid] < 0) {
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (161:13): [True: 308k, False: 0]
  ------------------
  162|   308k|            IGRAPH_CHECK(igraph_vector_int_push_back(my_vids_new2old, vid));
  ------------------
  |  |  656|   308k|    do { \
  |  |  657|   308k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   308k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   308k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 308k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   308k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 308k]
  |  |  ------------------
  ------------------
  163|   308k|            VECTOR(*my_vids_old2new)[vid] = no_of_new_nodes;
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  164|   308k|            no_of_new_nodes++;
  165|   308k|        }
  166|   308k|    }
  167|   302k|    igraph_vector_int_destroy(&vids_vec);
  168|   302k|    IGRAPH_FINALLY_CLEAN(1);
  169|       |
  170|       |    /* Create the new edge list */
  171|   611k|    for (igraph_int_t i = 0; i < no_of_new_nodes; i++) {
  ------------------
  |  Branch (171:30): [True: 308k, False: 302k]
  ------------------
  172|   308k|        igraph_int_t old_vid = VECTOR(*my_vids_new2old)[i];
  ------------------
  |  |   60|   308k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  173|   308k|        igraph_int_t new_vid = i;
  174|   308k|        igraph_bool_t skip_loop_edge;
  175|       |
  176|   308k|        IGRAPH_CHECK(igraph_incident(graph, &nei_edges, old_vid, IGRAPH_OUT, IGRAPH_LOOPS));
  ------------------
  |  |  656|   308k|    do { \
  |  |  657|   308k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   308k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   308k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 308k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   308k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 308k]
  |  |  ------------------
  ------------------
  177|   308k|        n = igraph_vector_int_size(&nei_edges);
  178|       |
  179|   308k|        if (directed) {
  ------------------
  |  Branch (179:13): [True: 154k, False: 154k]
  ------------------
  180|       |            /* directed graph; this is easier */
  181|   247k|            for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (181:38): [True: 92.4k, False: 154k]
  ------------------
  182|  92.4k|                eid = VECTOR(nei_edges)[j];
  ------------------
  |  |   60|  92.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  183|       |
  184|  92.4k|                to = VECTOR(*my_vids_old2new)[ IGRAPH_TO(graph, eid) ];
  ------------------
  |  |   60|  92.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              to = VECTOR(*my_vids_old2new)[ IGRAPH_TO(graph, eid) ];
  ------------------
  |  |  128|  92.4k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  92.4k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  185|  92.4k|                if (to < 0) {
  ------------------
  |  Branch (185:21): [True: 60.9k, False: 31.4k]
  ------------------
  186|  60.9k|                    continue;
  187|  60.9k|                }
  188|       |
  189|  31.4k|                IGRAPH_CHECK(igraph_vector_int_push_back(&new_edges, new_vid));
  ------------------
  |  |  656|  31.4k|    do { \
  |  |  657|  31.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  31.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  31.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 31.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  31.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 31.4k]
  |  |  ------------------
  ------------------
  190|  31.4k|                IGRAPH_CHECK(igraph_vector_int_push_back(&new_edges, to));
  ------------------
  |  |  656|  31.4k|    do { \
  |  |  657|  31.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  31.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  31.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 31.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  31.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 31.4k]
  |  |  ------------------
  ------------------
  191|  31.4k|                IGRAPH_CHECK(igraph_vector_int_push_back(&eids_new2old, eid));
  ------------------
  |  |  656|  31.4k|    do { \
  |  |  657|  31.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  31.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  31.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 31.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  31.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 31.4k]
  |  |  ------------------
  ------------------
  192|  31.4k|            }
  193|   154k|        } else {
  194|       |            /* undirected graph. We need to be careful with loop edges as each
  195|       |             * loop edge will appear twice. We use a boolean flag to skip every
  196|       |             * second loop edge */
  197|   154k|            skip_loop_edge = false;
  198|   264k|            for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (198:38): [True: 110k, False: 154k]
  ------------------
  199|   110k|                eid = VECTOR(nei_edges)[j];
  ------------------
  |  |   60|   110k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  200|       |
  201|   110k|                if (IGRAPH_FROM(graph, eid) != old_vid) {
  ------------------
  |  |  115|   110k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   110k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (201:21): [True: 55.0k, False: 55.0k]
  ------------------
  202|       |                    /* avoid processing edges twice */
  203|  55.0k|                    continue;
  204|  55.0k|                }
  205|       |
  206|  55.0k|                to = VECTOR(*my_vids_old2new)[ IGRAPH_TO(graph, eid) ];
  ------------------
  |  |   60|  55.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              to = VECTOR(*my_vids_old2new)[ IGRAPH_TO(graph, eid) ];
  ------------------
  |  |  128|  55.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  207|  55.0k|                if (to < 0) {
  ------------------
  |  Branch (207:21): [True: 49.5k, False: 5.50k]
  ------------------
  208|  49.5k|                    continue;
  209|  49.5k|                }
  210|       |
  211|  5.50k|                if (new_vid == to) {
  ------------------
  |  Branch (211:21): [True: 0, False: 5.50k]
  ------------------
  212|       |                    /* this is a loop edge; check whether we need to skip it */
  213|      0|                    skip_loop_edge = !skip_loop_edge;
  214|      0|                    if (skip_loop_edge) {
  ------------------
  |  Branch (214:25): [True: 0, False: 0]
  ------------------
  215|      0|                        continue;
  216|      0|                    }
  217|      0|                }
  218|       |
  219|  5.50k|                IGRAPH_CHECK(igraph_vector_int_push_back(&new_edges, new_vid));
  ------------------
  |  |  656|  5.50k|    do { \
  |  |  657|  5.50k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  5.50k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  5.50k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  5.50k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 5.50k]
  |  |  ------------------
  ------------------
  220|  5.50k|                IGRAPH_CHECK(igraph_vector_int_push_back(&new_edges, to));
  ------------------
  |  |  656|  5.50k|    do { \
  |  |  657|  5.50k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  5.50k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  5.50k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  5.50k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 5.50k]
  |  |  ------------------
  ------------------
  221|  5.50k|                IGRAPH_CHECK(igraph_vector_int_push_back(&eids_new2old, eid));
  ------------------
  |  |  656|  5.50k|    do { \
  |  |  657|  5.50k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  5.50k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  5.50k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  5.50k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 5.50k]
  |  |  ------------------
  ------------------
  222|  5.50k|            }
  223|   154k|        }
  224|   308k|    }
  225|       |
  226|       |    /* Get rid of some vectors that are not needed anymore */
  227|   302k|    if (!map) {
  ------------------
  |  Branch (227:9): [True: 302k, False: 0]
  ------------------
  228|   302k|        igraph_vector_int_destroy(&vids_old2new);
  229|   302k|        IGRAPH_FINALLY_CLEAN(1);
  230|   302k|    }
  231|   302k|    igraph_vector_int_destroy(&nei_edges);
  232|   302k|    IGRAPH_FINALLY_CLEAN(1);
  233|       |
  234|       |    /* Create the new graph */
  235|   302k|    IGRAPH_CHECK(igraph_create(res, &new_edges, no_of_new_nodes, directed));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  236|       |
  237|       |    /* Now we can also get rid of the new_edges vector */
  238|   302k|    igraph_vector_int_destroy(&new_edges);
  239|   302k|    IGRAPH_FINALLY_CLEAN(1);
  240|       |
  241|       |    /* Make sure that the newly created graph is destroyed if something happens from
  242|       |     * now on */
  243|   302k|    IGRAPH_FINALLY(igraph_destroy, res);
  ------------------
  |  |  603|   302k|    do { \
  |  |  604|   302k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   302k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   302k|         * incorrect destructor function with the pointer */ \
  |  |  607|   302k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 302k]
  |  |  ------------------
  |  |  608|   302k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  244|       |
  245|       |    /* Copy the graph attributes */
  246|   302k|    IGRAPH_CHECK(igraph_i_attribute_copy(res, graph, true, /* vertex= */ false, /* edge= */ false));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  247|       |
  248|       |    /* Copy the vertex attributes */
  249|   302k|    IGRAPH_CHECK(igraph_i_attribute_permute_vertices(graph, res, my_vids_new2old));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  250|       |
  251|       |    /* Copy the edge attributes */
  252|   302k|    IGRAPH_CHECK(igraph_i_attribute_permute_edges(graph, res, &eids_new2old));
  ------------------
  |  |  656|   302k|    do { \
  |  |  657|   302k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   302k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   302k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   302k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  253|       |
  254|       |    /* Get rid of the remaining stuff */
  255|   302k|    if (!invmap) {
  ------------------
  |  Branch (255:9): [True: 302k, False: 0]
  ------------------
  256|   302k|        igraph_vector_int_destroy(my_vids_new2old);
  257|   302k|        IGRAPH_FINALLY_CLEAN(1);
  258|   302k|    }
  259|   302k|    igraph_vector_int_destroy(&eids_new2old);
  260|   302k|    IGRAPH_FINALLY_CLEAN(2);   /* 1 + 1 since we don't need to destroy res */
  261|       |
  262|   302k|    return IGRAPH_SUCCESS;
  263|   302k|}

igraph_voronoi:
  366|  3.43k|        igraph_voronoi_tiebreaker_t tiebreaker) {
  367|       |
  368|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  369|  3.43k|    igraph_vector_int_t *pmembership;
  370|  3.43k|    igraph_vector_int_t imembership;
  371|  3.43k|    igraph_vector_t *pdistances;
  372|  3.43k|    igraph_vector_t idistances;
  373|       |
  374|  3.43k|    if (! igraph_is_directed(graph)) {
  ------------------
  |  Branch (374:9): [True: 0, False: 3.43k]
  ------------------
  375|      0|        mode = IGRAPH_ALL;
  376|      0|    }
  377|       |
  378|  3.43k|    if (tiebreaker != IGRAPH_VORONOI_FIRST &&
  ------------------
  |  Branch (378:9): [True: 3.43k, False: 0]
  ------------------
  379|  3.43k|        tiebreaker != IGRAPH_VORONOI_LAST &&
  ------------------
  |  Branch (379:9): [True: 3.43k, False: 0]
  ------------------
  380|  3.43k|        tiebreaker != IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (380:9): [True: 0, False: 3.43k]
  ------------------
  381|      0|        IGRAPH_ERROR("Invalid tiebreaker specification during Voronoi partitioning.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  382|      0|    }
  383|       |
  384|  3.43k|    if (! igraph_vector_int_isininterval(generators, 0, igraph_vcount(graph)-1)) {
  ------------------
  |  Branch (384:9): [True: 0, False: 3.43k]
  ------------------
  385|      0|        IGRAPH_ERROR("Invalid vertex ID given as Voronoi generator.", IGRAPH_EINVVID);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  386|      0|    }
  387|       |
  388|  3.43k|    if (membership) {
  ------------------
  |  Branch (388:9): [True: 3.43k, False: 0]
  ------------------
  389|  3.43k|        pmembership = membership;
  390|  3.43k|    } else {
  391|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&imembership, no_of_nodes);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  392|      0|        pmembership = &imembership;
  393|      0|    }
  394|       |
  395|  3.43k|    if (distances) {
  ------------------
  |  Branch (395:9): [True: 0, False: 3.43k]
  ------------------
  396|      0|        pdistances = distances;
  397|  3.43k|    } else {
  398|  3.43k|        IGRAPH_VECTOR_INIT_FINALLY(&idistances, no_of_nodes);
  ------------------
  |  |  104|  3.43k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.43k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  399|  3.43k|        pdistances = &idistances;
  400|  3.43k|    }
  401|       |
  402|  3.43k|    if (weights) {
  ------------------
  |  Branch (402:9): [True: 3.43k, False: 0]
  ------------------
  403|  3.43k|        IGRAPH_CHECK(igraph_i_voronoi_dijkstra(graph, pmembership, pdistances, generators, weights, mode, tiebreaker));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  404|  3.43k|    } else {
  405|      0|        IGRAPH_CHECK(igraph_i_voronoi(graph, pmembership, pdistances, generators, mode, tiebreaker));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  406|      0|    }
  407|       |
  408|  3.43k|    if (! distances) {
  ------------------
  |  Branch (408:9): [True: 3.43k, False: 0]
  ------------------
  409|  3.43k|        igraph_vector_destroy(&idistances);
  410|  3.43k|        IGRAPH_FINALLY_CLEAN(1);
  411|  3.43k|    }
  412|       |
  413|  3.43k|    if (! membership) {
  ------------------
  |  Branch (413:9): [True: 0, False: 3.43k]
  ------------------
  414|      0|        igraph_vector_int_destroy(&imembership);
  415|      0|        IGRAPH_FINALLY_CLEAN(1);
  416|      0|    }
  417|       |
  418|  3.43k|    return IGRAPH_SUCCESS;
  419|  3.43k|}
voronoi.c:igraph_i_voronoi_dijkstra:
  165|  3.43k|        igraph_voronoi_tiebreaker_t tiebreaker) {
  166|       |
  167|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  168|  3.43k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  169|  3.43k|    igraph_int_t no_of_generators = igraph_vector_int_size(generators);
  170|  3.43k|    igraph_inclist_t il;
  171|  3.43k|    igraph_2wheap_t q;
  172|       |
  173|       |    /* tie_count[vid] is the number of generators that vid is an equal distance from.
  174|       |     * We use this value to be able to randomly select one of the generators. */
  175|  3.43k|    igraph_vector_int_t tie_count;
  176|       |
  177|  3.43k|    if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (177:9): [True: 0, False: 3.43k]
  ------------------
  178|      0|        IGRAPH_ERRORF("Weight vector length (%" IGRAPH_PRId ") does not match number of edges (%" IGRAPH_PRId ").",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  179|      0|                      IGRAPH_EINVAL,
  180|      0|                      igraph_vector_size(weights), no_of_edges);
  181|      0|    }
  182|       |
  183|  3.43k|    if (no_of_edges > 0) {
  ------------------
  |  Branch (183:9): [True: 3.43k, False: 0]
  ------------------
  184|  3.43k|        igraph_real_t min = igraph_vector_min(weights);
  185|  3.43k|        if (min < 0) {
  ------------------
  |  Branch (185:13): [True: 0, False: 3.43k]
  ------------------
  186|      0|            IGRAPH_ERRORF("Weight vector must be non-negative, got %g.", IGRAPH_EINVAL, min);
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  187|  3.43k|        } else if (isnan(min)) {
  ------------------
  |  Branch (187:20): [True: 0, False: 3.43k]
  ------------------
  188|      0|            IGRAPH_ERROR("Weight vector must not contain NaN values.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  189|      0|        }
  190|  3.43k|    }
  191|       |
  192|  3.43k|    IGRAPH_CHECK(igraph_inclist_init(graph, &il, mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  193|  3.43k|    IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  194|       |
  195|  3.43k|    IGRAPH_CHECK(igraph_2wheap_init(&q, no_of_nodes));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  196|  3.43k|    IGRAPH_FINALLY(igraph_2wheap_destroy, &q);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  197|       |
  198|  3.43k|    if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (198:9): [True: 3.43k, False: 0]
  ------------------
  199|  3.43k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&tie_count, no_of_nodes);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  200|  3.43k|    }
  201|       |
  202|  3.43k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  203|  3.43k|    igraph_vector_int_fill(membership, -1);
  204|       |
  205|  3.43k|    IGRAPH_CHECK(igraph_vector_resize(mindist, no_of_nodes));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  206|  3.43k|    igraph_vector_fill(mindist, IGRAPH_INFINITY);
  ------------------
  |  |  137|  3.43k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  207|       |
  208|       |    /* Loop through all generator points and compute shortest paths to all other vertices.
  209|       |     * As we go, we keep track of the shortest distance from any generator to each vertex
  210|       |     * in 'mindist'. If we find that the distance from the current generator to a vertex
  211|       |     * is shorter than what was recorded so far in 'mindist', we update 'mindist' and
  212|       |     * assign that vertex to the current generator.
  213|       |     */
  214|   134k|    for (igraph_int_t i=0; i < no_of_generators; i++) {
  ------------------
  |  Branch (214:28): [True: 131k, False: 3.43k]
  ------------------
  215|   131k|        igraph_int_t g = VECTOR(*generators)[i];
  ------------------
  |  |   60|   131k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  216|       |
  217|       |        /* Weighted shortest path implementation using Dijkstra's algorithm */
  218|       |
  219|   131k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   131k|    do { \
  |  |   47|   131k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 131k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   131k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 131k]
  |  |  ------------------
  ------------------
  220|       |
  221|   131k|        igraph_2wheap_clear(&q);
  222|       |
  223|       |        /* We store negative distances in the maximum heap. Since some systems
  224|       |         * distinguish between -0.0 and +0.0, we need -0.0 to ensure +0.0 as
  225|       |         * the final result. */
  226|   131k|        IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, g, -0.0));
  ------------------
  |  |  656|   131k|    do { \
  |  |  657|   131k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   131k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   131k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 131k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   131k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 131k]
  |  |  ------------------
  ------------------
  227|       |
  228|   400k|        while (!igraph_2wheap_empty(&q)) {
  ------------------
  |  Branch (228:16): [True: 268k, False: 131k]
  ------------------
  229|   268k|            igraph_int_t vid = igraph_2wheap_max_index(&q);
  230|   268k|            igraph_real_t dist = -igraph_2wheap_deactivate_max(&q);
  231|       |
  232|   268k|            igraph_real_t md = VECTOR(*mindist)[vid];
  ------------------
  |  |   60|   268k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  233|       |
  234|   268k|            int cmp_result = igraph_cmp_epsilon(dist, md, IGRAPH_SHORTEST_PATH_EPSILON);
  ------------------
  |  |   35|   268k|#define IGRAPH_SHORTEST_PATH_EPSILON 1e-10
  ------------------
  235|   268k|            if (cmp_result > 0) { /* dist > md */
  ------------------
  |  Branch (235:17): [True: 28.4k, False: 240k]
  ------------------
  236|       |                /* This vertex is reachable at a shorter distance from
  237|       |                 * another generator. Thus all its descendants in the shortest
  238|       |                 * path tree are also reachable at a shorter distance from the
  239|       |                 * other generator than from the current one. Therefore
  240|       |                 * we do not need to search further from here. */
  241|  28.4k|                continue;
  242|   240k|            } else if (cmp_result < 0) { /* dist < md */
  ------------------
  |  Branch (242:24): [True: 167k, False: 72.2k]
  ------------------
  243|       |                /* This vertex is closest to the current generator so far.
  244|       |                 * Assign it to the current partition. */
  245|   167k|                VECTOR(*mindist)[vid] = dist;
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  246|   167k|                VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  247|   167k|                if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (247:21): [True: 167k, False: 0]
  ------------------
  248|   167k|                    VECTOR(tie_count)[vid] = 1;
  ------------------
  |  |   60|   167k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  249|   167k|                }
  250|   167k|            } else { /* md == dist, we have a tie */
  251|  72.2k|                switch (tiebreaker) {
  ------------------
  |  Branch (251:25): [True: 72.2k, False: 0]
  ------------------
  252|      0|                case IGRAPH_VORONOI_FIRST:
  ------------------
  |  Branch (252:17): [True: 0, False: 72.2k]
  ------------------
  253|       |                    /* Never replace existing generator assignment. */
  254|      0|                    break;
  255|      0|                case IGRAPH_VORONOI_LAST:
  ------------------
  |  Branch (255:17): [True: 0, False: 72.2k]
  ------------------
  256|       |                    /* Always replace existing generator assignment. */
  257|      0|                    VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  258|      0|                    break;
  259|  72.2k|                case IGRAPH_VORONOI_RANDOM:
  ------------------
  |  Branch (259:17): [True: 72.2k, False: 0]
  ------------------
  260|       |                    /* We replace the membership assignment with probability 1/k upon
  261|       |                     * encountering the kth same-distance generator. This ensures
  262|       |                     * that one of these generators is selected uniformly at random. */
  263|  72.2k|                    VECTOR(tie_count)[vid]++;
  ------------------
  |  |   60|  72.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  264|  72.2k|                    if (RNG_UNIF01() < 1.0 / VECTOR(tie_count)[vid]) {
  ------------------
  |  |  155|  72.2k|#define RNG_UNIF01()     (igraph_rng_get_unif01(igraph_rng_default()))
  ------------------
                                  if (RNG_UNIF01() < 1.0 / VECTOR(tie_count)[vid]) {
  ------------------
  |  |   60|  72.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (264:25): [True: 17.4k, False: 54.8k]
  ------------------
  265|  17.4k|                        VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|  17.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  266|  17.4k|                    }
  267|  72.2k|                    break;
  268|  72.2k|                }
  269|  72.2k|            }
  270|       |
  271|   240k|            igraph_vector_int_t *inc_edges = igraph_inclist_get(&il, vid);
  ------------------
  |  |  102|   240k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  272|   240k|            igraph_int_t inc_count = igraph_vector_int_size(inc_edges);
  273|   405k|            for (igraph_int_t j=0; j < inc_count; j++) {
  ------------------
  |  Branch (273:36): [True: 164k, False: 240k]
  ------------------
  274|   164k|                igraph_int_t edge = VECTOR(*inc_edges)[j];
  ------------------
  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  275|   164k|                igraph_real_t weight = VECTOR(*weights)[edge];
  ------------------
  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  276|       |
  277|       |                /* Optimization: do not follow infinite-weight edges. */
  278|   164k|                if (weight == IGRAPH_INFINITY) {
  ------------------
  |  |  137|   164k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  |  Branch (278:21): [True: 0, False: 164k]
  ------------------
  279|      0|                    continue;
  280|      0|                }
  281|       |
  282|   164k|                igraph_int_t to = IGRAPH_OTHER(graph, edge, vid);
  ------------------
  |  |  146|   164k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   164k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|      0|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   164k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 164k]
  |  |  ------------------
  ------------------
  283|   164k|                igraph_real_t altdist = dist + weight;
  284|       |
  285|   164k|                if (! igraph_2wheap_has_elem(&q, to)) {
  ------------------
  |  Branch (285:21): [True: 137k, False: 27.4k]
  ------------------
  286|       |                    /* This is the first non-infinite distance */
  287|   137k|                    IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, to, -altdist));
  ------------------
  |  |  656|   137k|    do { \
  |  |  657|   137k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   137k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   137k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 137k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   137k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 137k]
  |  |  ------------------
  ------------------
  288|   137k|                } else if (igraph_2wheap_has_active(&q, to)) {
  ------------------
  |  Branch (288:28): [True: 8.78k, False: 18.6k]
  ------------------
  289|  8.78k|                    igraph_real_t curdist = -igraph_2wheap_get(&q, to);
  290|  8.78k|                    if (altdist < curdist) {
  ------------------
  |  Branch (290:25): [True: 1.93k, False: 6.84k]
  ------------------
  291|       |                        /* This is a shorter path */
  292|  1.93k|                        igraph_2wheap_modify(&q, to, -altdist);
  293|  1.93k|                    }
  294|  8.78k|                }
  295|   164k|            }
  296|   240k|        } /* !igraph_2wheap_empty(&q) */
  297|   131k|    }
  298|       |
  299|  3.43k|    if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (299:9): [True: 3.43k, False: 0]
  ------------------
  300|  3.43k|        igraph_vector_int_destroy(&tie_count);
  301|  3.43k|        IGRAPH_FINALLY_CLEAN(1);
  302|  3.43k|    }
  303|       |
  304|  3.43k|    igraph_2wheap_destroy(&q);
  305|  3.43k|    igraph_inclist_destroy(&il);
  306|  3.43k|    IGRAPH_FINALLY_CLEAN(2);
  307|       |
  308|  3.43k|    return IGRAPH_SUCCESS;
  309|  3.43k|}

igraph_strength:
  619|  14.0k|) {
  620|       |
  621|  14.0k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  622|  14.0k|    igraph_vit_t vit;
  623|  14.0k|    igraph_int_t no_vids;
  624|  14.0k|    igraph_vector_int_t degrees;
  625|  14.0k|    igraph_vector_int_t neis;
  626|       |
  627|  14.0k|    if (! weights) {
  ------------------
  |  Branch (627:9): [True: 0, False: 14.0k]
  ------------------
  628|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  629|      0|        IGRAPH_CHECK(igraph_degree(graph, &degrees, vids, mode, loops));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  630|      0|        no_vids = igraph_vector_int_size(&degrees);
  631|      0|        IGRAPH_CHECK(igraph_vector_resize(res, no_vids));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  632|      0|        for (igraph_int_t i = 0; i < no_vids; i++) {
  ------------------
  |  Branch (632:34): [True: 0, False: 0]
  ------------------
  633|      0|            VECTOR(*res)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*res)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  634|      0|        }
  635|      0|        igraph_vector_int_destroy(&degrees);
  636|      0|        IGRAPH_FINALLY_CLEAN(1);
  637|      0|        return IGRAPH_SUCCESS;
  638|      0|    }
  639|       |
  640|  14.0k|    if (igraph_vector_size(weights) != igraph_ecount(graph)) {
  ------------------
  |  Branch (640:9): [True: 0, False: 14.0k]
  ------------------
  641|      0|        IGRAPH_ERROR("Invalid weight vector length.", IGRAPH_EINVAL);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  642|      0|    }
  643|       |
  644|  14.0k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (644:9): [True: 6.97k, False: 7.08k]
  |  Branch (644:31): [True: 3.43k, False: 3.54k]
  |  Branch (644:52): [True: 0, False: 3.43k]
  ------------------
  645|      0|        IGRAPH_ERROR("Invalid mode for vertex strength calculation.", IGRAPH_EINVMODE);
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  646|      0|    }
  647|       |
  648|  14.0k|    if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (648:9): [True: 14.0k, False: 0]
  ------------------
  649|  14.0k|        return strength_all(graph, res, mode, loops, weights);
  650|  14.0k|    }
  651|       |
  652|      0|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  653|      0|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|      0|    do { \
  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  ------------------
  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  654|      0|    no_vids = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|      0|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
  655|       |
  656|      0|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  657|      0|    IGRAPH_CHECK(igraph_vector_int_reserve(&neis, no_of_nodes));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  658|      0|    IGRAPH_CHECK(igraph_vector_resize(res, no_vids));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  659|      0|    igraph_vector_null(res);
  660|       |
  661|      0|    for (igraph_int_t i = 0; !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
                  for (igraph_int_t i = 0; !IGRAPH_VIT_END(vit); IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
  |  Branch (661:30): [True: 0, False: 0]
  ------------------
  662|      0|        IGRAPH_CHECK(igraph_incident(graph, &neis, IGRAPH_VIT_GET(vit), mode, loops));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  ------------------
  |  |  |  Branch (657:40): [True: 0, False: 0]
  |  |  ------------------
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  663|      0|        const igraph_int_t n = igraph_vector_int_size(&neis);
  664|      0|        for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (664:34): [True: 0, False: 0]
  ------------------
  665|      0|            igraph_int_t edge = VECTOR(neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  666|      0|            VECTOR(*res)[i] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*res)[i] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  667|      0|        }
  668|      0|    }
  669|       |
  670|      0|    igraph_vit_destroy(&vit);
  671|      0|    igraph_vector_int_destroy(&neis);
  672|      0|    IGRAPH_FINALLY_CLEAN(2);
  673|       |
  674|      0|    return IGRAPH_SUCCESS;
  675|      0|}
degrees.c:strength_all:
  540|  14.0k|        const igraph_vector_t *weights) {
  541|       |
  542|       |    // When calculating strength for all vertices, iterating over edges is faster
  543|  14.0k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  544|  14.0k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  545|       |
  546|  14.0k|    IGRAPH_CHECK(igraph_vector_resize(res, no_of_nodes));
  ------------------
  |  |  656|  14.0k|    do { \
  |  |  657|  14.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  14.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
  547|  14.0k|    igraph_vector_null(res);
  548|       |
  549|  14.0k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (549:9): [True: 0, False: 14.0k]
  ------------------
  550|      0|        mode = IGRAPH_ALL;
  551|      0|    }
  552|       |
  553|  14.0k|    if (loops) {
  ------------------
  |  Branch (553:9): [True: 10.6k, False: 3.43k]
  ------------------
  554|  10.6k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (554:13): [True: 7.08k, False: 3.54k]
  ------------------
  555|   199k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (555:41): [True: 192k, False: 7.08k]
  ------------------
  556|   192k|                VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|   192k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |  115|   192k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   192k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                              VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|   192k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  557|   192k|            }
  558|  7.08k|        }
  559|  10.6k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (559:13): [True: 3.54k, False: 7.08k]
  ------------------
  560|  99.5k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (560:41): [True: 96.0k, False: 3.54k]
  ------------------
  561|  96.0k|                VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |  128|  96.0k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                              VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  96.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  562|  96.0k|            }
  563|  3.54k|        }
  564|  10.6k|    } else {
  565|  3.43k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (565:13): [True: 3.43k, False: 0]
  ------------------
  566|  60.8k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (566:41): [True: 57.3k, False: 3.43k]
  ------------------
  567|  57.3k|                igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  57.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  568|  57.3k|                if (from != IGRAPH_TO(graph, edge)) {
  ------------------
  |  |  128|  57.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (568:21): [True: 57.3k, False: 0]
  ------------------
  569|  57.3k|                   VECTOR(*res)[from] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                 VECTOR(*res)[from] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  570|  57.3k|                }
  571|  57.3k|            }
  572|  3.43k|        }
  573|  3.43k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (573:13): [True: 3.43k, False: 0]
  ------------------
  574|  60.8k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (574:41): [True: 57.3k, False: 3.43k]
  ------------------
  575|  57.3k|                igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  57.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  576|  57.3k|                if (IGRAPH_FROM(graph, edge) != to) {
  ------------------
  |  |  115|  57.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (576:21): [True: 57.3k, False: 0]
  ------------------
  577|  57.3k|                    VECTOR(*res)[to] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[to] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  578|  57.3k|                }
  579|  57.3k|            }
  580|  3.43k|        }
  581|  3.43k|    }
  582|       |
  583|  14.0k|    return IGRAPH_SUCCESS;
  584|  14.0k|}

igraph_ecc:
  361|  3.43k|                          igraph_bool_t offset, igraph_bool_t normalize) {
  362|       |
  363|  3.43k|    if (k < 3) {
  ------------------
  |  Branch (363:9): [True: 0, False: 3.43k]
  ------------------
  364|      0|        IGRAPH_ERRORF("Cycle size for edge clustering coefficient must be at least 3, got %" IGRAPH_PRId ".",
  ------------------
  |  |  464|      0|    do { \
  |  |  465|      0|        igraph_errorf(reason, IGRAPH_FILE_BASENAME, __LINE__, \
  |  |  466|      0|                      igraph_errno, __VA_ARGS__) ; \
  |  |  467|      0|        return igraph_errno; \
  |  |  468|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (468:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  365|      0|                      IGRAPH_EINVAL, k);
  366|      0|    }
  367|       |
  368|  3.43k|    switch (k) {
  369|  3.43k|    case 3:
  ------------------
  |  Branch (369:5): [True: 3.43k, False: 0]
  ------------------
  370|  3.43k|        if (igraph_es_is_all(&eids)) {
  ------------------
  |  Branch (370:13): [True: 3.43k, False: 0]
  ------------------
  371|  3.43k|            return igraph_i_ecc3_1(graph, res, eids, offset, normalize);
  372|  3.43k|        } else {
  373|      0|            return igraph_i_ecc3_2(graph, res, eids, offset, normalize);
  374|      0|        }
  375|      0|    case 4:
  ------------------
  |  Branch (375:5): [True: 0, False: 3.43k]
  ------------------
  376|      0|        if (igraph_es_is_all(&eids)) {
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            return igraph_i_ecc4_1(graph, res, eids, offset, normalize);
  378|      0|        } else {
  379|      0|            return igraph_i_ecc4_2(graph, res, eids, offset, normalize);
  380|      0|        }
  381|      0|    default:
  ------------------
  |  Branch (381:5): [True: 0, False: 3.43k]
  ------------------
  382|      0|        IGRAPH_ERROR("Edge clustering coefficient calculation is only implemented for cycle sizes 3 and 4.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  383|  3.43k|                     IGRAPH_UNIMPLEMENTED);
  384|  3.43k|    }
  385|  3.43k|}
ecc.c:igraph_i_ecc3_1:
   35|  3.43k|        igraph_bool_t offset, igraph_bool_t normalize) {
   36|       |
   37|  3.43k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   38|  3.43k|    igraph_vector_int_t degree;
   39|  3.43k|    igraph_adjlist_t al;
   40|  3.43k|    igraph_eit_t eit;
   41|  3.43k|    const igraph_real_t c = offset ? 1.0 : 0.0;
  ------------------
  |  Branch (41:29): [True: 3.43k, False: 0]
  ------------------
   42|       |
   43|  3.43k|    IGRAPH_CHECK(igraph_adjlist_init(graph, &al, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_NO_MULTIPLE));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   44|  3.43k|    IGRAPH_FINALLY(igraph_adjlist_destroy, &al);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   45|       |
   46|  3.43k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degree, no_of_nodes);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   47|  3.43k|    IGRAPH_CHECK(igraph_degree(graph, &degree, igraph_vss_all(), IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   48|       |
   49|  3.43k|    IGRAPH_CHECK(igraph_eit_create(graph, eids, &eit));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   50|  3.43k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  3.43k|    do { \
  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  ------------------
  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   51|       |
   52|  3.43k|    IGRAPH_CHECK(igraph_vector_resize(res, IGRAPH_EIT_SIZE(eit)));
  ------------------
  |  |  656|  3.43k|    do { \
  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
   53|       |
   54|  3.43k|    for (igraph_int_t i=0;
   55|  60.8k|         ! IGRAPH_EIT_END(eit);
  ------------------
  |  |  371|  60.8k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
  |  Branch (55:10): [True: 57.3k, False: 3.43k]
  ------------------
   56|  57.3k|         IGRAPH_EIT_NEXT(eit), i++) {
  ------------------
  |  |  359|  57.3k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
   57|       |
   58|  57.3k|        igraph_int_t edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  57.3k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 57.3k, False: 0]
  |  |  ------------------
  |  |  406|  57.3k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   59|  57.3k|        igraph_int_t v1 = IGRAPH_FROM(graph, edge), v2 = IGRAPH_TO(graph, edge);
  ------------------
  |  |  115|  57.3k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      igraph_int_t v1 = IGRAPH_FROM(graph, edge), v2 = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  57.3k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   60|       |
   61|  57.3k|        igraph_real_t z; /* number of triangles the edge participates in */
   62|  57.3k|        igraph_real_t s; /* max number of triangles the edge could be part of */
   63|       |
   64|  57.3k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  57.3k|    do { \
  |  |   47|  57.3k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 57.3k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  57.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 57.3k]
  |  |  ------------------
  ------------------
   65|       |
   66|  57.3k|        if (v1 == v2) {
  ------------------
  |  Branch (66:13): [True: 0, False: 57.3k]
  ------------------
   67|       |            /* A self-loop isn't, and cannot be part of any triangles. */
   68|      0|            z = 0.0;
   69|      0|            s = 0.0;
   70|  57.3k|        } else {
   71|  57.3k|            const igraph_vector_int_t *a1 = igraph_adjlist_get(&al, v1), *a2 = igraph_adjlist_get(&al, v2);
  ------------------
  |  |   73|  57.3k|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
                          const igraph_vector_int_t *a1 = igraph_adjlist_get(&al, v1), *a2 = igraph_adjlist_get(&al, v2);
  ------------------
  |  |   73|  57.3k|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
   72|  57.3k|            igraph_int_t d1 = VECTOR(degree)[v1], d2 = VECTOR(degree)[v2];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          igraph_int_t d1 = VECTOR(degree)[v1], d2 = VECTOR(degree)[v2];
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   73|       |
   74|  57.3k|            z = igraph_vector_int_intersection_size_sorted(a1, a2);
   75|  57.3k|            s = (d1 < d2 ? d1 : d2) - 1.0;
  ------------------
  |  Branch (75:18): [True: 24.0k, False: 33.3k]
  ------------------
   76|  57.3k|        }
   77|       |
   78|  57.3k|        VECTOR(*res)[i] = z + c;
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   79|  57.3k|        if (normalize) VECTOR(*res)[i] /= s;
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (79:13): [True: 57.3k, False: 0]
  ------------------
   80|  57.3k|    }
   81|       |
   82|  3.43k|    igraph_eit_destroy(&eit);
   83|  3.43k|    igraph_vector_int_destroy(&degree);
   84|  3.43k|    igraph_adjlist_destroy(&al);
   85|  3.43k|    IGRAPH_FINALLY_CLEAN(3);
   86|       |
   87|  3.43k|    return IGRAPH_SUCCESS;
   88|  3.43k|}

igraph_is_simple:
   52|  3.54k|igraph_error_t igraph_is_simple(const igraph_t *graph, igraph_bool_t *res, igraph_bool_t directed) {
   53|  3.54k|    igraph_int_t vc = igraph_vcount(graph);
   54|  3.54k|    igraph_int_t ec = igraph_ecount(graph);
   55|       |
   56|       |    /* Is it already known whether the graph has loops or multi-edges? */
   57|  3.54k|    igraph_bool_t known_loop, known_multi;
   58|       |
   59|       |    /* If it is known, does the graph have them? */
   60|  3.54k|    igraph_bool_t has_loop, has_multi;
   61|       |
   62|       |    /* Will we need to check mutual edges explicitly? */
   63|  3.54k|    igraph_bool_t need_to_check_mutual = (! directed) && igraph_is_directed(graph);
  ------------------
  |  Branch (63:42): [True: 0, False: 3.54k]
  |  Branch (63:58): [True: 0, False: 0]
  ------------------
   64|       |
   65|  3.54k|    known_loop  = igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP);
   66|  3.54k|    if (known_loop) {
  ------------------
  |  Branch (66:9): [True: 3.54k, False: 0]
  ------------------
   67|  3.54k|        has_loop = igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP);
   68|  3.54k|        if (has_loop) {
  ------------------
  |  Branch (68:13): [True: 0, False: 3.54k]
  ------------------
   69|      0|            *res = false;
   70|      0|            goto early_exit;
   71|      0|        }
   72|  3.54k|    }
   73|       |
   74|  3.54k|    known_multi = igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI);
   75|  3.54k|    if (known_multi) {
  ------------------
  |  Branch (75:9): [True: 3.54k, False: 0]
  ------------------
   76|  3.54k|        has_multi = igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI);
   77|  3.54k|        if (has_multi) {
  ------------------
  |  Branch (77:13): [True: 0, False: 3.54k]
  ------------------
   78|      0|            *res = false;
   79|      0|            goto early_exit;
   80|      0|        }
   81|  3.54k|    }
   82|       |
   83|  3.54k|    if (known_loop && known_multi && !has_loop && !has_multi) {
  ------------------
  |  Branch (83:9): [True: 3.54k, False: 0]
  |  Branch (83:23): [True: 3.54k, False: 0]
  |  Branch (83:38): [True: 3.54k, False: 0]
  |  Branch (83:51): [True: 3.54k, False: 0]
  ------------------
   84|  3.54k|        *res = true;
   85|  3.54k|        goto early_exit;
   86|  3.54k|    }
   87|       |
   88|       |    /* Up to now, these variables were used to store the cache status.
   89|       |     * From here on, we re-use them to store the outcome of explicit
   90|       |     * checks. */
   91|       |
   92|      0|    known_loop = known_multi = false;
   93|      0|    has_loop = has_multi = false; /* be optimistic */
   94|       |
   95|      0|    if (vc == 0 || ec == 0) {
  ------------------
  |  Branch (95:9): [True: 0, False: 0]
  |  Branch (95:20): [True: 0, False: 0]
  ------------------
   96|      0|        *res = true;
   97|      0|        known_loop = known_multi = true;
   98|      0|    } else {
   99|      0|        igraph_vector_int_t neis;
  100|      0|        IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|      0|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|      0|    do { \
  |  |  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|      0|    do { \
  |  |  |  |  604|      0|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|      0|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|      0|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|      0|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  608|      0|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 0]
  |  |  ------------------
  ------------------
  101|      0|        for (igraph_int_t i = 0; i < vc; i++) {
  ------------------
  |  Branch (101:34): [True: 0, False: 0]
  ------------------
  102|      0|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  103|      0|                graph, &neis, i, IGRAPH_OUT, IGRAPH_LOOPS, IGRAPH_MULTIPLE
  104|      0|            ));
  105|      0|            const igraph_int_t n = igraph_vector_int_size(&neis);
  106|      0|            for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (106:38): [True: 0, False: 0]
  ------------------
  107|      0|                if (VECTOR(neis)[j] == i) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (107:21): [True: 0, False: 0]
  ------------------
  108|      0|                    known_loop = true; has_loop = true; break;
  109|      0|                }
  110|       |                /* Attention: If the graph is undirected, self-loops appears
  111|       |                 * twice in the neighbour list. This does not mean that there
  112|       |                 * are multi-edges. We do not need to worry about this as loop
  113|       |                 * are already caught above. */
  114|      0|                if (j > 0 && VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              if (j > 0 && VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (114:21): [True: 0, False: 0]
  |  Branch (114:30): [True: 0, False: 0]
  ------------------
  115|      0|                    known_multi = true; has_multi = true; break;
  116|      0|                }
  117|      0|            }
  118|      0|        }
  119|      0|        *res = !has_loop && !has_multi;
  ------------------
  |  Branch (119:16): [True: 0, False: 0]
  |  Branch (119:29): [True: 0, False: 0]
  ------------------
  120|      0|        if (*res) {
  ------------------
  |  Branch (120:13): [True: 0, False: 0]
  ------------------
  121|      0|            known_multi = known_loop = true;
  122|      0|        }
  123|      0|        igraph_vector_int_destroy(&neis);
  124|      0|        IGRAPH_FINALLY_CLEAN(1);
  125|      0|    }
  126|       |
  127|      0|    if (known_loop) {
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, has_loop);
  129|      0|    }
  130|       |
  131|      0|    if (known_multi) {
  ------------------
  |  Branch (131:9): [True: 0, False: 0]
  ------------------
  132|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, has_multi);
  133|      0|    }
  134|       |
  135|  3.54k|early_exit:
  136|       |    /* If at this point we have concluded that the graph is simple, _but_ the user
  137|       |     * asked us to ignore edge directions, we need to look for mutual edge pairs
  138|       |     * and return false if we find one. */
  139|  3.54k|    if (*res && need_to_check_mutual) {
  ------------------
  |  Branch (139:9): [True: 3.54k, False: 0]
  |  Branch (139:17): [True: 0, False: 3.54k]
  ------------------
  140|       |        /* If the graph is undirected, we also check for mutual edges. */
  141|      0|        igraph_bool_t has_mutual;
  142|      0|        IGRAPH_CHECK(igraph_has_mutual(graph, &has_mutual, false));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  143|      0|        if (has_mutual) {
  ------------------
  |  Branch (143:13): [True: 0, False: 0]
  ------------------
  144|      0|            *res = false;
  145|      0|        }
  146|      0|    }
  147|       |
  148|  3.54k|    return IGRAPH_SUCCESS;
  149|  3.54k|}
igraph_has_multiple:
  176|  3.54k|igraph_error_t igraph_has_multiple(const igraph_t *graph, igraph_bool_t *res) {
  177|  3.54k|    igraph_int_t vc = igraph_vcount(graph);
  178|  3.54k|    igraph_int_t ec = igraph_ecount(graph);
  179|  3.54k|    igraph_bool_t directed = igraph_is_directed(graph);
  180|       |
  181|  3.54k|    IGRAPH_RETURN_IF_CACHED_BOOL(graph, IGRAPH_PROP_HAS_MULTI, res);
  ------------------
  |  |   97|  3.54k|    do { \
  |  |   98|  3.54k|        if (igraph_i_property_cache_has((graphptr), (prop))) { \
  |  |  ------------------
  |  |  |  Branch (98:13): [True: 0, False: 3.54k]
  |  |  ------------------
  |  |   99|      0|            *(resptr) = igraph_i_property_cache_get_bool((graphptr), (prop)); \
  |  |  100|      0|            return IGRAPH_SUCCESS; \
  |  |  101|      0|        } \
  |  |  102|  3.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
  182|       |
  183|  3.54k|    if (vc == 0 || ec == 0) {
  ------------------
  |  Branch (183:9): [True: 1, False: 3.53k]
  |  Branch (183:20): [True: 106, False: 3.43k]
  ------------------
  184|    107|        *res = false;
  185|  3.43k|    } else {
  186|  3.43k|        igraph_vector_int_t neis;
  187|  3.43k|        igraph_int_t i, j, n;
  188|  3.43k|        igraph_bool_t found = false;
  189|  3.43k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  3.43k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.43k|    do { \
  |  |  |  |  657|  3.43k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.43k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.43k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.43k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.43k|    do { \
  |  |  |  |  604|  3.43k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.43k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.43k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.43k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.43k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.43k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.43k]
  |  |  ------------------
  ------------------
  190|   155k|        for (i = 0; i < vc && !found; i++) {
  ------------------
  |  Branch (190:21): [True: 151k, False: 3.43k]
  |  Branch (190:31): [True: 151k, False: 0]
  ------------------
  191|   151k|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|   151k|    do { \
  |  |  657|   151k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   151k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   151k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 151k]
  |  |  ------------------
  ------------------
  192|   151k|                graph, &neis, i, IGRAPH_OUT, IGRAPH_LOOPS, IGRAPH_MULTIPLE
  193|   151k|            ));
  194|   151k|            n = igraph_vector_int_size(&neis);
  195|   214k|            for (j = 1; j < n; j++) {
  ------------------
  |  Branch (195:25): [True: 62.7k, False: 151k]
  ------------------
  196|  62.7k|                if (VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|  62.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              if (VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|  62.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (196:21): [True: 0, False: 62.7k]
  ------------------
  197|       |                    /* If the graph is undirected, loop edges appear twice in the neighbor
  198|       |                     * list, so check the next item as well */
  199|      0|                    if (directed) {
  ------------------
  |  Branch (199:25): [True: 0, False: 0]
  ------------------
  200|       |                        /* Directed, so this is a real multiple edge */
  201|      0|                        found = true; break;
  202|      0|                    } else if (VECTOR(neis)[j - 1] != i) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (202:32): [True: 0, False: 0]
  ------------------
  203|       |                        /* Undirected, but not a loop edge */
  204|      0|                        found = true; break;
  205|      0|                    } else if (j < n - 1 && VECTOR(neis)[j] == VECTOR(neis)[j + 1]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  } else if (j < n - 1 && VECTOR(neis)[j] == VECTOR(neis)[j + 1]) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (205:32): [True: 0, False: 0]
  |  Branch (205:45): [True: 0, False: 0]
  ------------------
  206|       |                        /* Undirected, loop edge, multiple times */
  207|      0|                        found = true; break;
  208|      0|                    }
  209|      0|                }
  210|  62.7k|            }
  211|   151k|        }
  212|  3.43k|        *res = found;
  213|  3.43k|        igraph_vector_int_destroy(&neis);
  214|  3.43k|        IGRAPH_FINALLY_CLEAN(1);
  215|  3.43k|    }
  216|       |
  217|  3.54k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, *res);
  218|       |
  219|  3.54k|    return IGRAPH_SUCCESS;
  220|  3.54k|}

igraph_rng_default:
  188|   232M|igraph_rng_t *igraph_rng_default(void) {
  189|   232M|    return igraph_i_rng_default_ptr;
  190|   232M|}
igraph_rng_seed:
  260|  3.56k|igraph_error_t igraph_rng_seed(igraph_rng_t *rng, igraph_uint_t seed) {
  261|  3.56k|    const igraph_rng_type_t *type = rng->type;
  262|  3.56k|    IGRAPH_CHECK(type->seed(rng->state, seed));
  ------------------
  |  |  656|  3.56k|    do { \
  |  |  657|  3.56k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.56k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.56k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.56k]
  |  |  ------------------
  ------------------
  263|  3.56k|    rng->is_seeded = true;
  264|  3.56k|    return IGRAPH_SUCCESS;
  265|  3.56k|}
igraph_rng_bits:
  277|   231M|igraph_int_t igraph_rng_bits(const igraph_rng_t* rng) {
  278|   231M|    return rng->type->bits;
  279|   231M|}
igraph_rng_get_integer:
  593|   116M|) {
  594|   116M|    const igraph_rng_type_t *type = rng->type;
  595|   116M|    igraph_uint_t range;
  596|       |
  597|   116M|    assert(h >= l);
  ------------------
  |  Branch (597:5): [True: 0, False: 116M]
  |  Branch (597:5): [True: 116M, False: 0]
  ------------------
  598|       |
  599|   116M|    if (h == l) {
  ------------------
  |  Branch (599:9): [True: 205k, False: 116M]
  ------------------
  600|   205k|        return l;
  601|   205k|    }
  602|       |
  603|   116M|    if (type->get_int) {
  ------------------
  |  Branch (603:9): [True: 0, False: 116M]
  ------------------
  604|      0|        return type->get_int(rng->state, l, h);
  605|      0|    }
  606|       |
  607|   116M|    if (IGRAPH_UNLIKELY(l == IGRAPH_INTEGER_MIN && h == IGRAPH_INTEGER_MAX)) {
  ------------------
  |  |  612|   116M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 0, False: 116M]
  |  |  |  Branch (612:52): [True: 0, False: 116M]
  |  |  |  Branch (612:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  608|       |        /* Full uint range is needed, we can just grab a random number from
  609|       |         * the uint range and cast it to a signed integer */
  610|      0|        return (igraph_int_t) igraph_i_rng_get_uint(rng);
  611|   116M|    } else if (l >= 0 || h < 0) {
  ------------------
  |  Branch (611:16): [True: 116M, False: 0]
  |  Branch (611:26): [True: 0, False: 0]
  ------------------
  612|       |        /* this is okay, (h - l) will not overflow an igraph_int_t */
  613|   116M|        range = (igraph_uint_t)(h - l) + 1;
  614|   116M|    } else {
  615|       |        /* (h - l) could potentially overflow so we need to play it safe. If we
  616|       |         * are here, l < 0 and h >= 0 so we can cast -l into an igraph_uint_t
  617|       |         * safely and do the subtraction that way */
  618|      0|        range = ((igraph_uint_t)(h)) + ((igraph_uint_t)(-l)) + 1;
  619|      0|    }
  620|       |
  621|   116M|    return l + igraph_i_rng_get_uint_bounded(rng, range);
  622|   116M|}
igraph_rng_get_unif:
  671|   115M|                                  igraph_real_t l, igraph_real_t h) {
  672|   115M|    assert(h >= l);
  ------------------
  |  Branch (672:5): [True: 0, False: 115M]
  |  Branch (672:5): [True: 115M, False: 0]
  ------------------
  673|       |
  674|   115M|    if (l == h) return h;
  ------------------
  |  Branch (674:9): [True: 0, False: 115M]
  ------------------
  675|       |
  676|       |    /* Ensure that 'h' is never produced due to numerical roundoff errors, except when l == h. */
  677|   115M|    igraph_real_t r;
  678|   115M|    do {
  679|   115M|        r = igraph_rng_get_unif01(rng) * (h - l) + l;
  680|   115M|    } while (IGRAPH_UNLIKELY(r == h));
  ------------------
  |  |  612|   115M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 0, False: 115M]
  |  |  ------------------
  ------------------
  681|   115M|    return r;
  682|   115M|}
igraph_rng_get_unif01:
  698|   115M|igraph_real_t igraph_rng_get_unif01(igraph_rng_t *rng) {
  699|   115M|    const igraph_rng_type_t *type = rng->type;
  700|   115M|    if (type->get_real) {
  ------------------
  |  Branch (700:9): [True: 0, False: 115M]
  ------------------
  701|      0|        return type->get_real(rng->state);
  702|   115M|    } else {
  703|       |        /* We extract 52 random bits from a 64-bit uint and fill that directly
  704|       |         * into the mantissa of a double, bit-by-bit, clear the sign bit and
  705|       |         * set the exponent to 2^0. This way we get a 52-bit random double
  706|       |         * between 1 (inclusive) and 2 (exclusive), uniformly distributed.
  707|       |         * Then we subtract 1 to arrive at the [0; 1) interval. This is fast
  708|       |         * but we lose one bit of precision as there are 2^53 possible doubles
  709|       |         * between 0 and 1. */
  710|   115M|        union {
  711|   115M|            uint64_t as_uint64_t;
  712|   115M|            double as_double;
  713|   115M|        } value;
  714|   115M|        value.as_uint64_t =
  715|   115M|            (igraph_i_rng_get_random_bits_uint64(rng, 52) & 0xFFFFFFFFFFFFFull) | 0x3FF0000000000000ull;
  716|   115M|        return value.as_double - 1.0;
  717|   115M|    }
  718|   115M|}
random.c:igraph_i_rng_get_random_bits:
  336|   116M|static igraph_uint_t igraph_i_rng_get_random_bits(igraph_rng_t *rng, uint8_t bits) {
  337|   116M|    const igraph_rng_type_t *type = rng->type;
  338|   116M|    igraph_int_t rng_bitwidth = igraph_rng_bits(rng);
  339|   116M|    igraph_uint_t result;
  340|       |
  341|   116M|    if (rng_bitwidth >= bits) {
  ------------------
  |  Branch (341:9): [True: 116M, False: 0]
  ------------------
  342|       |        /* keep the high bits as RNGs sometimes tend to have lower entropy in
  343|       |         * low bits than in high bits */
  344|   116M|        result = type->get(rng->state) >> (rng_bitwidth - bits);
  345|   116M|    } else {
  346|      0|        result = 0;
  347|      0|        do {
  348|      0|            result = (result << rng_bitwidth) + type->get(rng->state);
  349|      0|            bits -= rng_bitwidth;
  350|      0|        } while (bits > rng_bitwidth);
  ------------------
  |  Branch (350:18): [True: 0, False: 0]
  ------------------
  351|       |
  352|       |        /* and now the last piece */
  353|      0|        result = (result << bits) + (type->get(rng->state) >> (rng_bitwidth - bits));
  354|      0|    }
  355|       |
  356|   116M|    return result;
  357|   116M|}
random.c:igraph_i_rng_get_uint_bounded:
  532|   116M|static igraph_uint_t igraph_i_rng_get_uint_bounded(igraph_rng_t *rng, igraph_uint_t range) {
  533|       |    /* We must make this function behave the same way for range < 2^32 so igraph
  534|       |     * behaves the same way on 32-bit and 64-bit platforms as long as we stick
  535|       |     * to integers less than 2^32. This is to ensure that the unit tests are
  536|       |     * consistent */
  537|       |
  538|       |#if IGRAPH_INTEGER_SIZE == 32
  539|       |    return igraph_i_rng_get_uint32_bounded(rng, range);
  540|       |#else
  541|   116M|    if (range <= UINT32_MAX) {
  ------------------
  |  Branch (541:9): [True: 116M, False: 0]
  ------------------
  542|   116M|        return igraph_i_rng_get_uint32_bounded(rng, range);
  543|   116M|    } else {
  544|      0|        return igraph_i_rng_get_uint64_bounded(rng, range);
  545|      0|    }
  546|   116M|#endif
  547|   116M|}
random.c:igraph_i_rng_get_uint32_bounded:
  428|   116M|static uint32_t igraph_i_rng_get_uint32_bounded(igraph_rng_t *rng, uint32_t range) {
  429|       |    /* Debiased integer multiplication -- Lemire's method
  430|       |     * from https://www.pcg-random.org/posts/bounded-rands.html */
  431|   116M|    uint32_t x, l, t = (-range) % range;
  432|   116M|    uint64_t m;
  433|   116M|    do {
  434|   116M|        x = igraph_i_rng_get_uint32(rng);
  435|   116M|        m = (uint64_t)(x) * (uint64_t)(range);
  436|   116M|        l = (uint32_t)m;
  437|   116M|    } while (l < t);
  ------------------
  |  Branch (437:14): [True: 0, False: 116M]
  ------------------
  438|   116M|    return m >> 32;
  439|   116M|}
random.c:igraph_i_rng_get_uint32:
  416|   116M|static uint32_t igraph_i_rng_get_uint32(igraph_rng_t *rng) {
  417|   116M|    return igraph_i_rng_get_random_bits(rng, 32);
  418|   116M|}
random.c:igraph_i_rng_get_random_bits_uint64:
  375|   115M|static uint64_t igraph_i_rng_get_random_bits_uint64(igraph_rng_t *rng, uint8_t bits) {
  376|   115M|    const igraph_rng_type_t *type = rng->type;
  377|   115M|    igraph_int_t rng_bitwidth = igraph_rng_bits(rng);
  378|   115M|    uint64_t result;
  379|       |
  380|   115M|    if (rng_bitwidth >= bits) {
  ------------------
  |  Branch (380:9): [True: 0, False: 115M]
  ------------------
  381|       |        /* keep the high bits as RNGs sometimes tend to have lower entropy in
  382|       |         * low bits than in high bits */
  383|      0|        result = type->get(rng->state) >> (rng_bitwidth - bits);
  384|   115M|    } else {
  385|   115M|        result = 0;
  386|   115M|        do {
  387|   115M|            result = (result << rng_bitwidth) + type->get(rng->state);
  388|   115M|            bits -= rng_bitwidth;
  389|   115M|        } while (bits > rng_bitwidth);
  ------------------
  |  Branch (389:18): [True: 0, False: 115M]
  ------------------
  390|       |
  391|       |        /* and now the last piece */
  392|   115M|        result = (result << bits) + (type->get(rng->state) >> (rng_bitwidth - bits));
  393|   115M|    }
  394|       |
  395|   115M|    return result;
  396|   115M|}

rng_pcg32.c:igraph_rng_pcg32_seed:
   41|  3.56k|static igraph_error_t igraph_rng_pcg32_seed(void *vstate, igraph_uint_t seed) {
   42|  3.56k|    pcg32_random_t *state = (pcg32_random_t*) vstate;
   43|       |
   44|       |    /* PCG32 is seeded by a 64-bit state and a 64-bit sequence number (well, only
   45|       |     * 63 bits are used from the sequence number, though). Since the unified
   46|       |     * igraph RNG seeding interface provides a single igraph_uint_t as the seed,
   47|       |     * we use the seed to fill in the sequence number and use the state from
   48|       |     * PCG32_INITIALIZER */
   49|  3.56k|    if (seed == 0) {
  ------------------
  |  Branch (49:9): [True: 0, False: 3.56k]
  ------------------
   50|       |        /* If you feel the temptation to unify the two branches by running
   51|       |         * seed = pcg32_initializer.inc >> 1, don't.
   52|       |         * seed is an igraph_uint_t, so it can be 32-bit or 64-bit.
   53|       |         * pcg32_initializer.inc is always 64-bit.
   54|       |         */
   55|      0|        pcg32_srandom_r(state, pcg32_initializer.state, pcg32_initializer.inc >> 1);
  ------------------
  |  | 2398|      0|#define pcg32_srandom_r                 pcg_setseq_64_srandom_r
  ------------------
   56|  3.56k|    } else {
   57|  3.56k|        pcg32_srandom_r(state, pcg32_initializer.state, seed);
  ------------------
  |  | 2398|  3.56k|#define pcg32_srandom_r                 pcg_setseq_64_srandom_r
  ------------------
   58|  3.56k|    }
   59|       |
   60|  3.56k|    return IGRAPH_SUCCESS;
   61|  3.56k|}
rng_pcg32.c:igraph_rng_pcg32_get:
   36|   347M|static igraph_uint_t igraph_rng_pcg32_get(void *vstate) {
   37|   347M|    pcg32_random_t *state = (pcg32_random_t*) vstate;
   38|   347M|    return pcg32_random_r(state);
  ------------------
  |  | 2388|   347M|#define pcg32_random_r                  pcg_setseq_64_xsh_rr_32_random_r
  ------------------
   39|   347M|}

